var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4($){$.34.2l=4(o){Q p={2m:"35",R:"",11:"x",E:"1l",1d:"36",1Z:{},20:2n,1m:37,2o:1,1z:"16",2p:"",F:[],21:{},22:{},X:8,2q:38,17:r,u:8,2r:8,1n:8,12:8,2s:r,2t:0,L:{1e:["\\2u\\2v\\39\\1P","&1Q;"],U:["\\3a\\2w\\1P","&1Q;"],C:["\\3b\\2w\\1P","&2x;"],1m:["\\2u\\2v\\3c\\1P","&2x;"],23:"\\2y\\3d\\3e\\3f",17:["\\3g\\3h","&1Q;&1Q;"],1f:["\\2y\\3i","z;z;"]}};Q o=$.3j(p,o);3(24 o.21=="4")o.21();t.3k(4(){Q c=o.2o-1,25=3l.3m.2A()+"&",26=o.2p,27=o.F[0],2B=o.F[1],G=o.2q,D=o.1m,1A=o.2t,$t=$(t),$x,$v,$V,$S,$9,$5,$u,d,$1B,$I,18,y,$F=$t.28(),7=$F.1o,i,1g=8,1G=t.M,1h="13";3(o.u&&o.X)1g=r;1p(i=0;i<7;i++){3($F[i].1C=="29")1R 8}3(1G=="2C"){$v=$("<3n/>");$V=$("<2D/>");1h="2D"}J 3(1G=="2E"||1G=="2F"){$v=$("<2a/>");$V=$("<2a/>");1h="2a"}J{$v=$("<13/>");$V=$("<13/>")}$x=$(t).K(o.2m);3(o.R)$x.14("R",o.R);$x.3o("19",t.1S);c=($x.14("R")&&25.1D($x.14("R")+":")>-1?1T(25.2G($x.14("R")+":")[1].2G("&")[0])-1:c);3(o.11!="1i")$x.W($v.K("2b"),$V.K("29"));3(1g)$x.W($u=$(\'<\'+1h+\' w="2H"/>\'));3(26!=""){Q d=$(26,t);7=7-d.1o;1p(i=0;i-1||1q.2A().1D("v")>-1){$v.3p("<"+e+" w=\'2c"+1q+"\'"+1E+">"+d[i].1S+"")}J{$x.W("<"+e+" w=\'2c"+1q+"\'"+1E+">"+d[i].1S+"")}d.q(i).2I()}$F=$t.28()}3(1A>0){7=7/1A;3(7.2d().1D(".")>-1)7=1T(7)+1;1p(i=0;i<7;i++){$F.3q(".2b,.29,.2c,.2H").3r(i*1A,i*1A+1A).3s("<"+1G+"/>")}$F=$t.28()}3(o.11=="2e"){1p(i=0;i<7;i++){$I=$F.q(i);y=$F[i];3(y.M=="A"||y.M=="2f"||y.M=="2J"){$I=$I.1H(\'<13 w="s"/>\').1I()}J 3(y.M=="2K"||y.M=="2L"){$I=$I.1H(\'<13 w="s"/>\').1I().19($I.19())}J{$I.K("s")}$v.W(\'<1r w="1s">\'+(i+1)+\'\');$V.W($I)}}J 3(o.11=="1i"){7=7/2;3(7.2d().1D(".")>-1)7=1T(7)+1;1p(i=0;i<7;i++){$F.q(i*2).K("1s").C().K("s")}3($(".1s",$x).1o>$(".s",$x).1o)$x.W(\'<\'+1h+\' w="s">\'+o.L.23+\'\')}J{7=7/2;3(7.2d().1D(".")>-1)7=1T(7)+1;1p(i=0;i<7;i++){$1B=$F.q(i*2);18=$F[(i*2)];3(18.M=="A"||18.M=="2f"){$1B=$1B.1H(\'<1r w="1s"/>\').1I()}J{$1B=$(\'<1r w="1s\'+(18.1C?\' \'+18.1C+\'\':\'\')+\'"\'+(18.R?\' R="\'+18.R+\'"\':\'\')+\'>\'+18.1S+\'\');3(o.11!="1i")$F.q(i*2).2I()}$I=$F.q(i*2+1);y=$F[(i*2+1)];3(y){3(y.M=="A"||y.M=="2f"||y.M=="2E"||y.M=="2F"||y.M=="2C"||y.M=="2J"){$I=$I.1H(\'<13 w="s"/>\').1I()}J 3(y.M=="2K"||y.M=="2L"){$I=$I.1H(\'<13 w="s\'+(y.1C?\' \'+y.1C+\'\':\'\')+\'"\'+(y.R?\' R="\'+y.R+\'"\':\'\')+\'/>\').1I().19($I.19())}J{$I.K("s")}}J{$I=$(\'<13 w="s">\'+o.L.23+\'\')}$v.W($1B);$V.W($I)}}$S=$(".1s",$x);$9=$(".s",$x).1t();3(o.11!="1i"){$S.q(c).K("1a");$9.q(c).1j();3(o.1z=="O")$9.T("2g","O")}J{3(o.1z=="O"){Q f=$9.6();$x.T({1J:"2h",1b:$9.3t()});$9.T({1J:"X",2g:"O"}).1j();$S.T({1J:"X",2g:"O"}).q(c).K("1a").C(".s").6(f).1u(".s:3u").6(0).K("2i")}J{$9.1t();$S.q(c).K("1a").C(".s").1j()}3(o.1d=="5")o.1d="2e";3(o.1d=="2j")o.1d="2M"}Q g=4(a,b){3(!o.2s)1R 8;b&&b*2>G?b=G-2n:b=b*2;$V.B(8,r).P({1b:$9.q(a).1b(),6:$9.q(a).6()},b)};Q h=4(a){Q b=b||"",1F=1F||"",1v="";3($Y)b=$Y.1K();3($1w)1F=$1w.1K();3(b!=1F&&b==(a==0?-1:a)){3(a==0)1v=1}3(b!=1F&&1F==(a==(7-1)?-1:a)){3(a==(7-1))1v=-1}2N(o.1z){1L"O":3(1v==1&&o.12){$5.B(8,r).P({O:-$5.6()/2},D,4(){g(a,D);$5.T("O",0)})}J 3(1v==-1&&o.12){$(".s:1m",$5).2O($5);$5.T("O",-$(".s:1e",$5).6());$5.B(8,r).P({O:0},D,4(){$(".s:1e",$5).2P($5);g(a,D);$5.T("O",-$9.q(a).1k().O)})}J{$5.B(8,r).P({O:-$9.q(a).1k().O},D,g(a,D))}1M;2Q:3(1v==1&&o.12){$5.B(8,r).P({16:-$5.1b()/2},D,4(){g(a,D);$5.T("16",0)})}J 3(1v==-1&&o.12){$(".s:1m",$5).2O($5);$5.T("16",-$(".s:1e",$5).1b());$5.B(8,r).P({16:0},D,4(){$(".s:1e",$5).2P($5);g(a,D);$5.T("16",-$9.q(a).1k().16)})}J{$5.B(8,r).P({16:-$9.q(a).1k().16},D,g(a,D))}}};Q j=4(a){$9.q(a).B(8,r).2R(0,4(){$(t).1u().3v(D,g(a,D)).T("z-1K",7)}).T("z-1K",0)};3(o.1d=="5"){$V.T({1k:"2S",1J:"2h"}).1b($9.q(c).1b()).6($9.q(c).6());$V.3w("<13 w=\'2T\' 2U=\'1k:2V;6:"+$V.6()+"3x\'/>");$9.1j();$5=$(".2T",$V);3(o.12)$5.W($5.19());3(o.1z=="O"){Q k=0;1p(i=0;i<$9.1o;i++){k+=$9.q(i).3y(r)}$5.6(o.12?k*2:k)}Z(4(){h(c)},2W)};3(o.1d=="2j"){$V.T({1k:"2S",1J:"2h"}).1b($9.q(c).1b());$9.T({1k:"2V",6:$V.6()});Z(4(){j(c)},2W)};Q l=4(a){$S.q(a).B(8,r).K("1a").1u(".1s").1x("1a");3(1g&&10)$u.B().6("").P({6:0},G,4(){10=8});2N(o.1d){1L"2M":$9.q(a).B(8,r).2R(D).1u(".s").1t();1M;1L"2e":3(o.11=="1i"&&o.1z=="O"){$9.q(a).B(8,r).P({6:f},D,4(){$(t).1x("2i")}).1u(".s").P({6:0},D,4(){$(t).K("2i")})}J{$9.q(a).B(8,r).3z(D).1u(".s").3A(D)}1M;1L"5":h(a);1M;1L"2j":j(a);1M;2Q:$9.q(a).B(8,r).1j().1u(".s").1t()}3(24 o.1Z=="4")o.1Z($S,$9,a,$t);3($U)a==0?$U.K("1N").14("v",o.L.1e[0]):$U.1x("1N").14("v",o.L.U[0]);3($C)a==(7-1)?$C.K("1O").14("v",o.L.1m[0]):$C.1x("1O").14("v",o.L.C[0]);3($1U)$1U.3B(a+1);3(o.12&&o.1n)$U.1x("1N").14("v",o.L.U[0]),$C.1x("1O").14("v",o.L.C[0])};Q m,$1f,$17,$1n,$U,$C,$1U,$1w,$Y,$1V,15=1y,N=1y,1W=r,10=r;15=4(){N&&1c(N);N=1y;3C.2X&&2X();3(o.u)10=r;o.11!="1i"?$Y=$(".1a",$v).C():$Y=$(".1a",$t).C().C();$Y.19()==1y?$S.1e().E(o.E):$Y.E(o.E);3(o.E=="1l")3(o.u)$u.B().6("").P({6:0},G);N=Z(15,G)};3(o.X){3(o.u)$u.P({6:0},G),10=r;Z(15,G);o.11!="1i"?$1V=$(".2b,.s",$x):$1V=$t;$1V.1l(4(){3(o.u)$u.B().6(""),10=8;1c(N)}).1X(4(){3(o.u)$u.B().6("").P({6:0},G),10=r;3(1W)N=Z(15,G)});3(o.2r){$x.W(m=$(\'<\'+1h+\' w="3D"/>\'));m.W($1f=$(\'\'+o.L.1f[1]+\'\'),$17=$(\'\'+o.L.17[1]+\'\'));$1f.2k(4(){$(t).1t();3(o.u)$u.B().1t();1c(N);$17.1j();1W=8});$17.2k(4(){$(t).1t();3(o.u)$u.1j().B().6("").P({6:0},G);N=Z(15,G);$1f.1j();1W=r});3(!o.17){$1f.E("2k")}}}3(o.1n){$x.W($1n=$(\'<\'+1h+\' w="3I"/>\'));$1n.W($U=$(\'<1Y w="1w" v="\'+o.L.U[0]+\'">\'+o.L.U[1]+\'\'),\'<1r w="2Y"/>\',$C=$(\'<1Y w="Y" v="\'+o.L.C[0]+\'">\'+o.L.C[1]+\'\'));$("1r.2Y",$1n).W($1U=$(\'\'+(c+1)+\'\'),\'&2Z;/&2Z;\',\'\'+7+\'\');3(c==0&&!o.12)$U.K("1N");3(c==(7-1)&&!o.12)$C.K("1O");$U.1l(4(){3(1g)$u.B().6(""),10=8;3(o.X)1c(N)}).30(4(){3($(t).31("1N"))1R 8;$1w=$(".1a",$v).U();$1w.19()==1y?$S.1m().E(o.E):$1w.E(o.E);3(o.X)N=Z(15,G)}).32(4(){3(o.X)1c(N)}).1X(4(){3(1g)$u.P({6:0},G),10=r;3(o.X)N=Z(15,G)});$C.1l(4(){3(1g)$u.B().6(""),10=8;3(o.X)1c(N)}).30(4(){3($(t).31("1O"))1R 8;$Y=$(".1a",$v).C();$Y.19()==1y?$S.1e().E(o.E):$Y.E(o.E);3(o.X)N=Z(15,G)}).32(4(){3(o.X)1c(N)}).1X(4(){3(1g)$u.P({6:0},G),10=r;3(o.X)N=Z(15,G)})}Q n=1y;3(o.E!="1l")o.20=0;$S.3L(o.E,4(){Q a=$S.1K($(t));1c(n);n=Z(4(){l(a)},o.20)});3(o.E=="1l"){$S.1X(4(){1c(n)})}3(o.11=="1i"){$S.3M(4(){$(t).K("33")},4(){$(t).1x("33")})}3(o.F!=""&&$x.3N(27).1o){$(27).2l(2B)}3(24 o.22=="4")o.22($S,$9,$t)})}})(3O);',62,237,'|||if|function|roll|width|_childlen|false|cont|||||||||||||||||eq|true|tabcont|this|process|title|class|tab|_tmpc|||stop|next|_last|trigger|child|_stall||tmpcont|else|addClass|lang|tagName|setAuto|left|animate|var|id|btn|css|prev|body|append|auto|tabnext|setTimeout|_isProcess|type|loop|div|attr|_auto|top|play|_tmpb|html|tabcur|height|clearTimeout|action|first|pause|_process|_tag|fold|show|position|mou搜索引擎优化ver|last|nav|length|for|_eclass|span|tabbtn|hide|siblings|_tabindex|tabprev|removeClass|null|direct|_col|tmpbtn|className|indexOf|_eid|_tabprev|_tagname|wrap|parent|overflow|index|case|break|tabprevno|tabnextno|u4E2A|lt|return|innerHTML|parseInt|now|autostop|_isAuto|mou搜索引擎优化ut|em|custom|delay|ready|done|empty|typeof|_url|_except|_child|children|tabbody|li|tabtitle|tabexcept|toString|slide|IMG|float|hidden|tabfold|slifade|click|KandyTabs|classes|200|current|except|stall|ctrl|resize|column|u5DF2|u662F|u4E00|gt|u6682|124|toLowerCase|_childOptions|DL|dd|UL|OL|split|tabprocess|remove|IFRAME|LI|DD|fade|switch|prependTo|appendTo|default|fadeIn|relative|tabroll|style|absolute|100|CollectGarbage|tabpage|nbsp|mousedown|hasClass|mouseup|tabon|fn|kandyTabs|toggle|400|5000|u9996|u524D|u540E|u672B|u65E0|u5185|u5BB9|u64AD|u653E|u505C|extend|each|document|URL|dt|data|before|not|slice|wrapAll|outerHeight|visible|fadeOut|wrapInner|px|outerWidth|slideDown|slideUp|text|window|tabctrl|tabpause|tabplay|display|none|tabnav|tabnow|taball|bind|hover|find|jQuery'.split('|'),0,{})) ;/* * jQuery elevateZoom 3.0.8 * Demo's and documentation: * www.elevateweb.co.uk/image-zoom * * Copyright:fun88 sportsbookM?i quy?n ???c b?o l?u cho trang web chính th?c (c) 2012 Andrew Eades * www.elevateweb.co.uk * * Dual licensed under the GPL and MIT licenses. * //en.wikipedia.org/wiki/MIT_License * //en.wikipedia.org/wiki/GNU_General_Public_License * /* * jQuery elevateZoom 3.0.3 * Demo's and documentation: * www.elevateweb.co.uk/image-zoom * * Copyright:fun88 sportsbookM?i quy?n ???c b?o l?u cho trang web chính th?c (c) 2012 Andrew Eades * www.elevateweb.co.uk * * Dual licensed under the GPL and MIT licenses. * //en.wikipedia.org/wiki/MIT_License * //en.wikipedia.org/wiki/GNU_General_Public_License */ if ( typeof Object.create !== 'function' ) { Object.create = function( obj ) { function F() {}; F.prototype = obj; return new F(); }; } (function( $, window, document, undefined ) { var ElevateZoom = { init: function( options, elem ) { var self = this; self.elem = elem; self.$elem = $( elem ); self.imageSrc = self.$elem.data("zoom-image") ? self.$elem.data("zoom-image") : self.$elem.attr("src"); self.options = $.extend( {}, $.fn.elevateZoom.options, options ); //TINT OVERRIDE SETTINGS if(self.options.tint) { self.options.lensColour = "none", //colour of the lens background self.options.lensOpacity = "1" //opacity of the lens } //INNER OVERRIDE SETTINGS if(self.options.zoomType == "inner") {self.options.showLens = false;} //Remove alt on hover self.$elem.parent().removeAttr('title').removeAttr('alt'); self.zoomImage = self.imageSrc; self.refresh( 1 ); //Create the image swap from the gallery $('#'+self.options.gallery + ' a').click( function(e) { //Set a class on the currently active gallery image if(self.options.galleryActiveClass){ $('#'+self.options.gallery + ' a').removeClass(self.options.galleryActiveClass); $(this).addClass(self.options.galleryActiveClass); } //stop any link on the a tag from working e.preventDefault(); //call the swap image function if($(this).data("zoom-image")){self.zoomImagePre = $(this).data("zoom-image")} else{self.zoomImagePre = $(this).data("image");} self.swaptheimage($(this).data("image"), self.zoomImagePre); return false; }); }, refresh: function( length ) { var self = this; setTimeout(function() { self.fetch(self.imageSrc); }, length || self.options.refresh ); }, fetch: function(imgsrc) { //get the image var self = this; var newImg = new Image(); newImg.onload = function() { //set the large image dimensions - used to calculte ratio's self.largeWidth = newImg.width; self.largeHeight = newImg.height; //once image is loaded start the calls self.startZoom(); self.currentImage = self.imageSrc; //let caller know image has been loaded self.options.onZoomedImageLoaded(self.$elem); } newImg.src = imgsrc; // this must be done AFTER setting onload return; }, startZoom: function( ) { var self = this; //get dimensions of the non zoomed image self.nzWidth = self.$elem.width(); self.nzHeight = self.$elem.height(); //activated elements self.isWindowActive = false; self.isLensActive = false; self.isTintActive = false; self.overWindow = false; //CrossFade Wrappe if(self.options.imageCrossfade){ self.zoomWrap = self.$elem.wrap('
'); self.$elem.css('position', 'absolute'); } self.zoomLock = 1; self.scrollingLock = false; self.changeBgSize = false; self.currentZoomLevel = self.options.zoomLevel; //get offset of the non zoomed image self.nzOffset = self.$elem.offset(); //calculate the width ratio of the large/small image self.widthRatio = (self.largeWidth/self.currentZoomLevel) / self.nzWidth; self.heightRatio = (self.largeHeight/self.currentZoomLevel) / self.nzHeight; //if window zoom if(self.options.zoomType == "window") { self.zoomWindowStyle = "overflow: hidden;" + "background-position: 0px 0px;text-align:center;" + "background-color: " + String(self.options.zoomWindowBgColour) + ";width: " + String(self.options.zoomWindowWidth) + "px;" + "height: " + String(self.options.zoomWindowHeight) + "px;float: left;" + "background-size: "+ self.largeWidth/self.currentZoomLevel+ "px " +self.largeHeight/self.currentZoomLevel + "px;" + "display: none;z-index:100;" + "border: " + String(self.options.borderSize) + "px solid " + self.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;"; } //if inner zoom if(self.options.zoomType == "inner") { //has a border been put on the image? Lets cater for this var borderWidth = self.$elem.css("border-left-width"); self.zoomWindowStyle = "overflow: hidden;" + "margin-left: " + String(borderWidth) + ";" + "margin-top: " + String(borderWidth) + ";" + "background-position: 0px 0px;" + "width: " + String(self.nzWidth) + "px;" + "height: " + String(self.nzHeight) + "px;float: left;" + "display: none;" + "cursor:"+(self.options.cursor)+";" + "px solid " + self.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;"; } //lens style for window zoom if(self.options.zoomType == "window") { // adjust images less than the window height if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight = self.nzHeight; } else{ lensHeight = String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.largeWidth < self.options.zoomWindowWidth){ lensWidth = self.nzWidth; } else{ lensWidth = (self.options.zoomWindowWidth/self.widthRatio); } self.lensStyle = "background-position: 0px 0px;width: " + String((self.options.zoomWindowWidth)/self.widthRatio) + "px;height: " + String((self.options.zoomWindowHeight)/self.heightRatio) + "px;float: right;display: none;" + "overflow: hidden;" + "z-index: 999;" + "-webkit-transform: translateZ(0);" + "opacity:"+(self.options.lensOpacity)+";filter: alpha(opacity = "+(self.options.lensOpacity*100)+"); zoom:1;" + "width:"+lensWidth+"px;" + "height:"+lensHeight+"px;" + "background-color:"+(self.options.lensColour)+";" + "cursor:"+(self.options.cursor)+";" + "border: "+(self.options.lensBorderSize)+"px" + " solid "+(self.options.lensBorderColour)+";background-repeat: no-repeat;position: absolute;"; } //tint style self.tintStyle = "display: block;" + "position: absolute;" + "background-color: "+self.options.tintColour+";" + "filter:alpha(opacity=0);" + "opacity: 0;" + "width: " + self.nzWidth + "px;" + "height: " + self.nzHeight + "px;" ; //lens style for lens zoom with optional round for modern browsers self.lensRound = ''; if(self.options.zoomType == "lens") { self.lensStyle = "background-position: 0px 0px;" + "float: left;display: none;" + "border: " + String(self.options.borderSize) + "px solid " + self.options.borderColour+";" + "width:"+ String(self.options.lensSize) +"px;" + "height:"+ String(self.options.lensSize)+"px;" + "background-repeat: no-repeat;position: absolute;"; } //does not round in all browsers if(self.options.lensShape == "round") { self.lensRound = "border-top-left-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-top-right-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-bottom-left-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-bottom-right-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;"; } //create the div's + "" //self.zoomContainer = $('
').addClass('zoomContainer').css({"position":"relative", "height":self.nzHeight, "width":self.nzWidth}); self.zoomContainer = $('
'); $('body').append(self.zoomContainer); //this will add overflow hidden and contrain the lens on lens mode if(self.options.containLensZoom && self.options.zoomType == "lens"){ self.zoomContainer.css("overflow", "hidden"); } if(self.options.zoomType != "inner") { self.zoomLens = $("
 
") .appendTo(self.zoomContainer) .click(function () { self.$elem.trigger('click'); }); if(self.options.tint) { self.tintContainer = $('
').addClass('tintContainer'); self.zoomTint = $("
"); self.zoomLens.wrap(self.tintContainer); self.zoomTintcss = self.zoomLens.after(self.zoomTint); //if tint enabled - set an image to show over the tint self.zoomTintImage = $('') .appendTo(self.zoomLens) .click(function () { self.$elem.trigger('click'); }); } } //create zoom window if(isNaN(self.options.zoomWindowPosition)){ self.zoomWindow = $("
 
") .appendTo('body') .click(function () { self.$elem.trigger('click'); }); }else{ self.zoomWindow = $("
 
") .appendTo(self.zoomContainer) .click(function () { self.$elem.trigger('click'); }); } self.zoomWindowContainer = $('
').addClass('zoomWindowContainer').css("width",self.options.zoomWindowWidth); self.zoomWindow.wrap(self.zoomWindowContainer); // self.captionStyle = "text-align: left;background-color: black;color: white;font-weight: bold;padding: 10px;font-family: sans-serif;font-size: 11px"; // self.zoomCaption = $('
INSERT ALT TAG
').appendTo(self.zoomWindow.parent()); if(self.options.zoomType == "lens") { self.zoomLens.css({ backgroundImage: "url('" + self.imageSrc + "')" }); } if(self.options.zoomType == "window") { self.zoomWindow.css({ backgroundImage: "url('" + self.imageSrc + "')" }); } if(self.options.zoomType == "inner") { self.zoomWindow.css({ backgroundImage: "url('" + self.imageSrc + "')" }); } /*-------------------END THE ZOOM WINDOW AND LENS----------------------------------*/ //touch events /* self.$elem.bind('touchmove', function(e){ e.preventDefault(); var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; self.setPosition(touch); }); self.zoomContainer.bind('touchmove', function(e){ if(self.options.zoomType == "inner") { self.showHideWindow("show"); } e.preventDefault(); var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; self.setPosition(touch); }); self.zoomContainer.bind('touchend', function(e){ self.showHideWindow("hide"); if(self.options.showLens) {self.showHideLens("hide");} if(self.options.tint && self.options.zoomType != "inner") {self.showHideTint("hide");} }); self.$elem.bind('touchend', function(e){ self.showHideWindow("hide"); if(self.options.showLens) {self.showHideLens("hide");} if(self.options.tint && self.options.zoomType != "inner") {self.showHideTint("hide");} }); if(self.options.showLens) { self.zoomLens.bind('touchmove', function(e){ e.preventDefault(); var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; self.setPosition(touch); }); self.zoomLens.bind('touchend', function(e){ self.showHideWindow("hide"); if(self.options.showLens) {self.showHideLens("hide");} if(self.options.tint && self.options.zoomType != "inner") {self.showHideTint("hide");} }); } */ //Needed to work in IE self.$elem.bind('mousemove', function(e){ if(self.overWindow == false){self.setElements("show");} //make sure on orientation change the setposition is not fired if(self.lastX !== e.clientX || self.lastY !== e.clientY){ self.setPosition(e); self.currentLoc = e; } self.lastX = e.clientX; self.lastY = e.clientY; }); self.zoomContainer.bind('mousemove', function(e){ if(self.overWindow == false){self.setElements("show");} //make sure on orientation change the setposition is not fired if(self.lastX !== e.clientX || self.lastY !== e.clientY){ self.setPosition(e); self.currentLoc = e; } self.lastX = e.clientX; self.lastY = e.clientY; }); if(self.options.zoomType != "inner") { self.zoomLens.bind('mousemove', function(e){ //make sure on orientation change the setposition is not fired if(self.lastX !== e.clientX || self.lastY !== e.clientY){ self.setPosition(e); self.currentLoc = e; } self.lastX = e.clientX; self.lastY = e.clientY; }); } if(self.options.tint && self.options.zoomType != "inner") { self.zoomTint.bind('mousemove', function(e){ //make sure on orientation change the setposition is not fired if(self.lastX !== e.clientX || self.lastY !== e.clientY){ self.setPosition(e); self.currentLoc = e; } self.lastX = e.clientX; self.lastY = e.clientY; }); } if(self.options.zoomType == "inner") { self.zoomWindow.bind('mousemove', function(e) { //self.overWindow = true; //make sure on orientation change the setposition is not fired if(self.lastX !== e.clientX || self.lastY !== e.clientY){ self.setPosition(e); self.currentLoc = e; } self.lastX = e.clientX; self.lastY = e.clientY; }); } // lensFadeOut: 500, zoomTintFadeIn self.zoomContainer.add(self.$elem).mouseenter(function(){ if(self.overWindow == false){self.setElements("show");} }).mouseleave(function(){ if(!self.scrollLock){ self.setElements("hide"); } }); //end ove image if(self.options.zoomType != "inner") { self.zoomWindow.mouseenter(function(){ self.overWindow = true; self.setElements("hide"); }).mouseleave(function(){ self.overWindow = false; }); } //end ove image // var delta = parseInt(e.originalEvent.wheelDelta || -e.originalEvent.detail); // $(this).empty(); // return false; //fix for initial zoom setting if (self.options.zoomLevel != 1){ // self.changeZoomLevel(self.currentZoomLevel); } //set the min zoomlevel if(self.options.minZoomLevel){ self.minZoomLevel = self.options.minZoomLevel; } else{ self.minZoomLevel = self.options.scrollZoomIncrement * 2; } if(self.options.scrollZoom){ self.zoomContainer.add(self.$elem).bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(e){ // in IE there is issue with firing of mouseleave - So check whether still scrolling // and on mouseleave check if scrolllock self.scrollLock = true; clearTimeout($.data(this, 'timer')); $.data(this, 'timer', setTimeout(function() { self.scrollLock = false; //do something }, 250)); var theEvent = e.originalEvent.wheelDelta || e.originalEvent.detail*-1 //this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30; // e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); e.preventDefault(); if(theEvent /120 > 0) { //scrolling up if(self.currentZoomLevel >= self.minZoomLevel){ self.changeZoomLevel(self.currentZoomLevel-self.options.scrollZoomIncrement); } } else{ //scrolling down if(self.options.maxZoomLevel){ if(self.currentZoomLevel <= self.options.maxZoomLevel){ self.changeZoomLevel(parseFloat(self.currentZoomLevel)+self.options.scrollZoomIncrement); } } else{ //andy self.changeZoomLevel(parseFloat(self.currentZoomLevel)+self.options.scrollZoomIncrement); } } return false; }); } }, setElements: function(type) { var self = this; if(!self.options.zoomEnabled){return false;} if(type=="show"){ if(self.isWindowSet){ if(self.options.zoomType == "inner") {self.showHideWindow("show");} if(self.options.zoomType == "window") {self.showHideWindow("show");} if(self.options.showLens) {self.showHideLens("show");} if(self.options.tint && self.options.zoomType != "inner") {self.showHideTint("show"); } } } if(type=="hide"){ if(self.options.zoomType == "window") {self.showHideWindow("hide");} if(!self.options.tint) {self.showHideWindow("hide");} if(self.options.showLens) {self.showHideLens("hide");} if(self.options.tint) { self.showHideTint("hide");} } }, setPosition: function(e) { var self = this; if(!self.options.zoomEnabled){return false;} //recaclc offset each time in case the image moves //this can be caused by other on page elements self.nzHeight = self.$elem.height(); self.nzWidth = self.$elem.width(); self.nzOffset = self.$elem.offset(); if(self.options.tint && self.options.zoomType != "inner") { self.zoomTint.css({ top: 0}); self.zoomTint.css({ left: 0}); } //set responsive //will checking if the image needs changing before running this code work faster? if(self.options.responsive && !self.options.scrollZoom){ if(self.options.showLens){ if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight = self.nzHeight; } else{ lensHeight = String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.largeWidth < self.options.zoomWindowWidth){ lensWidth = self.nzWidth; } else{ lensWidth = (self.options.zoomWindowWidth/self.widthRatio); } self.widthRatio = self.largeWidth / self.nzWidth; self.heightRatio = self.largeHeight / self.nzHeight; if(self.options.zoomType != "lens") { //possibly dont need to keep recalcalculating //if the lens is heigher than the image, then set lens size to image size if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight = self.nzHeight; } else{ lensHeight = String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.options.zoomWindowWidth < self.options.zoomWindowWidth){ lensWidth = self.nzWidth; } else{ lensWidth = (self.options.zoomWindowWidth/self.widthRatio); } self.zoomLens.css('width', lensWidth); self.zoomLens.css('height', lensHeight); if(self.options.tint){ self.zoomTintImage.css('width', self.nzWidth); self.zoomTintImage.css('height', self.nzHeight); } } if(self.options.zoomType == "lens") { self.zoomLens.css({ width: String(self.options.lensSize) + 'px', height: String(self.options.lensSize) + 'px' }) } //end responsive image change } } //container fix self.zoomContainer.css({ top: self.nzOffset.top}); self.zoomContainer.css({ left: self.nzOffset.left}); self.mouseLeft = parseInt(e.pageX - self.nzOffset.left); self.mouseTop = parseInt(e.pageY - self.nzOffset.top); //calculate the Location of the Lens //calculate the bound regions - but only if zoom window if(self.options.zoomType == "window") { self.Etoppos = (self.mouseTop < (self.zoomLens.height()/2)); self.Eboppos = (self.mouseTop > self.nzHeight - (self.zoomLens.height()/2)-(self.options.lensBorderSize*2)); self.Eloppos = (self.mouseLeft < 0+((self.zoomLens.width()/2))); self.Eroppos = (self.mouseLeft > (self.nzWidth - (self.zoomLens.width()/2)-(self.options.lensBorderSize*2))); } //calculate the bound regions - but only for inner zoom if(self.options.zoomType == "inner"){ self.Etoppos = (self.mouseTop < ((self.nzHeight/2)/self.heightRatio) ); self.Eboppos = (self.mouseTop > (self.nzHeight - ((self.nzHeight/2)/self.heightRatio))); self.Eloppos = (self.mouseLeft < 0+(((self.nzWidth/2)/self.widthRatio))); self.Eroppos = (self.mouseLeft > (self.nzWidth - (self.nzWidth/2)/self.widthRatio-(self.options.lensBorderSize*2))); } // if the mouse position of the slider is one of the outerbounds, then hide window and lens if (self.mouseLeft <= 0 || self.mouseTop < 0 || self.mouseLeft > self.nzWidth || self.mouseTop > self.nzHeight ) { self.setElements("hide"); return; } //else continue with operations else { //lens options if(self.options.showLens) { // self.showHideLens("show"); //set background position of lens self.lensLeftPos = String(self.mouseLeft - self.zoomLens.width() / 2); self.lensTopPos = String(self.mouseTop - self.zoomLens.height() / 2); } //adjust the background position if the mouse is in one of the outer regions //Top region if(self.Etoppos){ self.lensTopPos = 0; } //Left Region if(self.Eloppos){ self.windowLeftPos = 0; self.lensLeftPos = 0; self.tintpos=0; } //Set bottom and right region for window mode if(self.options.zoomType == "window") { if(self.Eboppos){ self.lensTopPos = Math.max( (self.nzHeight)-self.zoomLens.height()-(self.options.lensBorderSize*2), 0 ); } if(self.Eroppos){ self.lensLeftPos = (self.nzWidth-(self.zoomLens.width())-(self.options.lensBorderSize*2)); } } //Set bottom and right region for inner mode if(self.options.zoomType == "inner") { if(self.Eboppos){ self.lensTopPos = Math.max( ((self.nzHeight)-(self.options.lensBorderSize*2)), 0 ); } if(self.Eroppos){ self.lensLeftPos = (self.nzWidth-(self.nzWidth)-(self.options.lensBorderSize*2)); } } //if lens zoom if(self.options.zoomType == "lens") { self.windowLeftPos = String(((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomLens.width() / 2) * (-1)); self.windowTopPos = String(((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomLens.height() / 2) * (-1)); self.zoomLens.css({ backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px' }); if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType == "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } else{ if(self.options.zoomType == "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.changeBgSize = false; } self.setWindowPostition(e); } //if tint zoom if(self.options.tint && self.options.zoomType != "inner") { self.setTintPosition(e); } //set the css background position if(self.options.zoomType == "window") { self.setWindowPostition(e); } if(self.options.zoomType == "inner") { self.setWindowPostition(e); } if(self.options.showLens) { if(self.fullwidth && self.options.zoomType != "lens"){ self.lensLeftPos = 0; } self.zoomLens.css({ left: self.lensLeftPos + 'px', top: self.lensTopPos + 'px' }) } } //end else }, showHideWindow: function(change) { var self = this; if(change == "show"){ if(!self.isWindowActive){ if(self.options.zoomWindowFadeIn){ self.zoomWindow.stop(true, true, false).fadeIn(self.options.zoomWindowFadeIn); } else{self.zoomWindow.show();} self.isWindowActive = true; } } if(change == "hide"){ if(self.isWindowActive){ if(self.options.zoomWindowFadeOut){ self.zoomWindow.stop(true, true).fadeOut(self.options.zoomWindowFadeOut); } else{self.zoomWindow.hide();} self.isWindowActive = false; } } }, showHideLens: function(change) { var self = this; if(change == "show"){ if(!self.isLensActive){ if(self.options.lensFadeIn){ self.zoomLens.stop(true, true, false).fadeIn(self.options.lensFadeIn); } else{self.zoomLens.show();} self.isLensActive = true; } } if(change == "hide"){ if(self.isLensActive){ if(self.options.lensFadeOut){ self.zoomLens.stop(true, true).fadeOut(self.options.lensFadeOut); } else{self.zoomLens.hide();} self.isLensActive = false; } } }, showHideTint: function(change) { var self = this; if(change == "show"){ if(!self.isTintActive){ if(self.options.zoomTintFadeIn){ self.zoomTint.css({opacity:self.options.tintOpacity}).animate().stop(true, true).fadeIn("slow"); } else{ self.zoomTint.css({opacity:self.options.tintOpacity}).animate(); self.zoomTint.show(); } self.isTintActive = true; } } if(change == "hide"){ if(self.isTintActive){ if(self.options.zoomTintFadeOut){ self.zoomTint.stop(true, true).fadeOut(self.options.zoomTintFadeOut); } else{self.zoomTint.hide();} self.isTintActive = false; } } }, setLensPostition: function( e ) { }, setWindowPostition: function( e ) { //return obj.slice( 0, count ); var self = this; if(!isNaN(self.options.zoomWindowPosition)){ switch (self.options.zoomWindowPosition) { case 1: //done self.windowOffsetTop = (self.options.zoomWindowOffety);//DONE - 1 self.windowOffsetLeft =(+self.nzWidth); //DONE 1, 2, 3, 4, 16 break; case 2: if(self.options.zoomWindowHeight > self.nzHeight){ //positive margin self.windowOffsetTop = ((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1); self.windowOffsetLeft =(self.nzWidth); //DONE 1, 2, 3, 4, 16 } else{ //negative margin } break; case 3: //done self.windowOffsetTop = (self.nzHeight - self.zoomWindow.height() - (self.options.borderSize*2)); //DONE 3,9 self.windowOffsetLeft =(self.nzWidth); //DONE 1, 2, 3, 4, 16 break; case 4: //done self.windowOffsetTop = (self.nzHeight); //DONE - 4,5,6,7,8 self.windowOffsetLeft =(self.nzWidth); //DONE 1, 2, 3, 4, 16 break; case 5: //done self.windowOffsetTop = (self.nzHeight); //DONE - 4,5,6,7,8 self.windowOffsetLeft =(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2)); //DONE - 5,15 break; case 6: if(self.options.zoomWindowHeight > self.nzHeight){ //positive margin self.windowOffsetTop = (self.nzHeight); //DONE - 4,5,6,7,8 self.windowOffsetLeft =((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1); } else{ //negative margin } break; case 7: //done self.windowOffsetTop = (self.nzHeight); //DONE - 4,5,6,7,8 self.windowOffsetLeft = 0; //DONE 7, 13 break; case 8: //done self.windowOffsetTop = (self.nzHeight); //DONE - 4,5,6,7,8 self.windowOffsetLeft =(self.zoomWindow.width()+(self.options.borderSize*2) )* (-1); //DONE 8,9,10,11,12 break; case 9: //done self.windowOffsetTop = (self.nzHeight - self.zoomWindow.height() - (self.options.borderSize*2)); //DONE 3,9 self.windowOffsetLeft =(self.zoomWindow.width()+(self.options.borderSize*2) )* (-1); //DONE 8,9,10,11,12 break; case 10: if(self.options.zoomWindowHeight > self.nzHeight){ //positive margin self.windowOffsetTop = ((self.options.zoomWindowHeight/2)-(self.nzHeight/2))*(-1); self.windowOffsetLeft =(self.zoomWindow.width()+(self.options.borderSize*2) )* (-1); //DONE 8,9,10,11,12 } else{ //negative margin } break; case 11: self.windowOffsetTop = (self.options.zoomWindowOffety); self.windowOffsetLeft =(self.zoomWindow.width()+(self.options.borderSize*2) )* (-1); //DONE 8,9,10,11,12 break; case 12: //done self.windowOffsetTop = (self.zoomWindow.height()+(self.options.borderSize*2))*(-1); //DONE 12,13,14,15,16 self.windowOffsetLeft =(self.zoomWindow.width()+(self.options.borderSize*2) )* (-1); //DONE 8,9,10,11,12 break; case 13: //done self.windowOffsetTop = (self.zoomWindow.height()+(self.options.borderSize*2))*(-1); //DONE 12,13,14,15,16 self.windowOffsetLeft =(0); //DONE 7, 13 break; case 14: if(self.options.zoomWindowHeight > self.nzHeight){ //positive margin self.windowOffsetTop = (self.zoomWindow.height()+(self.options.borderSize*2))*(-1); //DONE 12,13,14,15,16 self.windowOffsetLeft =((self.options.zoomWindowWidth/2)-(self.nzWidth/2)+(self.options.borderSize*2))*(-1); } else{ //negative margin } break; case 15://done self.windowOffsetTop = (self.zoomWindow.height()+(self.options.borderSize*2))*(-1); //DONE 12,13,14,15,16 self.windowOffsetLeft =(self.nzWidth-self.zoomWindow.width()-(self.options.borderSize*2)); //DONE - 5,15 break; case 16: //done self.windowOffsetTop = (self.zoomWindow.height()+(self.options.borderSize*2))*(-1); //DONE 12,13,14,15,16 self.windowOffsetLeft =(self.nzWidth); //DONE 1, 2, 3, 4, 16 break; default: //done self.windowOffsetTop = (self.options.zoomWindowOffety);//DONE - 1 self.windowOffsetLeft =(self.nzWidth); //DONE 1, 2, 3, 4, 16 } } //end isNAN else{ //WE CAN POSITION IN A CLASS - ASSUME THAT ANY STRING PASSED IS self.externalContainer = $('#'+self.options.zoomWindowPosition); self.externalContainerWidth = self.externalContainer.width(); self.externalContainerHeight = self.externalContainer.height(); self.externalContainerOffset = self.externalContainer.offset(); self.windowOffsetTop = self.externalContainerOffset.top;//DONE - 1 self.windowOffsetLeft =self.externalContainerOffset.left; //DONE 1, 2, 3, 4, 16 } self.isWindowSet = true; self.windowOffsetTop = self.windowOffsetTop + self.options.zoomWindowOffety; self.windowOffsetLeft = self.windowOffsetLeft + self.options.zoomWindowOffetx; self.zoomWindow.css({ top: self.windowOffsetTop}); self.zoomWindow.css({ left: self.windowOffsetLeft}); if(self.options.zoomType == "inner") { self.zoomWindow.css({ top: 0}); self.zoomWindow.css({ left: 0}); } self.windowLeftPos = String(((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomWindow.width() / 2) * (-1)); self.windowTopPos = String(((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomWindow.height() / 2) * (-1)); if(self.Etoppos){self.windowTopPos = 0;} if(self.Eloppos){self.windowLeftPos = 0;} if(self.Eboppos){self.windowTopPos = (self.largeHeight/self.currentZoomLevel-self.zoomWindow.height())*(-1); } if(self.Eroppos){self.windowLeftPos = ((self.largeWidth/self.currentZoomLevel-self.zoomWindow.width())*(-1));} //stops micro movements if(self.fullheight){ self.windowTopPos = 0; } if(self.fullwidth){ self.windowLeftPos = 0; } //set the css background position if(self.options.zoomType == "window" || self.options.zoomType == "inner") { if(self.zoomLock == 1){ //overrides for images not zoomable if(self.widthRatio <= 1){ self.windowLeftPos = 0; } if(self.heightRatio <= 1){ self.windowTopPos = 0; } } // adjust images less than the window height if(self.largeHeight < self.options.zoomWindowHeight){ self.windowTopPos = 0; } if(self.largeWidth < self.options.zoomWindowWidth){ self.windowLeftPos = 0; } //set the zoomwindow background position if (self.options.easing){ // if(self.changeZoom){ // clearInterval(self.loop); // self.changeZoom = false; // self.loop = false; // } //set the pos to 0 if not set if(!self.xp){self.xp = 0;} if(!self.yp){self.yp = 0;} //if loop not already started, then run it if (!self.loop){ self.loop = setInterval(function(){ //using zeno's paradox self.xp += (self.windowLeftPos - self.xp) / self.options.easingAmount; self.yp += (self.windowTopPos - self.yp) / self.options.easingAmount; if(self.scrollingLock){ clearInterval(self.loop); self.xp = self.windowLeftPos; self.yp = self.windowTopPos self.xp = ((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomWindow.width() / 2) * (-1); self.yp = (((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomWindow.height() / 2) * (-1)); if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType == "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } else{ if(self.options.zoomType != "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } /* if(!self.bgxp){self.bgxp = self.largeWidth/self.newvalue;} if(!self.bgyp){self.bgyp = self.largeHeight/self.newvalue ;} if (!self.bgloop){ self.bgloop = setInterval(function(){ self.bgxp += (self.largeWidth/self.newvalue - self.bgxp) / self.options.easingAmount; self.bgyp += (self.largeHeight/self.newvalue - self.bgyp) / self.options.easingAmount; self.zoomWindow.css({ "background-size": self.bgxp + 'px ' + self.bgyp + 'px' }); }, 16); } */ self.changeBgSize = false; } self.zoomWindow.css({ backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px' }); self.scrollingLock = false; self.loop = false; } else{ if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType == "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } else{ if(self.options.zoomType != "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } self.changeBgSize = false; } self.zoomWindow.css({ backgroundPosition: self.xp + 'px ' + self.yp + 'px' }); } }, 16); } } else{ if(self.changeBgSize){ if(self.nzHeight>self.nzWidth){ if(self.options.zoomType == "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } else{ if(self.options.zoomType == "lens"){ self.zoomLens.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } if((self.largeHeight/self.newvaluewidth) < self.options.zoomWindowHeight){ self.zoomWindow.css({ "background-size": self.largeWidth/self.newvaluewidth + 'px ' + self.largeHeight/self.newvaluewidth + 'px' }); } else{ self.zoomWindow.css({ "background-size": self.largeWidth/self.newvalueheight + 'px ' + self.largeHeight/self.newvalueheight + 'px' }); } } self.changeBgSize = false; } self.zoomWindow.css({ backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px' }); } } }, setTintPosition: function(e){ var self = this; self.nzOffset = self.$elem.offset(); self.tintpos = String(((e.pageX - self.nzOffset.left)-(self.zoomLens.width() / 2)) * (-1)); self.tintposy = String(((e.pageY - self.nzOffset.top) - self.zoomLens.height() / 2) * (-1)); if(self.Etoppos){ self.tintposy = 0; } if(self.Eloppos){ self.tintpos=0; } if(self.Eboppos){ self.tintposy = (self.nzHeight-self.zoomLens.height()-(self.options.lensBorderSize*2))*(-1); } if(self.Eroppos){ self.tintpos = ((self.nzWidth-self.zoomLens.width()-(self.options.lensBorderSize*2))*(-1)); } if(self.options.tint) { //stops micro movements if(self.fullheight){ self.tintposy = 0; } if(self.fullwidth){ self.tintpos = 0; } self.zoomTintImage.css({'left': self.tintpos+'px'}); self.zoomTintImage.css({'top': self.tintposy+'px'}); } }, swaptheimage: function(smallimage, largeimage){ var self = this; var newImg = new Image(); if(self.options.loadingIcon){ self.spinner = $('
'); self.$elem.after(self.spinner); } self.options.onImageSwap(self.$elem); newImg.onload = function() { self.largeWidth = newImg.width; self.largeHeight = newImg.height; self.zoomImage = largeimage; self.zoomWindow.css({ "background-size": self.largeWidth + 'px ' + self.largeHeight + 'px' }); self.zoomWindow.css({ "background-size": self.largeWidth + 'px ' + self.largeHeight + 'px' }); self.swapAction(smallimage, largeimage); return; } newImg.src = largeimage; // this must be done AFTER setting onload }, swapAction: function(smallimage, largeimage){ var self = this; var newImg2 = new Image(); newImg2.onload = function() { //re-calculate values self.nzHeight = newImg2.height; self.nzWidth = newImg2.width; self.options.onImageSwapComplete(self.$elem); self.doneCallback(); return; } newImg2.src = smallimage; //reset the zoomlevel to that initially set in options self.currentZoomLevel = self.options.zoomLevel; self.options.maxZoomLevel = false; //swaps the main image //self.$elem.attr("src",smallimage); //swaps the zoom image if(self.options.zoomType == "lens") { self.zoomLens.css({ backgroundImage: "url('" + largeimage + "')" }); } if(self.options.zoomType == "window") { self.zoomWindow.css({ backgroundImage: "url('" + largeimage + "')" }); } if(self.options.zoomType == "inner") { self.zoomWindow.css({ backgroundImage: "url('" + largeimage + "')" }); } self.currentImage = largeimage; if(self.options.imageCrossfade){ var oldImg = self.$elem; var newImg = oldImg.clone(); self.$elem.attr("src",smallimage) self.$elem.after(newImg); newImg.stop(true).fadeOut(self.options.imageCrossfade, function() { $(this).remove(); }); // if(self.options.zoomType == "inner"){ //remove any attributes on the cloned image so we can resize later self.$elem.width("auto").removeAttr("width"); self.$elem.height("auto").removeAttr("height"); // } oldImg.fadeIn(self.options.imageCrossfade); if(self.options.tint && self.options.zoomType != "inner") { var oldImgTint = self.zoomTintImage; var newImgTint = oldImgTint.clone(); self.zoomTintImage.attr("src",largeimage) self.zoomTintImage.after(newImgTint); newImgTint.stop(true).fadeOut(self.options.imageCrossfade, function() { $(this).remove(); }); oldImgTint.fadeIn(self.options.imageCrossfade); //self.zoomTintImage.attr("width",elem.data("image")); //resize the tint window self.zoomTint.css({ height: self.$elem.height()}); self.zoomTint.css({ width: self.$elem.width()}); } self.zoomContainer.css("height", self.$elem.height()); self.zoomContainer.css("width", self.$elem.width()); if(self.options.zoomType == "inner"){ if(!self.options.constrainType){ self.zoomWrap.parent().css("height", self.$elem.height()); self.zoomWrap.parent().css("width", self.$elem.width()); self.zoomWindow.css("height", self.$elem.height()); self.zoomWindow.css("width", self.$elem.width()); } } if(self.options.imageCrossfade){ self.zoomWrap.css("height", self.$elem.height()); self.zoomWrap.css("width", self.$elem.width()); } } else{ self.$elem.attr("src",smallimage); if(self.options.tint) { self.zoomTintImage.attr("src",largeimage); //self.zoomTintImage.attr("width",elem.data("image")); self.zoomTintImage.attr("height",self.$elem.height()); //self.zoomTintImage.attr('src') = elem.data("image"); self.zoomTintImage.css({ height: self.$elem.height()}); self.zoomTint.css({ height: self.$elem.height()}); } self.zoomContainer.css("height", self.$elem.height()); self.zoomContainer.css("width", self.$elem.width()); if(self.options.imageCrossfade){ self.zoomWrap.css("height", self.$elem.height()); self.zoomWrap.css("width", self.$elem.width()); } } if(self.options.constrainType){ //This will contrain the image proportions if(self.options.constrainType == "height"){ self.zoomContainer.css("height", self.options.constrainSize); self.zoomContainer.css("width", "auto"); if(self.options.imageCrossfade){ self.zoomWrap.css("height", self.options.constrainSize); self.zoomWrap.css("width", "auto"); self.constwidth = self.zoomWrap.width(); } else{ self.$elem.css("height", self.options.constrainSize); self.$elem.css("width", "auto"); self.constwidth = self.$elem.width(); } if(self.options.zoomType == "inner"){ self.zoomWrap.parent().css("height", self.options.constrainSize); self.zoomWrap.parent().css("width", self.constwidth); self.zoomWindow.css("height", self.options.constrainSize); self.zoomWindow.css("width", self.constwidth); } if(self.options.tint){ self.tintContainer.css("height", self.options.constrainSize); self.tintContainer.css("width", self.constwidth); self.zoomTint.css("height", self.options.constrainSize); self.zoomTint.css("width", self.constwidth); self.zoomTintImage.css("height", self.options.constrainSize); self.zoomTintImage.css("width", self.constwidth); } } if(self.options.constrainType == "width"){ self.zoomContainer.css("height", "auto"); self.zoomContainer.css("width", self.options.constrainSize); if(self.options.imageCrossfade){ self.zoomWrap.css("height", "auto"); self.zoomWrap.css("width", self.options.constrainSize); self.constheight = self.zoomWrap.height(); } else{ self.$elem.css("height", "auto"); self.$elem.css("width", self.options.constrainSize); self.constheight = self.$elem.height(); } if(self.options.zoomType == "inner"){ self.zoomWrap.parent().css("height", self.constheight); self.zoomWrap.parent().css("width", self.options.constrainSize); self.zoomWindow.css("height", self.constheight); self.zoomWindow.css("width", self.options.constrainSize); } if(self.options.tint){ self.tintContainer.css("height", self.constheight); self.tintContainer.css("width", self.options.constrainSize); self.zoomTint.css("height", self.constheight); self.zoomTint.css("width", self.options.constrainSize); self.zoomTintImage.css("height", self.constheight); self.zoomTintImage.css("width", self.options.constrainSize); } } } }, doneCallback: function(){ var self = this; if(self.options.loadingIcon){ self.spinner.hide(); } self.nzOffset = self.$elem.offset(); self.nzWidth = self.$elem.width(); self.nzHeight = self.$elem.height(); // reset the zoomlevel back to default self.currentZoomLevel = self.options.zoomLevel; //ratio of the large to small image self.widthRatio = self.largeWidth / self.nzWidth; self.heightRatio = self.largeHeight / self.nzHeight; //NEED TO ADD THE LENS SIZE FOR ROUND // adjust images less than the window height if(self.options.zoomType == "window") { if(self.nzHeight < self.options.zoomWindowWidth/self.widthRatio){ lensHeight = self.nzHeight; } else{ lensHeight = String((self.options.zoomWindowHeight/self.heightRatio)) } if(self.options.zoomWindowWidth < self.options.zoomWindowWidth){ lensWidth = self.nzWidth; } else{ lensWidth = (self.options.zoomWindowWidth/self.widthRatio); } if(self.zoomLens){ self.zoomLens.css('width', lensWidth); self.zoomLens.css('height', lensHeight); } } }, getCurrentImage: function(){ var self = this; return self.zoomImage; }, getGalleryList: function(){ var self = this; //loop through the gallery options and set them in list for fancybox self.gallerylist = []; if (self.options.gallery){ $('#'+self.options.gallery + ' a').each(function() { var img_src = ''; if($(this).data("zoom-image")){ img_src = $(this).data("zoom-image"); } else if($(this).data("image")){ img_src = $(this).data("image"); } //put the current image at the start if(img_src == self.zoomImage){ self.gallerylist.unshift({ href: ''+img_src+'', title: $(this).find('img').attr("title") }); } else{ self.gallerylist.push({ href: ''+img_src+'', title: $(this).find('img').attr("title") }); } }); } //if no gallery - return current image else{ self.gallerylist.push({ href: ''+self.zoomImage+'', caption: $(this).find('img').attr("title") }); } return self.gallerylist; }, changeZoomLevel: function(value){ var self = this; //flag a zoom, so can adjust the easing during setPosition self.scrollingLock = true; //round to two decimal places self.newvalue = parseFloat(value).toFixed(2); newvalue = parseFloat(value).toFixed(2); //maxwidth & Maxheight of the image maxheightnewvalue = self.largeHeight/((self.options.zoomWindowHeight / self.nzHeight) * self.nzHeight); maxwidthtnewvalue = self.largeWidth/((self.options.zoomWindowWidth / self.nzWidth) * self.nzWidth); //calculate new heightratio if(self.options.zoomType != "inner") { if(maxheightnewvalue <= newvalue){ self.heightRatio = (self.largeHeight/maxheightnewvalue) / self.nzHeight; self.newvalueheight = maxheightnewvalue; self.fullheight = true; } else{ self.heightRatio = (self.largeHeight/newvalue) / self.nzHeight; self.newvalueheight = newvalue; self.fullheight = false; } // calculate new width ratio if(maxwidthtnewvalue <= newvalue){ self.widthRatio = (self.largeWidth/maxwidthtnewvalue) / self.nzWidth; self.newvaluewidth = maxwidthtnewvalue; self.fullwidth = true; } else{ self.widthRatio = (self.largeWidth/newvalue) / self.nzWidth; self.newvaluewidth = newvalue; self.fullwidth = false; } if(self.options.zoomType == "lens"){ if(maxheightnewvalue <= newvalue){ self.fullwidth = true; self.newvaluewidth = maxheightnewvalue; } else{ self.widthRatio = (self.largeWidth/newvalue) / self.nzWidth; self.newvaluewidth = newvalue; self.fullwidth = false; }} } if(self.options.zoomType == "inner") { maxheightnewvalue = parseFloat(self.largeHeight/self.nzHeight).toFixed(2); maxwidthtnewvalue = parseFloat(self.largeWidth/self.nzWidth).toFixed(2); if(newvalue > maxheightnewvalue){ newvalue = maxheightnewvalue; } if(newvalue > maxwidthtnewvalue){ newvalue = maxwidthtnewvalue; } if(maxheightnewvalue <= newvalue){ self.heightRatio = (self.largeHeight/newvalue) / self.nzHeight; if(newvalue > maxheightnewvalue){ self.newvalueheight = maxheightnewvalue; }else{ self.newvalueheight = newvalue; } self.fullheight = true; } else{ self.heightRatio = (self.largeHeight/newvalue) / self.nzHeight; if(newvalue > maxheightnewvalue){ self.newvalueheight = maxheightnewvalue; }else{ self.newvalueheight = newvalue; } self.fullheight = false; } if(maxwidthtnewvalue <= newvalue){ self.widthRatio = (self.largeWidth/newvalue) / self.nzWidth; if(newvalue > maxwidthtnewvalue){ self.newvaluewidth = maxwidthtnewvalue; }else{ self.newvaluewidth = newvalue; } self.fullwidth = true; } else{ self.widthRatio = (self.largeWidth/newvalue) / self.nzWidth; self.newvaluewidth = newvalue; self.fullwidth = false; } } //end inner scrcontinue = false; if(self.options.zoomType == "inner"){ if(self.nzWidth >= self.nzHeight){ if( self.newvaluewidth <= maxwidthtnewvalue){ scrcontinue = true; } else{ scrcontinue = false; self.fullheight = true; self.fullwidth = true; } } if(self.nzHeight > self.nzWidth){ if( self.newvaluewidth <= maxwidthtnewvalue){ scrcontinue = true; } else{ scrcontinue = false; self.fullheight = true; self.fullwidth = true; } } } if(self.options.zoomType != "inner"){ scrcontinue = true; } if(scrcontinue){ self.zoomLock = 0; self.changeZoom = true; //if lens height is less than image height if(((self.options.zoomWindowHeight)/self.heightRatio) <= self.nzHeight){ self.currentZoomLevel = self.newvalueheight; if(self.options.zoomType != "lens" && self.options.zoomType != "inner") { self.changeBgSize = true; self.zoomLens.css({height: String((self.options.zoomWindowHeight)/self.heightRatio) + 'px' }) } if(self.options.zoomType == "lens" || self.options.zoomType == "inner") { self.changeBgSize = true; } } if((self.options.zoomWindowWidth/self.widthRatio) <= self.nzWidth){ if(self.options.zoomType != "inner"){ if(self.newvaluewidth > self.newvalueheight) { self.currentZoomLevel = self.newvaluewidth; } } if(self.options.zoomType != "lens" && self.options.zoomType != "inner") { self.changeBgSize = true; self.zoomLens.css({width: String((self.options.zoomWindowWidth)/self.widthRatio) + 'px' }) } if(self.options.zoomType == "lens" || self.options.zoomType == "inner") { self.changeBgSize = true; } } if(self.options.zoomType == "inner"){ self.changeBgSize = true; if(self.nzWidth > self.nzHeight){ self.currentZoomLevel = self.newvaluewidth; } if(self.nzHeight > self.nzWidth){ self.currentZoomLevel = self.newvaluewidth; } } } //under //sets the boundry change, called in setWindowPos self.setPosition(self.currentLoc); // }, closeAll: function(){ if(self.zoomWindow){self.zoomWindow.hide();} if(self.zoomLens){self.zoomLens.hide();} if(self.zoomTint){self.zoomTint.hide();} }, changeState: function(value){ var self = this; if(value == 'enable'){self.options.zoomEnabled = true;} if(value == 'disable'){self.options.zoomEnabled = false;} } }; $.fn.elevateZoom = function( options ) { return this.each(function() { var elevate = Object.create( ElevateZoom ); elevate.init( options, this ); $.data( this, 'elevateZoom', elevate ); }); }; $.fn.elevateZoom.options = { zoomActivation: "hover", // Can also be click (PLACEHOLDER FOR NEXT VERSION) zoomEnabled: true, //false disables zoomwindow from showing preloading: 1, //by default, load all the images, if 0, then only load images after activated (PLACEHOLDER FOR NEXT VERSION) zoomLevel: 1, //default zoom level of image scrollZoom: false, //allow zoom on mousewheel, true to activate scrollZoomIncrement: 0.1, //steps of the scrollzoom minZoomLevel: false, maxZoomLevel: false, easing: false, easingAmount: 12, lensSize: 200, zoomWindowWidth: 400, zoomWindowHeight: 400, zoomWindowOffetx: 0, zoomWindowOffety: 0, zoomWindowPosition: 1, zoomWindowBgColour: "#fff", lensFadeIn: false, lensFadeOut: false, debug: false, zoomWindowFadeIn: false, zoomWindowFadeOut: false, zoomWindowAlwaysShow: false, zoomTintFadeIn: false, zoomTintFadeOut: false, borderSize: 4, showLens: true, borderColour: "#888", lensBorderSize: 1, lensBorderColour: "#000", lensShape: "square", //can be "round" zoomType: "window", //window is default, also "lens" available - containLensZoom: false, lensColour: "white", //colour of the lens background lensOpacity: 0.4, //opacity of the lens lenszoom: false, tint: false, //enable the tinting tintColour: "#333", //default tint color, can be anything, red, #ccc, rgb(0,0,0) tintOpacity: 0.4, //opacity of the tint gallery: false, galleryActiveClass: "zoomGalleryActive", imageCrossfade: false, constrainType: false, //width or height constrainSize: false, //in pixels the dimensions you want to constrain on loadingIcon: false, ////www.example.com/spinner.gif cursor:"default", // user should set to what they want the cursor as, if they have set a click function responsive:true, onComplete: $.noop, onZoomedImageLoaded: function() {}, onImageSwap: $.noop, onImageSwapComplete: $.noop }; })( jQuery, window, document ); ;/** * Owl Carousel v2.2.0 * Copyright:fun88 sportsbookM?i quy?n ???c b?o l?u cho trang web chính th?c 2013-2016 David Deutsch * Licensed under MIT (//github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE) */ !function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g--;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++cc;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.settings.center&&(this.$stage.children(".center").removeClass("center"),this.$stage.children().eq(this.current()).addClass("center"))}}],e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var b,c,e;b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e&&this.preloadAutoWidthImages(b)}this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+' class="'+this.settings.stageClass+'"/>').wrap('
'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this.$element.is(":visible")?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.$element.is(":visible")?(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized"))):!1:!1},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),this.settings.responsive!==!1&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var d=-1,e=30,f=this.width(),g=this.coordinates();return this.settings.freeDrag||a.each(g,a.proxy(function(a,h){return"left"===c&&b>h-e&&h+e>b?d=a:"right"===c&&b>h-f-e&&h-f+e>b?d=a+1:this.op(b,"<",h)&&this.op(b,">",g[a+1]||h-f)&&(d="left"===c?a+1:a),-1===d},this)),this.settings.loop||(this.op(b,">",g[this.minimum()])?d=b=this.minimum():this.op(b,"<",g[this.maximum()])&&(d=b=this.maximum())),d},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||1>c?a=d:(0>a||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){for(b=this._items.length,c=this._items[--b].width(),d=this.$element.width();b--&&(c+=this._items[b].width()+this.settings.margin,!(c>d)););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(0>e),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,d=((a-h)%g+g)%g+h,d!==a&&i>=d-e&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.$element.is(":visible")&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.leave("animating"),void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),this.settings.responsive!==!1&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.$element.is(":visible"),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.$element.is(":visible")!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);f++-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.$stage.children().toArray().slice(b,c),e=[],f=0;a.each(d,function(b,c){e.push(a(c).height())}),f=Math.max.apply(null,e),this._core.$stage.parent().height(f).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='
',d=k.lazyLoad?'
':'
',b.after(d),b.after(e)};return b.wrap('
"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}}))},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),"youtube"===f.type?c='':"vimeo"===f.type?c='':"vzaar"===f.type&&(c=''),a('
'+c+"
").insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null); },a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._timeout=null,this._paused=!1,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._core.settings.autoplay&&this._setAutoPlayInterval()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mou搜索引擎优化ver.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype.play=function(a,b){this._paused=!1,this._core.is("rotating")||(this._core.enter("rotating"),this._setAutoPlayInterval())},e.prototype._getNextTimeout=function(d,e){return this._timeout&&b.clearTimeout(this._timeout),b.setTimeout(a.proxy(function(){this._paused||this._core.is("busy")||this._core.is("interacting")||c.hidden||this._core.next(e||this._core.settings.autoplaySpeed)},this),d||this._core.settings.autoplayTimeout)},e.prototype._setAutoPlayInterval=function(){this._timeout=this._getNextTimeout()},e.prototype.stop=function(){this._core.is("rotating")&&(b.clearTimeout(this._timeout),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&(this._paused=!0)},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('
'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"
")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("
").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a("
").addClass(c.dotClass).append(a("")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("
").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;e>a;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):0>b&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){return g[b]!==d?(e=c?b:!0,!1):void 0}),e}function f(a){return e(a,!0)}var g=a("").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document); ;(function($,window,undefined){var lastTime=0,running,animate=function(elem){if(running){window.requestAnimationFrame(animate,elem);jQuery.fx.tick();}},vendors=['ms','moz','webkit','o'];for(var x=0,len=vendors.length;xfun88 sportsbookM?i quy?n ???c b?o l?u cho trang web chính th?c (c) 2011 Brandon Aaron (//brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: //adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(//www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.6 * * Requires: 1.2.2+ */ (function($){var types=['DOMMouseScroll','mousewheel'];if($.event.fixHooks){for(var i=types.length;i;){$.event.fixHooks[types[--i]]=$.event.mouseHooks;}} $.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var i=types.length;i;){this.addEventListener(types[--i],handler,false);}}else{this.onmousewheel=handler;}},teardown:function(){if(this.removeEventListener){for(var i=types.length;i;){this.removeEventListener(types[--i],handler,false);}}else{this.onmousewheel=null;}}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});function handler(event){var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,returnValue=true,deltaX=0,deltaY=0;event=$.event.fix(orgEvent);event.type="mousewheel";if(orgEvent.wheelDelta){delta=orgEvent.wheelDelta/120;} if(orgEvent.detail){delta=-orgEvent.detail/3;} deltaY=delta;if(orgEvent.axis!==undefined&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaY=0;deltaX=-1*delta;} if(orgEvent.wheelDeltaY!==undefined){deltaY=orgEvent.wheelDeltaY/120;} if(orgEvent.wheelDeltaX!==undefined){deltaX=-1*orgEvent.wheelDeltaX/120;} args.unshift(event,delta,deltaX,deltaY);return($.event.dispatch||$.event.handle).apply(this,args);}})(jQuery); ;(function($,window,undefined){var extensions={flash:['swf'],image:['bmp','gif','jpeg','jpg','png','tiff','tif','jfif','jpe'],iframe:['asp','aspx','cgi','cfm','htm','html','jsp','php','pl','php3','php4','php5','phtml','rb','rhtml','shtml','txt'],video:['avi','mov','mpg','mpeg','movie','mp4','webm','ogv','ogg','3gp','m4v']},$win=$(window),$doc=$(document),browser,transform,gpuAcceleration,fullScreenApi='',userAgent=navigator.userAgent||navigator.vendor||window.opera,supportTouch=!!('ontouchstart'in window)&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)),isMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(userAgent.substr(0,4)),clickEvent=supportTouch?"itap.iLightBox":"click.iLightBox",touchStartEvent=supportTouch?"touchstart.iLightBox":"mousedown.iLightBox",touchStopEvent=supportTouch?"touchend.iLightBox":"mouseup.iLightBox",touchMoveEvent=supportTouch?"touchmove.iLightBox":"mousemove.iLightBox",abs=Math.abs,sqrt=Math.sqrt,round=Math.round,max=Math.max,min=Math.min,floor=Math.floor,random=Math.random,pluginspages={quicktime:'//www.apple.com/quicktime/download',flash:'//www.adobe.com/go/getflash'},iLightBox=function(el,options,items,instant){var iL=this;iL.options=options,iL.selector=el.selector||el,iL.context=el.context,iL.instant=instant;if(items.length<1)iL.attachItems();else iL.items=items;iL.vars={total:iL.items.length,start:0,current:null,next:null,prev:null,BODY:$('body'),loadRequests:0,overlay:$('
'),loader:$('
'),toolbar:$('
'),innerToolbar:$('
'),title:$('
'),closeButton:$(''),fullScreenButton:$(''),innerPlayButton:$(''),innerNextButton:$(''),innerPrevButton:$(''),holder:$('
'),nextPhoto:$('
'),prevPhoto:$('
'),nextButton:$(''),prevButton:$(''),thumbnails:$('
'),thumbs:false,nextLock:false,prevLock:false,hashLock:false,isMobile:false,mobileMaxWidth:980,isInFullScreen:false,isSwipe:false,mouseID:0,cycleID:0,isPaused:0};iL.vars.hideableElements=iL.vars.nextButton.add(iL.vars.prevButton);iL.normalizeItems();iL.availPlugins();iL.options.startFrom=(iL.options.startFrom>0&&iL.options.startFrom>=iL.vars.total)?iL.vars.total-1:iL.options.startFrom;iL.options.startFrom=(iL.options.randomStart)?floor(random()*iL.vars.total):iL.options.startFrom;iL.vars.start=iL.options.startFrom;if(instant)iL.instantCall();else iL.patchItemsEvents();if(iL.options.linkId){iL.hashChangeHandler();$win.iLightBoxHashChange(function(){iL.hashChangeHandler();});} if(supportTouch){var RegExp=/(click|mouseenter|mouseleave|mou搜索引擎优化ver|mou搜索引擎优化ut)/ig,replace="itap";iL.options.caption.show=iL.options.caption.show.replace(RegExp,replace),iL.options.caption.hide=iL.options.caption.hide.replace(RegExp,replace),iL.options.social.show=iL.options.social.show.replace(RegExp,replace),iL.options.social.hide=iL.options.social.hide.replace(RegExp,replace);} if(iL.options.controls.arrows){$.extend(iL.options.styles,{nextOffsetX:0,prevOffsetX:0,nextOpacity:0,prevOpacity:0});}};iLightBox.prototype={showLoader:function(){var iL=this;iL.vars.loadRequests+=1;if(iL.options.path.toLowerCase()=="horizontal")iL.vars.loader.stop().animate({top:'-30px'},iL.options.show.speed,'easeOutCirc');else iL.vars.loader.stop().animate({left:'-30px'},iL.options.show.speed,'easeOutCirc');},hideLoader:function(){var iL=this;iL.vars.loadRequests-=1;iL.vars.loadRequests=(iL.vars.loadRequests<0)?0:iL.vars.loadRequests;if(iL.options.path.toLowerCase()=="horizontal"){if(iL.vars.loadRequests<=0)iL.vars.loader.stop().animate({top:'-192px'},iL.options.show.speed,'easeInCirc');}else{if(iL.vars.loadRequests<=0)iL.vars.loader.stop().animate({left:'-192px'},iL.options.show.speed,'easeInCirc');}},createUI:function(){var iL=this;iL.ui={currentElement:iL.vars.holder,nextElement:iL.vars.nextPhoto,prevElement:iL.vars.prevPhoto,currentItem:iL.vars.current,nextItem:iL.vars.next,prevItem:iL.vars.prev,hide:function(){iL.closeAction();},refresh:function(){(arguments.length>0)?iL.repositionPhoto(true):iL.repositionPhoto();},fullscreen:function(){iL.fullScreenAction();}};},attachItems:function(){var iL=this,itemsObject=new Array(),items=new Array();$(iL.selector,iL.context).each(function(){var t=$(this),URL=t.attr(iL.options.attr)||null,options=t.data("options")&&eval("({"+t.data("options")+"})")||{},caption=t.data('caption'),title=t.data('title'),type=t.data('type')||getTypeByExtension(URL);items.push({URL:URL,caption:caption,title:title,type:type,options:options});if(!iL.instant)itemsObject.push(t);});iL.items=items,iL.itemsObject=itemsObject;},normalizeItems:function(){var iL=this,newItems=new Array();$.each(iL.items,function(key,val){if(typeof val=="string")val={url:val};var URL=val.url||val.URL||null,options=val.options||{},caption=val.caption||null,title=val.title||null,type=(val.type)?val.type.toLowerCase():getTypeByExtension(URL),ext=(typeof URL!='object')?getExtension(URL):'';options.thumbnail=options.thumbnail||((type=="image")?URL:null),options.videoType=options.videoType||null,options.skin=options.skin||iL.options.skin,options.width=options.width||null,options.height=options.height||null,options.mousewheel=(typeof options.mousewheel!='undefined')?options.mousewheel:true,options.swipe=(typeof options.swipe!='undefined')?options.swipe:true,options.social=(typeof options.social!='undefined')?options.social:iL.options.social.buttons&&$.extend({},{},iL.options.social.buttons);if(type=="video"){options.html5video=(typeof options.html5video!='undefined')?options.html5video:{};options.html5video.webm=options.html5video.webm||options.html5video.WEBM||null;options.html5video.controls=(typeof options.html5video.controls!='undefined')?options.html5video.controls:"controls";options.html5video.preload=options.html5video.preload||"metadata";options.html5video.autoplay=(typeof options.html5video.autoplay!='undefined')?options.html5video.autoplay:false;} if(!options.width||!options.height){if(type=="video")options.width=1280,options.height=720;else if(type=="iframe")options.width='100%',options.height='90%';else if(type=="flash")options.width=1280,options.height=720;} delete val.url;val.index=key;val.URL=URL;val.caption=caption;val.title=title;val.type=type;val.options=options;val.ext=ext;newItems.push(val);});iL.items=newItems;},instantCall:function(){var iL=this,key=iL.vars.start;iL.vars.current=key;iL.vars.next=(iL.items[key+1])?key+1:null;iL.vars.prev=(iL.items[key-1])?key-1:null;iL.addContents();iL.patchEvents();},addContents:function(){var iL=this,vars=iL.vars,opts=iL.options,viewport=getViewport(),path=opts.path.toLowerCase(),recognizingItems=vars.total>0&&iL.items.filter(function(e,i,arr){return['image','flash','video'].indexOf(e.type)===-1&&typeof e.recognized==='undefined'&&(opts.smartRecognition||e.options.smartRecognition);}),needRecognition=recognizingItems.length>0;if(opts.mobileOptimizer&&!opts.innerToolbar) vars.isMobile=viewport.width<=vars.mobileMaxWidth;vars.overlay.addClass(opts.skin).hide().css('opacity',opts.overlay.opacity);if(opts.linkId) vars.overlay[0].setAttribute('linkid',opts.linkId);if(opts.controls.toolbar){vars.toolbar.addClass(opts.skin).append(vars.closeButton);if(opts.controls.fullscreen) vars.toolbar.append(vars.fullScreenButton);if(opts.controls.slideshow) vars.toolbar.append(vars.innerPlayButton);if(vars.total>1) vars.toolbar.append(vars.innerPrevButton).append(vars.innerNextButton);} vars.BODY.addClass('ilightbox-noscroll').append(vars.overlay).append(vars.loader).append(vars.holder).append(vars.nextPhoto).append(vars.prevPhoto);if(!opts.innerToolbar) vars.BODY.append(vars.toolbar);if(opts.controls.arrows) vars.BODY.append(vars.nextButton).append(vars.prevButton);if(opts.controls.thumbnail&&vars.total>1){vars.BODY.append(vars.thumbnails);vars.thumbnails.addClass(opts.skin).addClass('ilightbox-'+path);$('div.ilightbox-thumbnails-grid',vars.thumbnails).empty();vars.thumbs=true;} var loaderCss=(opts.path.toLowerCase()=="horizontal")?{left:parseInt((viewport.width/2)-(vars.loader.outerWidth()/2))}:{top:parseInt((viewport.height/2)-(vars.loader.outerHeight()/2))};vars.loader.addClass(opts.skin).css(loaderCss);vars.nextButton.add(vars.prevButton).addClass(opts.skin);if(path=="horizontal") vars.loader.add(vars.nextButton).add(vars.prevButton).addClass('horizontal');vars.BODY[vars.isMobile?'addClass':'removeClass']('isMobile');if(!opts.infinite){vars.prevButton.add(vars.prevButton).add(vars.innerPrevButton).add(vars.innerNextButton).removeClass('disabled');if(vars.current==0) vars.prevButton.add(vars.innerPrevButton).addClass('disabled');if(vars.current>=vars.total-1) vars.nextButton.add(vars.innerNextButton).addClass('disabled');} if(opts.show.effect){vars.overlay.stop().fadeIn(opts.show.speed);vars.toolbar.stop().fadeIn(opts.show.speed);}else{vars.overlay.show();vars.toolbar.show();} var length=recognizingItems.length;if(needRecognition){iL.showLoader();$.each(recognizingItems,function(key,val){var resultFnc=function(result){var key=-1,filter=iL.items.filter(function(e,i,arr){if(e.URL==result.url) key=i;return e.URL==result.url;}),self=iL.items[key];if(result){$.extend(true,self,{URL:result.source,type:result.type,recognized:true,options:{html5video:result.html5video,width:(result.type=="image")?0:(result.width||self.width),height:(result.type=="image")?0:(result.height||self.height),thumbnail:self.options.thumbnail||result.thumbnail}});} length--;if(length==0){iL.hideLoader();vars.dontGenerateThumbs=false;iL.generateThumbnails();if(opts.show.effect) setTimeout(function(){iL.generateBoxes();},opts.show.speed);else iL.generateBoxes();}};iL.ogpRecognition(this,resultFnc);});} else{if(opts.show.effect) setTimeout(function(){iL.generateBoxes();},opts.show.speed);else iL.generateBoxes();} iL.createUI();window.iLightBox={close:function(){iL.closeAction();},fullscreen:function(){iL.fullScreenAction();},moveNext:function(){iL.moveTo('next');},movePrev:function(){iL.moveTo('prev');},goTo:function(index){iL.goTo(index);},refresh:function(){iL.refresh();},reposition:function(){(arguments.length>0)?iL.repositionPhoto(true):iL.repositionPhoto();},setOption:function(options){iL.setOption(options);},destroy:function(){iL.closeAction();iL.dispatchItemsEvents();}};if(opts.linkId){vars.hashLock=true;window.location.hash=opts.linkId+'/'+vars.current;setTimeout(function(){vars.hashLock=false;},55);} if(!opts.slideshow.startPaused){iL.resume();vars.innerPlayButton.removeClass('ilightbox-play').addClass('ilightbox-pause');} if(typeof iL.options.callback.onOpen=='function')iL.options.callback.onOpen.call(iL);},loadContent:function(obj,opt,speed){var iL=this,holder,item;iL.createUI();obj.speed=speed||iL.options.effects.loadedFadeSpeed;if(opt=='current'){if(!obj.options.mousewheel)iL.vars.lockWheel=true;else iL.vars.lockWheel=false;if(!obj.options.swipe)iL.vars.lockSwipe=true;else iL.vars.lockSwipe=false;} switch(opt){case'current':holder=iL.vars.holder,item=iL.vars.current;break;case'next':holder=iL.vars.nextPhoto,item=iL.vars.next;break;case'prev':holder=iL.vars.prevPhoto,item=iL.vars.prev;break;} holder.removeAttr('style class').addClass('ilightbox-holder'+(supportTouch?' supportTouch':'')).addClass(obj.options.skin);$('div.ilightbox-inner-toolbar',holder).remove();if(obj.title||iL.options.innerToolbar){var innerToolbar=iL.vars.innerToolbar.clone();if(obj.title&&iL.options.show.title){var title=iL.vars.title.clone();title.empty().html(obj.title);innerToolbar.append(title);} if(iL.options.innerToolbar){innerToolbar.append((iL.vars.total>1)?iL.vars.toolbar.clone():iL.vars.toolbar);} holder.prepend(innerToolbar);} iL.loadSwitcher(obj,holder,item,opt);},loadSwitcher:function(obj,holder,item,opt){var iL=this,opts=iL.options,api={element:holder,position:item};switch(obj.type){case'image':if(typeof opts.callback.onBeforeLoad=='function')opts.callback.onBeforeLoad.call(iL,iL.ui,item);if(typeof obj.options.onBeforeLoad=='function')obj.options.onBeforeLoad.call(iL,api);iL.loadImage(obj.URL,function(img){if(typeof opts.callback.onAfterLoad=='function')opts.callback.onAfterLoad.call(iL,iL.ui,item);if(typeof obj.options.onAfterLoad=='function')obj.options.onAfterLoad.call(iL,api);var width=(img)?img.width:400,height=(img)?img.height:200;holder.data({naturalWidth:width,naturalHeight:height});$('div.ilightbox-container',holder).empty().append((img)?'':''+opts.errors.loadImage+'');if(typeof opts.callback.onRender=='function')opts.callback.onRender.call(iL,iL.ui,item);if(typeof obj.options.onRender=='function')obj.options.onRender.call(iL,api);iL.configureHolder(obj,opt,holder);});break;case'video':holder.data({naturalWidth:obj.options.width,naturalHeight:obj.options.height});iL.addContent(holder,obj);if(typeof opts.callback.onRender=='function')opts.callback.onRender.call(iL,iL.ui,item);if(typeof obj.options.onRender=='function')obj.options.onRender.call(iL,api);iL.configureHolder(obj,opt,holder);break;case'iframe':iL.showLoader();holder.data({naturalWidth:obj.options.width,naturalHeight:obj.options.height});var el=iL.addContent(holder,obj);if(typeof opts.callback.onRender=='function')opts.callback.onRender.call(iL,iL.ui,item);if(typeof obj.options.onRender=='function')obj.options.onRender.call(iL,api);if(typeof opts.callback.onBeforeLoad=='function')opts.callback.onBeforeLoad.call(iL,iL.ui,item);if(typeof obj.options.onBeforeLoad=='function')obj.options.onBeforeLoad.call(iL,api);iL.configureHolder(obj,opt,holder);el.bind('load',function(){if(typeof opts.callback.onAfterLoad=='function')opts.callback.onAfterLoad.call(iL,iL.ui,item);if(typeof obj.options.onAfterLoad=='function')obj.options.onAfterLoad.call(iL,api);iL.hideLoader();el.unbind('load');});break;case'inline':var el=$(obj.URL),content=iL.addContent(holder,obj),images=findImageInElement(holder);holder.data({naturalWidth:(iL.items[item].options.width||el.outerWidth()),naturalHeight:(iL.items[item].options.height||el.outerHeight())});content.children().eq(0).show();if(typeof opts.callback.onRender=='function')opts.callback.onRender.call(iL,iL.ui,item);if(typeof obj.options.onRender=='function')obj.options.onRender.call(iL,api);if(typeof opts.callback.onBeforeLoad=='function')opts.callback.onBeforeLoad.call(iL,iL.ui,item);if(typeof obj.options.onBeforeLoad=='function')obj.options.onBeforeLoad.call(iL,api);iL.loadImage(images,function(){if(typeof opts.callback.onAfterLoad=='function')opts.callback.onAfterLoad.call(iL,iL.ui,item);if(typeof obj.options.onAfterLoad=='function')obj.options.onAfterLoad.call(iL,api);iL.configureHolder(obj,opt,holder);});break;case'flash':var el=iL.addContent(holder,obj);holder.data({naturalWidth:(iL.items[item].options.width||el.outerWidth()),naturalHeight:(iL.items[item].options.height||el.outerHeight())});if(typeof opts.callback.onRender=='function')opts.callback.onRender.call(iL,iL.ui,item);if(typeof obj.options.onRender=='function')obj.options.onRender.call(iL,api);iL.configureHolder(obj,opt,holder);break;case'ajax':var ajax=obj.options.ajax||{};if(typeof opts.callback.onBeforeLoad=='function')opts.callback.onBeforeLoad.call(iL,iL.ui,item);if(typeof obj.options.onBeforeLoad=='function')obj.options.onBeforeLoad.call(iL,api);iL.showLoader();$.ajax({url:obj.URL||opts.ajaxSetup.url,data:ajax.data||null,dataType:ajax.dataType||"html",type:ajax.type||opts.ajaxSetup.type,cache:ajax.cache||opts.ajaxSetup.cache,crossDomain:ajax.crossDomain||opts.ajaxSetup.crossDomain,global:ajax.global||opts.ajaxSetup.global,ifModified:ajax.ifModified||opts.ajaxSetup.ifModified,username:ajax.username||opts.ajaxSetup.username,password:ajax.password||opts.ajaxSetup.password,beforeSend:ajax.beforeSend||opts.ajaxSetup.beforeSend,complete:ajax.complete||opts.ajaxSetup.complete,success:function(data,textStatus,jqXHR){iL.hideLoader();var el=$(data),container=$('div.ilightbox-container',holder),elWidth=iL.items[item].options.width||parseInt(el[0].getAttribute('width')),elHeight=iL.items[item].options.height||parseInt(el[0].getAttribute('height')),css=(el[0].getAttribute('width')&&el[0].getAttribute('height'))?{'overflow':'hidden'}:{};container.empty().append($('
').css(css).html(el));holder.show().data({naturalWidth:(elWidth||container.outerWidth()),naturalHeight:(elHeight||container.outerHeight())}).hide();if(typeof opts.callback.onRender=='function')opts.callback.onRender.call(iL,iL.ui,item);if(typeof obj.options.onRender=='function')obj.options.onRender.call(iL,api);var images=findImageInElement(holder);iL.loadImage(images,function(){if(typeof opts.callback.onAfterLoad=='function')opts.callback.onAfterLoad.call(iL,iL.ui,item);if(typeof obj.options.onAfterLoad=='function')obj.options.onAfterLoad.call(iL,api);iL.configureHolder(obj,opt,holder);});opts.ajaxSetup.success(data,textStatus,jqXHR);if(typeof ajax.success=='function')ajax.success(data,textStatus,jqXHR);},error:function(jqXHR,textStatus,errorThrown){if(typeof opts.callback.onAfterLoad=='function')opts.callback.onAfterLoad.call(iL,iL.ui,item);if(typeof obj.options.onAfterLoad=='function')obj.options.onAfterLoad.call(iL,api);iL.hideLoader();$('div.ilightbox-container',holder).empty().append(''+opts.errors.loadContents+'');iL.configureHolder(obj,opt,holder);opts.ajaxSetup.error(jqXHR,textStatus,errorThrown);if(typeof ajax.error=='function')ajax.error(jqXHR,textStatus,errorThrown);}});break;case'html':var object=obj.URL,el container=$('div.ilightbox-container',holder);if(object[0].nodeName)el=object.clone();else{var dom=$(object);if(dom.selector)el=$('
'+dom+'
');else el=dom;} var elWidth=iL.items[item].options.width||parseInt(el.attr('width')),elHeight=iL.items[item].options.height||parseInt(el.attr('height'));iL.addContent(holder,obj);el.appendTo(document.documentElement).hide();if(typeof opts.callback.onRender=='function')opts.callback.onRender.call(iL,iL.ui,item);if(typeof obj.options.onRender=='function')obj.options.onRender.call(iL,api);var images=findImageInElement(holder);if(typeof opts.callback.onBeforeLoad=='function')opts.callback.onBeforeLoad.call(iL,iL.ui,item);if(typeof obj.options.onBeforeLoad=='function')obj.options.onBeforeLoad.call(iL,api);iL.loadImage(images,function(){if(typeof opts.callback.onAfterLoad=='function')opts.callback.onAfterLoad.call(iL,iL.ui,item);if(typeof obj.options.onAfterLoad=='function')obj.options.onAfterLoad.call(iL,api);holder.show().data({naturalWidth:(elWidth||container.outerWidth()),naturalHeight:(elHeight||container.outerHeight())}).hide();el.remove();iL.configureHolder(obj,opt,holder);});break;}},configureHolder:function(obj,opt,holder){var iL=this,vars=iL.vars,opts=iL.options;if(opt!="current")(opt=="next")?holder.addClass('ilightbox-next'):holder.addClass('ilightbox-prev');if(opt=="current") var item=vars.current;else if(opt=="next") var opacity=opts.styles.nextOpacity,item=vars.next;else var opacity=opts.styles.prevOpacity,item=vars.prev;var api={element:holder,position:item};iL.items[item].options.width=iL.items[item].options.width||0,iL.items[item].options.height=iL.items[item].options.height||0;if(opt=="current"){if(opts.show.effect)holder.css(transform,gpuAcceleration).fadeIn(obj.speed,function(){holder.css(transform,'');if(obj.caption){iL.setCaption(obj,holder);var caption=$('div.ilightbox-caption',holder),percent=parseInt((caption.outerHeight()/holder.outerHeight())*100);if(opts.caption.start&percent<=50)caption.fadeIn(opts.effects.fadeSpeed);} var social=obj.options.social;if(social){iL.setSocial(social,obj.URL,holder);if(opts.social.start)$('div.ilightbox-social',holder).fadeIn(opts.effects.fadeSpeed);} iL.generateThumbnails();if(typeof opts.callback.onShow=='function')opts.callback.onShow.call(iL,iL.ui,item);if(typeof obj.options.onShow=='function')obj.options.onShow.call(iL,api);});else{holder.show();iL.generateThumbnails();if(typeof opts.callback.onShow=='function')opts.callback.onShow.call(iL,iL.ui,item);if(typeof obj.options.onShow=='function')obj.options.onShow.call(iL,api);}}else{if(opts.show.effect)holder.fadeTo(obj.speed,opacity,function(){if(opt=="next")vars.nextLock=false;else vars.prevLock=false;iL.generateThumbnails();if(typeof opts.callback.onShow=='function')opts.callback.onShow.call(iL,iL.ui,item);if(typeof obj.options.onShow=='function')obj.options.onShow.call(iL,api);});else{holder.css({opacity:opacity}).show();if(opt=="next")vars.nextLock=false;else vars.prevLock=false;iL.generateThumbnails();if(typeof opts.callback.onShow=='function')opts.callback.onShow.call(iL,iL.ui,item);if(typeof obj.options.onShow=='function')obj.options.onShow.call(iL,api);}} setTimeout(function(){iL.repositionPhoto();},0);},generateBoxes:function(){var iL=this,vars=iL.vars,opts=iL.options;if(opts.infinite&&vars.total>=3){if(vars.current==vars.total-1)vars.next=0;if(vars.current==0)vars.prev=vars.total-1;}else opts.infinite=false;iL.loadContent(iL.items[vars.current],'current',opts.show.speed);if(iL.items[vars.next])iL.loadContent(iL.items[vars.next],'next',opts.show.speed);if(iL.items[vars.prev])iL.loadContent(iL.items[vars.prev],'prev',opts.show.speed);},generateThumbnails:function(){var iL=this,vars=iL.vars,opts=iL.options,timeOut=null;if(vars.thumbs&&!iL.vars.dontGenerateThumbs){var thumbnails=vars.thumbnails,container=$('div.ilightbox-thumbnails-container',thumbnails),grid=$('div.ilightbox-thumbnails-grid',container),i=0;grid.removeAttr('style').empty();$.each(iL.items,function(key,val){var isActive=(vars.current==key)?'ilightbox-active':'',opacity=(vars.current==key)?opts.thumbnails.activeOpacity:opts.thumbnails.normalOpacity,thumb=val.options.thumbnail,thumbnail=$('
'),icon=$('
');thumbnail.css({opacity:0}).addClass(isActive);if((val.type=="video"||val.type=="flash")&&typeof val.options.icon=='undefined'){icon.addClass('ilightbox-thumbnail-video');thumbnail.append(icon);}else if(val.options.icon){icon.addClass('ilightbox-thumbnail-'+val.options.icon);thumbnail.append(icon);} if(thumb)iL.loadImage(thumb,function(img){i++;if(img)thumbnail.data({naturalWidth:img.width,naturalHeight:img.height}).append('');else thumbnail.data({naturalWidth:opts.thumbnails.maxWidth,naturalHeight:opts.thumbnails.maxHeight});clearTimeout(timeOut);timeOut=setTimeout(function(){iL.positionThumbnails(thumbnails,container,grid);},20);setTimeout(function(){thumbnail.fadeTo(opts.effects.loadedFadeSpeed,opacity);},i*20);});grid.append(thumbnail);});iL.vars.dontGenerateThumbs=true;}},positionThumbnails:function(thumbnails,container,grid){var iL=this,vars=iL.vars,opts=iL.options,viewport=getViewport(),path=opts.path.toLowerCase();if(!thumbnails)thumbnails=vars.thumbnails;if(!container)container=$('div.ilightbox-thumbnails-container',thumbnails);if(!grid)grid=$('div.ilightbox-thumbnails-grid',container);var thumbs=$('.ilightbox-thumbnail',grid),widthAvail=(path=='horizontal')?viewport.width-opts.styles.pageOffsetX:thumbs.eq(0).outerWidth()-opts.styles.pageOffsetX,heightAvail=(path=='horizontal')?thumbs.eq(0).outerHeight()-opts.styles.pageOffsetY:viewport.height-opts.styles.pageOffsetY,gridWidth=(path=='horizontal')?0:widthAvail,gridHeight=(path=='horizontal')?heightAvail:0,active=$('.ilightbox-active',grid),gridCss={},css={};if(arguments.length<3){thumbs.css({opacity:opts.thumbnails.normalOpacity});active.css({opacity:opts.thumbnails.activeOpacity});} thumbs.each(function(i){var t=$(this),data=t.data(),width=(path=='horizontal')?0:opts.thumbnails.maxWidth;height=(path=='horizontal')?opts.thumbnails.maxHeight:0;dims=iL.getNewDimenstions(width,height,data.naturalWidth,data.naturalHeight,true);t.css({width:dims.width,height:dims.height});if(path=='horizontal')t.css({'float':'left'});(path=='horizontal')?(gridWidth+=t.outerWidth()):(gridHeight+=t.outerHeight());});gridCss={width:gridWidth,height:gridHeight};grid.css(gridCss);gridCss={};var gridOffset=grid.offset(),activeOffset=(active.length)?active.offset():{top:parseInt(heightAvail/2),left:parseInt(widthAvail/2)};gridOffset.top=(gridOffset.top-$doc.scrollTop()),gridOffset.left=(gridOffset.left-$doc.scrollLeft()),activeOffset.top=(activeOffset.top-gridOffset.top-$doc.scrollTop()),activeOffset.left=(activeOffset.left-gridOffset.left-$doc.scrollLeft());(path=='horizontal')?(gridCss.top=0,gridCss.left=parseInt((widthAvail/2)-activeOffset.left-(active.outerWidth()/2))):(gridCss.top=parseInt(((heightAvail/2)-activeOffset.top-(active.outerHeight()/2))),gridCss.left=0);if(arguments.length<3)grid.stop().animate(gridCss,opts.effects.repositionSpeed,'easeOutCirc');else grid.css(gridCss);},loadImage:function(image,callback){if(!$.isArray(image))image=[image];var iL=this,length=image.length;if(length>0){iL.showLoader();$.each(image,function(index,value){var img=new Image();img.onload=function(){length-=1;if(length==0){iL.hideLoader();callback(img);}};img.onerror=img.onabort=function(){length-=1;if(length==0){iL.hideLoader();callback(false);}};img.src=image[index];});}else callback(false);},patchItemsEvents:function(){var iL=this,vars=iL.vars,clickEvent=supportTouch?"itap.iL":"click.iL",vEvent=supportTouch?"click.iL":"itap.iL";if(iL.context&&iL.selector){var $items=$(iL.selector,iL.context);$(iL.context).on(clickEvent,iL.selector,function(){var $this=$(this),key=$items.index($this);vars.current=key;vars.next=iL.items[key+1]?key+1:null;vars.prev=iL.items[key-1]?key-1:null;iL.addContents();iL.patchEvents();return false;}).on(vEvent,iL.selector,function(){return false;});}else $.each(iL.itemsObject,function(key,val){val.on(clickEvent,function(){vars.current=key;vars.next=iL.items[key+1]?key+1:null;vars.prev=iL.items[key-1]?key-1:null;iL.addContents();iL.patchEvents();return false;}).on(vEvent,function(){return false;});});},dispatchItemsEvents:function(){var iL=this,vars=iL.vars,opts=iL.options;if(iL.context&&iL.selector) $(iL.context).off('.iL',iL.selector);else $.each(iL.itemsObject,function(key,val){val.off('.iL');});},refresh:function(){var iL=this;iL.dispatchItemsEvents();iL.attachItems();iL.normalizeItems();iL.patchItemsEvents();},patchEvents:function(){var iL=this,vars=iL.vars,opts=iL.options,path=opts.path.toLowerCase(),holders=$('.ilightbox-holder'),fullscreenEvent=fullScreenApi.fullScreenEventName+'.iLightBox',durationThreshold=1000,horizontalDistanceThreshold=verticalDistanceThreshold=100,buttonsArray=[vars.nextButton[0],vars.prevButton[0],vars.nextButton[0].firstChild,vars.prevButton[0].firstChild];$win.bind('resize.iLightBox',function(){var viewport=getViewport();if(opts.mobileOptimizer&&!opts.innerToolbar)vars.isMobile=viewport.width<=vars.mobileMaxWidth;vars.BODY[vars.isMobile?'addClass':'removeClass']('isMobile');iL.repositionPhoto(null);if(supportTouch){clearTimeout(vars.setTime);vars.setTime=setTimeout(function(){var scrollTop=getScrollXY().y;window.scrollTo(0,scrollTop-30);window.scrollTo(0,scrollTop+30);window.scrollTo(0,scrollTop);},2000);} if(vars.thumbs)iL.positionThumbnails();}).bind('keydown.iLightBox',function(event){if(opts.controls.keyboard){switch(event.keyCode){case 13:if(event.shiftKey&&opts.keyboard.shift_enter)iL.fullScreenAction();break;case 27:if(opts.keyboard.esc)iL.closeAction();break;case 37:if(opts.keyboard.left&&!vars.lockKey)iL.moveTo('prev');break;case 38:if(opts.keyboard.up&&!vars.lockKey)iL.moveTo('prev');break;case 39:if(opts.keyboard.right&&!vars.lockKey)iL.moveTo('next');break;case 40:if(opts.keyboard.down&&!vars.lockKey)iL.moveTo('next');break;}}});if(fullScreenApi.supportsFullScreen)$win.bind(fullscreenEvent,function(){iL.doFullscreen();});var holderEventsArr=[opts.caption.show+'.iLightBox',opts.caption.hide+'.iLightBox',opts.social.show+'.iLightBox',opts.social.hide+'.iLightBox'].filter(function(e,i,arr){return arr.lastIndexOf(e)===i;}),holderEvents="";$.each(holderEventsArr,function(key,val){if(key!=0)holderEvents+=' ';holderEvents+=val;});$doc.on(clickEvent,'.ilightbox-overlay',function(){if(opts.overlay.blur)iL.closeAction();}).on(clickEvent,'.ilightbox-next, .ilightbox-next-button',function(){iL.moveTo('next');}).on(clickEvent,'.ilightbox-prev, .ilightbox-prev-button',function(){iL.moveTo('prev');}).on(clickEvent,'.ilightbox-thumbnail',function(){var t=$(this),thumbs=$('.ilightbox-thumbnail',vars.thumbnails),index=thumbs.index(t);if(index!=vars.current)iL.goTo(index);}).on(holderEvents,'.ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)',function(e){var caption=$('div.ilightbox-caption',vars.holder),social=$('div.ilightbox-social',vars.holder),fadeSpeed=opts.effects.fadeSpeed;if(vars.nextLock||vars.prevLock){if(e.type==opts.caption.show&&!caption.is(':visible'))caption.fadeIn(fadeSpeed);else if(e.type==opts.caption.hide&&caption.is(':visible'))caption.fadeOut(fadeSpeed);if(e.type==opts.social.show&&!social.is(':visible'))social.fadeIn(fadeSpeed);else if(e.type==opts.social.hide&&social.is(':visible'))social.fadeOut(fadeSpeed);}else{if(e.type==opts.caption.show&&!caption.is(':visible'))caption.stop().fadeIn(fadeSpeed);else if(e.type==opts.caption.hide&&caption.is(':visible'))caption.stop().fadeOut(fadeSpeed);if(e.type==opts.social.show&&!social.is(':visible'))social.stop().fadeIn(fadeSpeed);else if(e.type==opts.social.hide&&social.is(':visible'))social.stop().fadeOut(fadeSpeed);}}).on('mouseenter.iLightBox mouseleave.iLightBox','.ilightbox-wrapper',function(e){if(e.type=='mouseenter')vars.lockWheel=true;else vars.lockWheel=false;}).on(clickEvent,'.ilightbox-toolbar a.ilightbox-close, .ilightbox-toolbar a.ilightbox-fullscreen, .ilightbox-toolbar a.ilightbox-play, .ilightbox-toolbar a.ilightbox-pause',function(){var t=$(this);if(t.hasClass('ilightbox-fullscreen'))iL.fullScreenAction();else if(t.hasClass('ilightbox-play')){iL.resume();t.addClass('ilightbox-pause').removeClass('ilightbox-play');}else if(t.hasClass('ilightbox-pause')){iL.pause();t.addClass('ilightbox-play').removeClass('ilightbox-pause');}else iL.closeAction();}).on(touchMoveEvent,'.ilightbox-overlay, .ilightbox-thumbnails-container',function(e){e.preventDefault();});function mouseMoveHandler(e){if(!vars.isMobile){if(!vars.mouseID){vars.hideableElements.show();} vars.mouseID=clearTimeout(vars.mouseID);if(buttonsArray.indexOf(e.target)===-1) vars.mouseID=setTimeout(function(){vars.hideableElements.hide();vars.mouseID=clearTimeout(vars.mouseID);},3000);}} if(opts.controls.arrows&&!supportTouch)$doc.on('mousemove.iLightBox',mouseMoveHandler);if(opts.controls.slideshow&&opts.slideshow.pauseOnHover)$doc.on('mouseenter.iLightBox mouseleave.iLightBox','.ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)',function(e){if(e.type=='mouseenter'&&vars.cycleID)iL.pause();else if(e.type=='mouseleave'&&vars.isPaused)iL.resume();});var switchers=$('.ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails');if(opts.controls.mousewheel)switchers.on('mousewheel.iLightBox',function(event,delta){if(!vars.lockWheel){event.preventDefault();if(delta<0)iL.moveTo('next');else if(delta>0)iL.moveTo('prev');}});if(opts.controls.swipe)holders.on(touchStartEvent,function(event){if(vars.nextLock||vars.prevLock||vars.total==1||vars.lockSwipe)return;vars.BODY.addClass('ilightbox-closedhand');var data=event.originalEvent.touches?event.originalEvent.touches[0]:event,scrollTop=$doc.scrollTop(),scrollLeft=$doc.scrollLeft(),offsets=[holders.eq(0).offset(),holders.eq(1).offset(),holders.eq(2).offset()],offSet=[{top:offsets[0].top-scrollTop,left:offsets[0].left-scrollLeft},{top:offsets[1].top-scrollTop,left:offsets[1].left-scrollLeft},{top:offsets[2].top-scrollTop,left:offsets[2].left-scrollLeft}],start={time:(new Date()).getTime(),coords:[data.pageX-scrollLeft,data.pageY-scrollTop]},stop;function moveEachHandler(i){var t=$(this),offset=offSet[i],scroll=[(start.coords[0]-stop.coords[0]),(start.coords[1]-stop.coords[1])];t[0].style[path=="horizontal"?'left':'top']=(path=="horizontal"?offset.left-scroll[0]:offset.top-scroll[1])+'px';} function moveHandler(event){if(!start)return;var data=event.originalEvent.touches?event.originalEvent.touches[0]:event;stop={time:(new Date()).getTime(),coords:[data.pageX-scrollLeft,data.pageY-scrollTop]};holders.each(moveEachHandler);event.preventDefault();} function repositionHolders(){holders.each(function(){var t=$(this),offset=t.data('offset')||{top:t.offset().top-scrollTop,left:t.offset().left-scrollLeft},top=offset.top,left=offset.left;t.css(transform,gpuAcceleration).stop().animate({top:top,left:left},500,'easeOutCirc',function(){t.css(transform,'');});});} holders.bind(touchMoveEvent,moveHandler);$doc.one(touchStopEvent,function(event){holders.unbind(touchMoveEvent,moveHandler);vars.BODY.removeClass('ilightbox-closedhand');if(start&&stop){if(path=="horizontal"&&stop.time-start.timehorizontalDistanceThreshold&&abs(start.coords[1]-stop.coords[1])stop.coords[0]){if(vars.current==vars.total-1&&!opts.infinite)repositionHolders();else{vars.isSwipe=true;iL.moveTo('next');}}else{if(vars.current==0&&!opts.infinite)repositionHolders();else{vars.isSwipe=true;iL.moveTo('prev');}}}else if(path=="vertical"&&stop.time-start.timehorizontalDistanceThreshold&&abs(start.coords[0]-stop.coords[0])stop.coords[1]){if(vars.current==vars.total-1&&!opts.infinite)repositionHolders();else{vars.isSwipe=true;iL.moveTo('next');}}else{if(vars.current==0&&!opts.infinite)repositionHolders();else{vars.isSwipe=true;iL.moveTo('prev');}}}else repositionHolders();} start=stop=undefined;});});},goTo:function(index){var iL=this,vars=iL.vars,opts=iL.options,diff=(index-vars.current);if(opts.infinite){if(index==vars.total-1&&vars.current==0)diff=-1;if(vars.current==vars.total-1&&index==0)diff=1;} if(diff==1)iL.moveTo('next');else if(diff==-1)iL.moveTo('prev');else{if(vars.nextLock||vars.prevLock)return false;if(typeof opts.callback.onBeforeChange=='function')opts.callback.onBeforeChange.call(iL,iL.ui);if(opts.linkId){vars.hashLock=true;window.location.hash=opts.linkId+'/'+index;} if(iL.items[index]){if(!iL.items[index].options.mousewheel)vars.lockWheel=true;else iL.vars.lockWheel=false;if(!iL.items[index].options.swipe)vars.lockSwipe=true;else vars.lockSwipe=false;} $.each([vars.holder,vars.nextPhoto,vars.prevPhoto],function(key,val){val.css(transform,gpuAcceleration).fadeOut(opts.effects.loadedFadeSpeed);});vars.current=index;vars.next=index+1;vars.prev=index-1;iL.createUI();setTimeout(function(){iL.generateBoxes();},opts.effects.loadedFadeSpeed+50);$('.ilightbox-thumbnail',vars.thumbnails).removeClass('ilightbox-active').eq(index).addClass('ilightbox-active');iL.positionThumbnails();if(opts.linkId)setTimeout(function(){vars.hashLock=false;},55);if(!opts.infinite){vars.nextButton.add(vars.prevButton).add(vars.innerPrevButton).add(vars.innerNextButton).removeClass('disabled');if(vars.current==0){vars.prevButton.add(vars.innerPrevButton).addClass('disabled');} if(vars.current>=vars.total-1){vars.nextButton.add(vars.innerNextButton).addClass('disabled');}} iL.resetCycle();if(typeof opts.callback.onAfterChange=='function')opts.callback.onAfterChange.call(iL,iL.ui);}},moveTo:function(side){var iL=this,vars=iL.vars,opts=iL.options,path=opts.path.toLowerCase(),viewport=getViewport(),switchSpeed=opts.effects.switchSpeed;if(vars.nextLock||vars.prevLock)return false;else{var item=(side=="next")?vars.next:vars.prev;if(opts.linkId){vars.hashLock=true;window.location.hash=opts.linkId+'/'+item;} if(side=="next"){if(!iL.items[item])return false;var firstHolder=vars.nextPhoto,secondHolder=vars.holder,lastHolder=vars.prevPhoto,firstClass='ilightbox-prev',secondClass='ilightbox-next';}else if(side=="prev"){if(!iL.items[item])return false;var firstHolder=vars.prevPhoto,secondHolder=vars.holder,lastHolder=vars.nextPhoto,firstClass='ilightbox-next',secondClass='ilightbox-prev';} if(typeof opts.callback.onBeforeChange=='function') opts.callback.onBeforeChange.call(iL,iL.ui);(side=="next")?vars.nextLock=true:vars.prevLock=true;var captionFirst=$('div.ilightbox-caption',secondHolder),socialFirst=$('div.ilightbox-social',secondHolder);if(captionFirst.length) captionFirst.stop().fadeOut(switchSpeed,function(){$(this).remove();});if(socialFirst.length) socialFirst.stop().fadeOut(switchSpeed,function(){$(this).remove();});if(iL.items[item].caption){iL.setCaption(iL.items[item],firstHolder);var caption=$('div.ilightbox-caption',firstHolder),percent=parseInt((caption.outerHeight()/firstHolder.outerHeight())*100);if(opts.caption.start&&percent<=50)caption.fadeIn(switchSpeed);} var social=iL.items[item].options.social;if(social){iL.setSocial(social,iL.items[item].URL,firstHolder);if(opts.social.start)$('div.ilightbox-social',firstHolder).fadeIn(opts.effects.fadeSpeed);} $.each([firstHolder,secondHolder,lastHolder],function(key,val){val.removeClass('ilightbox-next ilightbox-prev');});var firstOffset=firstHolder.data('offset'),winW=(viewport.width-(opts.styles.pageOffsetX)),winH=(viewport.height-(opts.styles.pageOffsetY)),width=firstOffset.newDims.width,height=firstOffset.newDims.height,thumbsOffset=firstOffset.thumbsOffset,diff=firstOffset.diff,top=parseInt((winH/2)-(height/2)-diff.H-(thumbsOffset.H/2)),left=parseInt((winW/2)-(width/2)-diff.W-(thumbsOffset.W/2));firstHolder.css(transform,gpuAcceleration).animate({top:top,left:left,opacity:1},switchSpeed,(vars.isSwipe)?'easeOutCirc':'easeInOutCirc',function(){firstHolder.css(transform,'');});$('div.ilightbox-container',firstHolder).animate({width:width,height:height},switchSpeed,(vars.isSwipe)?'easeOutCirc':'easeInOutCirc');var secondOffset=secondHolder.data('offset'),object=secondOffset.object;diff=secondOffset.diff;width=secondOffset.newDims.width,height=secondOffset.newDims.height;width=parseInt(width*opts.styles[side=='next'?'prevScale':'nextScale']),height=parseInt(height*opts.styles[side=='next'?'prevScale':'nextScale']),top=(path=='horizontal')?parseInt((winH/2)-object.offsetY-(height/2)-diff.H-(thumbsOffset.H/2)):parseInt(winH-object.offsetX-diff.H-(thumbsOffset.H/2));if(side=='prev') left=(path=='horizontal')?parseInt(winW-object.offsetX-diff.W-(thumbsOffset.W/2)):parseInt((winW/2)-(width/2)-diff.W-object.offsetY-(thumbsOffset.W/2));else{top=(path=='horizontal')?top:parseInt(object.offsetX-diff.H-height-(thumbsOffset.H/2)),left=(path=='horizontal')?parseInt(object.offsetX-diff.W-width-(thumbsOffset.W/2)):parseInt((winW/2)-object.offsetY-(width/2)-diff.W-(thumbsOffset.W/2));} $('div.ilightbox-container',secondHolder).animate({width:width,height:height},switchSpeed,(vars.isSwipe)?'easeOutCirc':'easeInOutCirc');secondHolder.addClass(firstClass).css(transform,gpuAcceleration).animate({top:top,left:left,opacity:opts.styles.prevOpacity},switchSpeed,(vars.isSwipe)?'easeOutCirc':'easeInOutCirc',function(){secondHolder.css(transform,'');$('.ilightbox-thumbnail',vars.thumbnails).removeClass('ilightbox-active').eq(item).addClass('ilightbox-active');iL.positionThumbnails();if(iL.items[item]){if(!iL.items[item].options.mousewheel)vars.lockWheel=true;else vars.lockWheel=false;if(!iL.items[item].options.swipe)vars.lockSwipe=true;else vars.lockSwipe=false;} vars.isSwipe=false;if(side=="next"){vars.nextPhoto=lastHolder,vars.prevPhoto=secondHolder,vars.holder=firstHolder;vars.nextPhoto.hide();vars.next=vars.next+1,vars.prev=vars.current,vars.current=vars.current+1;if(opts.infinite){if(vars.current>vars.total-1)vars.current=0;if(vars.current==vars.total-1)vars.next=0;if(vars.current==0)vars.prev=vars.total-1;} iL.createUI();if(!iL.items[vars.next]) vars.nextLock=false;else iL.loadContent(iL.items[vars.next],'next');}else{vars.prevPhoto=lastHolder;vars.nextPhoto=secondHolder;vars.holder=firstHolder;vars.prevPhoto.hide();vars.next=vars.current;vars.current=vars.prev;vars.prev=vars.current-1;if(opts.infinite){if(vars.current==vars.total-1)vars.next=0;if(vars.current==0)vars.prev=vars.total-1;} iL.createUI();if(!iL.items[vars.prev]) vars.prevLock=false;else iL.loadContent(iL.items[vars.prev],'prev');} if(opts.linkId)setTimeout(function(){vars.hashLock=false;},55);if(!opts.infinite){vars.nextButton.add(vars.prevButton).add(vars.innerPrevButton).add(vars.innerNextButton).removeClass('disabled');if(vars.current==0) vars.prevButton.add(vars.innerPrevButton).addClass('disabled');if(vars.current>=vars.total-1) vars.nextButton.add(vars.innerNextButton).addClass('disabled');} iL.repositionPhoto();iL.resetCycle();if(typeof opts.callback.onAfterChange=='function') opts.callback.onAfterChange.call(iL,iL.ui);});top=(path=='horizontal')?getPixel(lastHolder,'top'):((side=="next")?parseInt(-(winH/2)-lastHolder.outerHeight()):parseInt(top*2)),left=(path=='horizontal')?((side=="next")?parseInt(-(winW/2)-lastHolder.outerWidth()):parseInt(left*2)):getPixel(lastHolder,'left');lastHolder.css(transform,gpuAcceleration).animate({top:top,left:left,opacity:opts.styles.nextOpacity},switchSpeed,(vars.isSwipe)?'easeOutCirc':'easeInOutCirc',function(){lastHolder.css(transform,'');}).addClass(secondClass);}},setCaption:function(obj,target){var iL=this,caption=$('
');if(obj.caption){caption.html(obj.caption);$('div.ilightbox-container',target).append(caption);}},normalizeSocial:function(obj,url){var iL=this,vars=iL.vars,opts=iL.options,baseURL=window.location.href;$.each(obj,function(key,value){if(!value) return true;var item=key.toLowerCase(),source,text;switch(item){case'facebook':source="//www.facebook.com/share.php?v=4&src=bm&u={URL}",text="Share on Facebook";break;case'twitter':source="//twitter.com/home?status={URL}",text="Share on Twitter";break;case'googleplus':source="//plus.google.com/share?url={URL}",text="Share on Google+";break;case'delicious':source="//delicious.com/post?url={URL}",text="Share on Delicious";break;case'digg':source="//digg.com/submit?phase=2&url={URL}",text="Share on Digg";break;case'reddit':source="//reddit.com/submit?url={URL}",text="Share on reddit";break;} obj[key]={URL:value.URL&&absolutizeURI(baseURL,value.URL)||opts.linkId&&window.location.href||typeof url!=='string'&&baseURL||url&&absolutizeURI(baseURL,url)||baseURL,source:value.source||source||value.URL&&absolutizeURI(baseURL,value.URL)||url&&absolutizeURI(baseURL,url),text:value.text||text||"Share on "+key,width:(typeof(value.width)!='undefined'&&!isNaN(value.width))?parseInt(value.width):640,height:value.height||360};});return obj;},setSocial:function(obj,url,target){var iL=this,socialBar=$('
'),buttons='
    ';obj=iL.normalizeSocial(obj,url);$.each(obj,function(key,value){var item=key.toLowerCase(),source=value.source.replace(/\{URL\}/g,encodeURIComponent(value.URL).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/%20/g,'+'));buttons+='
  • ';});buttons+='
';socialBar.html(buttons);$('div.ilightbox-container',target).append(socialBar);},fullScreenAction:function(){var iL=this,vars=iL.vars;if(fullScreenApi.supportsFullScreen){if(fullScreenApi.isFullScreen())fullScreenApi.cancelFullScreen(document.documentElement);else fullScreenApi.requestFullScreen(document.documentElement);}else{iL.doFullscreen();}},doFullscreen:function(){var iL=this,vars=iL.vars,viewport=getViewport(),opts=iL.options;if(opts.fullAlone){var currentHolder=vars.holder,current=iL.items[vars.current],windowWidth=viewport.width,windowHeight=viewport.height,elements=[currentHolder,vars.nextPhoto,vars.prevPhoto,vars.nextButton,vars.prevButton,vars.overlay,vars.toolbar,vars.thumbnails,vars.loader],hideElements=[vars.nextPhoto,vars.prevPhoto,vars.nextButton,vars.prevButton,vars.loader,vars.thumbnails];if(!vars.isInFullScreen){vars.isInFullScreen=vars.lockKey=vars.lockWheel=vars.lockSwipe=true;vars.overlay.css({opacity:1});$.each(hideElements,function(i,element){element.hide();});vars.fullScreenButton.attr('title',opts.text.exitFullscreen);if(opts.fullStretchTypes.indexOf(current.type)!=-1)currentHolder.data({naturalWidthOld:currentHolder.data('naturalWidth'),naturalHeightOld:currentHolder.data('naturalHeight'),naturalWidth:windowWidth,naturalHeight:windowHeight});else{var viewport=current.options.fullViewPort||opts.fullViewPort||'',newWidth=windowWidth,newHeight=windowHeight,width=currentHolder.data('naturalWidth'),height=currentHolder.data('naturalHeight');if(viewport.toLowerCase()=='fill'){newHeight=(newWidth/width)*height;if(newHeightnewWidth||height>newHeight)?true:false,dims=iL.getNewDimenstions(newWidth,newHeight,width,height,scale);newWidth=dims.width,newHeight=dims.height;} currentHolder.data({naturalWidthOld:currentHolder.data('naturalWidth'),naturalHeightOld:currentHolder.data('naturalHeight'),naturalWidth:newWidth,naturalHeight:newHeight});} $.each(elements,function(key,val){val.addClass('ilightbox-fullscreen');});if(typeof opts.callback.onEnterFullScreen=='function')opts.callback.onEnterFullScreen.call(iL,iL.ui);}else{vars.isInFullScreen=vars.lockKey=vars.lockWheel=vars.lockSwipe=false;vars.overlay.css({opacity:iL.options.overlay.opacity});$.each(hideElements,function(i,element){element.show();});vars.fullScreenButton.attr('title',opts.text.enterFullscreen);currentHolder.data({naturalWidth:currentHolder.data('naturalWidthOld'),naturalHeight:currentHolder.data('naturalHeightOld'),naturalWidthOld:null,naturalHeightOld:null});$.each(elements,function(key,val){val.removeClass('ilightbox-fullscreen');});if(typeof opts.callback.onExitFullScreen=='function')opts.callback.onExitFullScreen.call(iL,iL.ui);}}else{if(!vars.isInFullScreen)vars.isInFullScreen=true;else vars.isInFullScreen=false;} iL.repositionPhoto(true);},closeAction:function(){var iL=this,vars=iL.vars,opts=iL.options;$win.unbind('.iLightBox');$doc.off('.iLightBox');if(vars.isInFullScreen)fullScreenApi.cancelFullScreen(document.documentElement);$('.ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails').off('.iLightBox');if(opts.hide.effect)vars.overlay.stop().fadeOut(opts.hide.speed,function(){vars.overlay.remove();vars.BODY.removeClass('ilightbox-noscroll').off('.iLightBox');});else{vars.overlay.remove();vars.BODY.removeClass('ilightbox-noscroll').off('.iLightBox');} var fadeOuts=[vars.toolbar,vars.holder,vars.nextPhoto,vars.prevPhoto,vars.nextButton,vars.prevButton,vars.loader,vars.thumbnails];$.each(fadeOuts,function(i,element){element.removeAttr('style').remove();});vars.dontGenerateThumbs=vars.isInFullScreen=false;window.iLightBox=null;if(opts.linkId){vars.hashLock=true;removeHash();setTimeout(function(){vars.hashLock=false;},55);} if(typeof opts.callback.onHide=='function')opts.callback.onHide.call(iL,iL.ui);},repositionPhoto:function(){var iL=this,vars=iL.vars,opts=iL.options,path=opts.path.toLowerCase(),viewport=getViewport(),winWidth=viewport.width,winHeight=viewport.height;var thumbsOffsetW=(vars.isInFullScreen&&opts.fullAlone||vars.isMobile)?0:((path=='horizontal')?0:vars.thumbnails.outerWidth()),thumbsOffsetH=vars.isMobile?vars.toolbar.outerHeight():((vars.isInFullScreen&&opts.fullAlone)?0:((path=='horizontal')?vars.thumbnails.outerHeight():0)),width=(vars.isInFullScreen&&opts.fullAlone)?winWidth:(winWidth-(opts.styles.pageOffsetX)),height=(vars.isInFullScreen&&opts.fullAlone)?winHeight:(winHeight-(opts.styles.pageOffsetY)),offsetW=(path=='horizontal')?parseInt((iL.items[vars.next]||iL.items[vars.prev])?((opts.styles.nextOffsetX+opts.styles.prevOffsetX))*2:(((width/10)<=30)?30:(width/10))):parseInt(((width/10)<=30)?30:(width/10))+thumbsOffsetW,offsetH=(path=='horizontal')?parseInt(((height/10)<=30)?30:(height/10))+thumbsOffsetH:parseInt((iL.items[vars.next]||iL.items[vars.prev])?((opts.styles.nextOffsetX+opts.styles.prevOffsetX))*2:(((height/10)<=30)?30:(height/10)));var elObject={type:'current',width:width,height:height,item:iL.items[vars.current],offsetW:offsetW,offsetH:offsetH,thumbsOffsetW:thumbsOffsetW,thumbsOffsetH:thumbsOffsetH,animate:arguments.length,holder:vars.holder};iL.repositionEl(elObject);if(iL.items[vars.next]){elObject=$.extend(elObject,{type:'next',item:iL.items[vars.next],offsetX:opts.styles.nextOffsetX,offsetY:opts.styles.nextOffsetY,holder:vars.nextPhoto});iL.repositionEl(elObject);} if(iL.items[vars.prev]){elObject=$.extend(elObject,{type:'prev',item:iL.items[vars.prev],offsetX:opts.styles.prevOffsetX,offsetY:opts.styles.prevOffsetY,holder:vars.prevPhoto});iL.repositionEl(elObject);} var loaderCss=(path=="horizontal")?{left:parseInt((width/2)-(vars.loader.outerWidth()/2))}:{top:parseInt((height/2)-(vars.loader.outerHeight()/2))};vars.loader.css(loaderCss);},repositionEl:function(obj){var iL=this,vars=iL.vars,opts=iL.options,path=opts.path.toLowerCase(),widthAvail=(obj.type=='current')?((vars.isInFullScreen&&opts.fullAlone)?obj.width:(obj.width-obj.offsetW)):(obj.width-obj.offsetW),heightAvail=(obj.type=='current')?((vars.isInFullScreen&&opts.fullAlone)?obj.height:(obj.height-obj.offsetH)):(obj.height-obj.offsetH),itemParent=obj.item,item=obj.item.options,holder=obj.holder,offsetX=obj.offsetX||0,offsetY=obj.offsetY||0,thumbsOffsetW=obj.thumbsOffsetW,thumbsOffsetH=obj.thumbsOffsetH;if(obj.type=='current'){if(typeof item.width=='number'&&item.width)widthAvail=((vars.isInFullScreen&&opts.fullAlone)&&(opts.fullStretchTypes.indexOf(itemParent.type)!=-1||item.fullViewPort||opts.fullViewPort))?widthAvail:((item.width>widthAvail)?widthAvail:item.width);if(typeof item.height=='number'&&item.height)heightAvail=((vars.isInFullScreen&&opts.fullAlone)&&(opts.fullStretchTypes.indexOf(itemParent.type)!=-1||item.fullViewPort||opts.fullViewPort))?heightAvail:((item.height>heightAvail)?heightAvail:item.height);}else{if(typeof item.width=='number'&&item.width)widthAvail=(item.width>widthAvail)?widthAvail:item.width;if(typeof item.height=='number'&&item.height)heightAvail=(item.height>heightAvail)?heightAvail:item.height;} heightAvail=parseInt(heightAvail-$('.ilightbox-inner-toolbar',holder).outerHeight());var width=(typeof item.width=='string'&&item.width.indexOf('%')!=-1)?percentToValue(parseInt(item.width.replace('%','')),obj.width):holder.data('naturalWidth'),height=(typeof item.height=='string'&&item.height.indexOf('%')!=-1)?percentToValue(parseInt(item.height.replace('%','')),obj.height):holder.data('naturalHeight');var dims=((typeof item.width=='string'&&item.width.indexOf('%')!=-1||typeof item.height=='string'&&item.height.indexOf('%')!=-1)?{width:width,height:height}:iL.getNewDimenstions(widthAvail,heightAvail,width,height)),newDims=$.extend({},dims,{});if(obj.type=='prev'||obj.type=='next') width=parseInt(dims.width*((obj.type=='next')?opts.styles.nextScale:opts.styles.prevScale)),height=parseInt(dims.height*((obj.type=='next')?opts.styles.nextScale:opts.styles.prevScale));else width=dims.width,height=dims.height;var widthDiff=parseInt((getPixel(holder,'padding-left')+getPixel(holder,'padding-right')+getPixel(holder,'border-left-width')+getPixel(holder,'border-right-width'))/2),heightDiff=parseInt((getPixel(holder,'padding-top')+getPixel(holder,'padding-bottom')+getPixel(holder,'border-top-width')+getPixel(holder,'border-bottom-width')+($('.ilightbox-inner-toolbar',holder).outerHeight()||0))/2);switch(obj.type){case'current':var top=parseInt((obj.height/2)-(height/2)-heightDiff-(thumbsOffsetH/2)),left=parseInt((obj.width/2)-(width/2)-widthDiff-(thumbsOffsetW/2));break;case'next':var top=(path=='horizontal')?parseInt((obj.height/2)-offsetY-(height/2)-heightDiff-(thumbsOffsetH/2)):parseInt(obj.height-offsetX-heightDiff-(thumbsOffsetH/2)),left=(path=='horizontal')?parseInt(obj.width-offsetX-widthDiff-(thumbsOffsetW/2)):parseInt((obj.width/2)-(width/2)-widthDiff-offsetY-(thumbsOffsetW/2));break;case'prev':var top=(path=='horizontal')?parseInt((obj.height/2)-offsetY-(height/2)-heightDiff-(thumbsOffsetH/2)):parseInt(offsetX-heightDiff-height-(thumbsOffsetH/2)),left=(path=='horizontal')?parseInt(offsetX-widthDiff-width-(thumbsOffsetW/2)):parseInt((obj.width/2)-offsetY-(width/2)-widthDiff-(thumbsOffsetW/2));break;} holder.data('offset',{top:top,left:left,newDims:newDims,diff:{W:widthDiff,H:heightDiff},thumbsOffset:{W:thumbsOffsetW,H:thumbsOffsetH},object:obj});if(obj.animate>0&&opts.effects.reposition){holder.css(transform,gpuAcceleration).stop().animate({top:top,left:left},opts.effects.repositionSpeed,'easeOutCirc',function(){holder.css(transform,'');});$('div.ilightbox-container',holder).stop().animate({width:width,height:height},opts.effects.repositionSpeed,'easeOutCirc');$('div.ilightbox-inner-toolbar',holder).stop().animate({width:width},opts.effects.repositionSpeed,'easeOutCirc',function(){$(this).css('overflow','visible');});}else{holder.css({top:top,left:left});$('div.ilightbox-container',holder).css({width:width,height:height});$('div.ilightbox-inner-toolbar',holder).css({width:width});}},resume:function(priority){var iL=this,vars=iL.vars,opts=iL.options;if(!opts.slideshow.pauseTime||opts.controls.slideshow&&vars.total<=1||priorityiL.options.maxScale)factor=iL.options.maxScale;else if(factor=0)?true:false,html5H264:!!(testEl.canPlayType&&testEl.canPlayType('video/mp4').replace(/no/,'')),html5WebM:!!(testEl.canPlayType&&testEl.canPlayType('video/webm').replace(/no/,'')),html5Vorbis:!!(testEl.canPlayType&&testEl.canPlayType('video/ogg').replace(/no/,'')),html5QuickTime:!!(testEl.canPlayType&&testEl.canPlayType('video/quicktime').replace(/no/,''))};},addContent:function(element,obj){var iL=this,el;switch(obj.type){case'video':var HTML5=false,videoType=obj.videoType,html5video=obj.options.html5video;if(((videoType=='video/mp4'||obj.ext=='mp4'||obj.ext=='m4v')||html5video.h264)&&iL.plugins.html5H264) obj.ext='mp4',obj.URL=html5video.h264||obj.URL;else if(html5video.webm&&iL.plugins.html5WebM) obj.ext='webm',obj.URL=html5video.webm||obj.URL;else if(html5video.ogg&&iL.plugins.html5Vorbis) obj.ext='ogv',obj.URL=html5video.ogg||obj.URL;if(iL.plugins.html5H264&&(videoType=='video/mp4'||obj.ext=='mp4'||obj.ext=='m4v'))HTML5=true,videoType="video/mp4";else if(iL.plugins.html5WebM&&(videoType=='video/webm'||obj.ext=='webm'))HTML5=true,videoType="video/webm";else if(iL.plugins.html5Vorbis&&(videoType=='video/ogg'||obj.ext=='ogv'))HTML5=true,videoType="video/ogg";else if(iL.plugins.html5QuickTime&&(videoType=='video/quicktime'||obj.ext=='mov'||obj.ext=='qt'))HTML5=true,videoType="video/quicktime";if(HTML5){el=$('