/** HTML5 Gallery - jQuery Image and Video Gallery Plugin * Copyright 2014 Magic Hills Pty Ltd All Rights Reserved * Website: http://html5box.com * Version 6.7 */ (function(){for(var p=document.getElementsByTagName("script"),q="",n=0;nn[0]||1==n[0]&&6>n[1])p=!0;if(p){var p=document.getElementsByTagName("head")[0],r=document.createElement("script");r.setAttribute("type","text/javascript");r.readyState?r.onreadystatechange=function(){if("loaded"==r.readyState||"complete"== r.readyState)r.onreadystatechange=null,loadHtml5Gallery(q)}:r.onload=function(){loadHtml5Gallery(q)};r.setAttribute("src",q+"jquery.js");p.appendChild(r)}else loadHtml5Gallery(q)})(); function loadHtml5Gallery(p){jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(c,e,a,d,b){return jQuery.easing[jQuery.easing.def](c,e,a,d,b)},easeInQuad:function(c,e,a,d,b){return d*(e/=b)*e+a},easeOutQuad:function(c,e,a,d,b){return-d*(e/=b)*(e-2)+a},easeInOutQuad:function(c,e,a,d,b){return 1>(e/=b/2)?d/2*e*e+a:-d/2*(--e*(e-2)-1)+a},easeInCubic:function(c,e,a,d,b){return d*(e/=b)*e*e+a},easeOutCubic:function(c,e,a,d,b){return d*((e=e/b-1)*e*e+1)+ a},easeInOutCubic:function(c,e,a,d,b){return 1>(e/=b/2)?d/2*e*e*e+a:d/2*((e-=2)*e*e+2)+a},easeInQuart:function(c,e,a,d,b){return d*(e/=b)*e*e*e+a},easeOutQuart:function(c,e,a,d,b){return-d*((e=e/b-1)*e*e*e-1)+a},easeInOutQuart:function(c,e,a,d,b){return 1>(e/=b/2)?d/2*e*e*e*e+a:-d/2*((e-=2)*e*e*e-2)+a},easeInQuint:function(c,e,a,d,b){return d*(e/=b)*e*e*e*e+a},easeOutQuint:function(c,e,a,d,b){return d*((e=e/b-1)*e*e*e*e+1)+a},easeInOutQuint:function(c,e,a,d,b){return 1>(e/=b/2)?d/2*e*e*e*e*e+a:d/ 2*((e-=2)*e*e*e*e+2)+a},easeInSine:function(c,e,a,d,b){return-d*Math.cos(e/b*(Math.PI/2))+d+a},easeOutSine:function(c,e,a,d,b){return d*Math.sin(e/b*(Math.PI/2))+a},easeInOutSine:function(c,e,a,d,b){return-d/2*(Math.cos(Math.PI*e/b)-1)+a},easeInExpo:function(c,e,a,d,b){return 0==e?a:d*Math.pow(2,10*(e/b-1))+a},easeOutExpo:function(c,e,a,d,b){return e==b?a+d:d*(-Math.pow(2,-10*e/b)+1)+a},easeInOutExpo:function(c,e,a,d,b){return 0==e?a:e==b?a+d:1>(e/=b/2)?d/2*Math.pow(2,10*(e-1))+a:d/2*(-Math.pow(2, -10*--e)+2)+a},easeInCirc:function(c,e,a,d,b){return-d*(Math.sqrt(1-(e/=b)*e)-1)+a},easeOutCirc:function(c,e,a,d,b){return d*Math.sqrt(1-(e=e/b-1)*e)+a},easeInOutCirc:function(c,e,a,d,b){return 1>(e/=b/2)?-d/2*(Math.sqrt(1-e*e)-1)+a:d/2*(Math.sqrt(1-(e-=2)*e)+1)+a},easeInElastic:function(c,e,a,d,b){c=1.70158;var k=0,g=d;if(0==e)return a;if(1==(e/=b))return a+d;k||(k=0.3*b);ge?-0.5*g*Math.pow(2,10*(e-=1))*Math.sin((e*b-c)*2*Math.PI/k)+a:0.5*g*Math.pow(2,-10*(e-=1))*Math.sin((e*b-c)*2*Math.PI/ k)+d+a},easeInBack:function(c,e,a,d,b,k){void 0==k&&(k=1.70158);return d*(e/=b)*e*((k+1)*e-k)+a},easeOutBack:function(c,e,a,d,b,k){void 0==k&&(k=1.70158);return d*((e=e/b-1)*e*((k+1)*e+k)+1)+a},easeInOutBack:function(c,e,a,d,b,k){void 0==k&&(k=1.70158);return 1>(e/=b/2)?d/2*e*e*(((k*=1.525)+1)*e-k)+a:d/2*((e-=2)*e*(((k*=1.525)+1)*e+k)+2)+a},easeInBounce:function(c,e,a,d,b){return d-jQuery.easing.easeOutBounce(c,b-e,0,d,b)+a},easeOutBounce:function(c,e,a,d,b){return(e/=b)<1/2.75?d*7.5625*e*e+a:e<2/ 2.75?d*(7.5625*(e-=1.5/2.75)*e+0.75)+a:e<2.5/2.75?d*(7.5625*(e-=2.25/2.75)*e+0.9375)+a:d*(7.5625*(e-=2.625/2.75)*e+0.984375)+a},easeInOutBounce:function(c,e,a,d,b){return eg?e.swipeRight&&e.swipeRight.call():e.swipeLeft&&e.swipeLeft.call()),100j?e.swipeBottom&&e.swipeBottom.call():e.swipeTop&&e.swipeTop.call());c(a)}function c(){y=f=j=g=-1}var g=-1,j=-1,f=-1,y=-1;try{q(this).bind("touchstart", a),q(this).bind("touchmove",d),q(this).bind("touchend",b),q(this).bind("touchcancel",c)}catch(s){}})};var n=jQuery;n.fn.drag=function(c,e,a){var d="string"==typeof c?c:"",b=n.isFunction(c)?c:n.isFunction(e)?e:null;0!==d.indexOf("drag")&&(d="drag"+d);a=(c==b?e:a)||{};return b?this.bind(d,a,b):this.trigger(d)};var r=n.event,u=r.special,l=null,l=u.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:!1,drop:!0,click:!1},datakey:"dragdata",livekey:"livedrag",add:function(c){var e=n.data(this, l.datakey),a=c.data||{};e.related+=1;!e.live&&c.selector&&(e.live=!0,r.add(this,"draginit."+l.livekey,l.delegate));n.each(l.defaults,function(c){void 0!==a[c]&&(e[c]=a[c])})},remove:function(){n.data(this,l.datakey).related-=1},setup:function(){if(!n.data(this,l.datakey)){var c=n.extend({related:0},l.defaults);n.data(this,l.datakey,c);r.add(this,"mousedown",l.init,c);this.attachEvent&&this.attachEvent("ondragstart",l.dontstart)}},teardown:function(){n.data(this,l.datakey).related||(n.removeData(this, l.datakey),r.remove(this,"mousedown",l.init),r.remove(this,"draginit",l.delegate),l.textselect(!0),this.detachEvent&&this.detachEvent("ondragstart",l.dontstart))},init:function(c){var e=c.data,a;if(!(0n.inArray(a,e)&&e.push(a)});return!e.length?!1:n(e).bind("dragend."+l.livekey,function(){r.remove(this,"."+l.livekey)})},hijack:function(c,e,a,d,b){if(a){var k=c.originalEvent,g=c.type,j=e.indexOf("drop")?"drag":"drop",f,v=d||0,s,h;d=!isNaN(d)? d:a.interactions.length;c.type=e;c.originalEvent=null;a.results=[];do if((s=a.interactions[v])&&!("dragend"!==e&&s.cancelled))h=l.properties(c,a,s),s.results=[],n(b||s[j]||a.droppable).each(function(b,d){f=(h.target=d)?r.handle.call(d,c,h):null;!1===f?("drag"==j&&(s.cancelled=!0,a.propagates-=1),"drop"==e&&(s[j][b]=null)):"dropinit"==e&&s.droppable.push(l.element(f)||d);"dragstart"==e&&(s.proxy=n(l.element(f)||s.drag)[0]);s.results.push(f);delete c.result;if("dropinit"!==e)return f}),a.results[v]= l.flatten(s.results),"dropinit"==e&&(s.droppable=l.flatten(s.droppable)),"dragstart"==e&&!s.cancelled&&h.update();while(++v"); n||(m.after(D),D.css({position:"absolute",top:"50%",left:"50%",display:"block",cursor:"pointer",width:64,height:64,"margin-left":-32,"margin-top":-32,"background-image":"url('"+c+"html5boxplayer_playvideo.png')","background-position":"center center","background-repeat":"no-repeat"}).bind(g,function(){m.get(0).play()}));var G=h("
"),t=h("
--:--
--:--
"); m.after(t);m.after(G);G.css({display:"none",position:"fixed",left:0,top:0,bottom:0,right:0,"z-index":2147483647});t.css({display:"block",position:"absolute",width:"100%",height:j,left:0,bottom:0});var z=function(){l=!0};m.bind(g,function(){l=!0}).hover(function(){l=!0},function(){l=!1});setInterval(function(){l&&(t.show(),l=!1,clearTimeout(f),f=setTimeout(function(){m.get(0).paused||t.fadeOut()},5E3))},250);h(".html5boxVideoControlsBg",t).css({display:"block",position:"absolute",width:"100%",height:"100%", left:0,top:0,"background-color":"#000000",opacity:0.7,filter:"alpha(opacity=70)"});h(".html5boxPlayPause",t).css({display:"block",position:"relative",width:"32px",height:"32px",margin:Math.floor((j-32)/2),"float":"left"});var H=h(".html5boxPlay",t),I=h(".html5boxPause",t);H.css({display:"block",position:"absolute",top:0,left:0,width:"32px",height:"32px",cursor:"pointer","background-image":"url('"+c+"html5boxplayer_playpause.png')","background-position":"top left"}).hover(function(){h(this).css({"background-position":"bottom left"})}, function(){h(this).css({"background-position":"top left"})}).bind(g,function(){m.get(0).play()});I.css({display:"none",position:"absolute",top:0,left:0,width:"32px",height:"32px",cursor:"pointer","background-image":"url('"+c+"html5boxplayer_playpause.png')","background-position":"top right"}).hover(function(){h(this).css({"background-position":"bottom right"})},function(){h(this).css({"background-position":"top right"})}).bind(g,function(){m.get(0).pause()});var C=h(".html5boxTimeCurrent",t),L=h(".html5boxTimeTotal", t),w=h(".html5boxSeeker",t),E=h(".html5boxSeekerPlay",t),M=h(".html5boxSeekerBuffer",t),O=h(".html5boxSeekerHandler",t);C.css({display:"block",position:"relative","float":"left","line-height":j+"px","font-weight":"normal","font-size":"12px",margin:"0 8px","font-family":"Arial, Helvetica, sans-serif",color:"#fff"});L.css({display:"block",position:"relative","float":"right","line-height":j+"px","font-weight":"normal","font-size":"12px",margin:"0 8px","font-family":"Arial, Helvetica, sans-serif",color:"#fff"}); w.css({display:"block",cursor:"pointer",overflow:"hidden",position:"relative",height:"10px","background-color":"#222",margin:Math.floor((j-10)/2)+"px 4px"}).bind(d,function(c){c=(a?c.originalEvent.touches[0]:c).pageX-w.offset().left;E.css({width:c});m.get(0).currentTime=c*m.get(0).duration/w.width();w.bind(b,function(b){b=(a?b.originalEvent.touches[0]:b).pageX-w.offset().left;E.css({width:b});m.get(0).currentTime=b*m.get(0).duration/w.width()})}).bind(k,function(){w.unbind(b)});M.css({display:"block", position:"absolute",left:0,top:0,height:"100%","background-color":"#444"});E.css({display:"block",position:"absolute",left:0,top:0,height:"100%","background-color":"#fcc500"});if(!n&&(m.get(0).requestFullscreen||m.get(0).webkitRequestFullScreen||m.get(0).mozRequestFullScreen||m.get(0).webkitEnterFullScreen||m.get(0).msRequestFullscreen)){var J=function(a){t.css({position:a?"fixed":"absolute"});var b=A.css("background-position")?A.css("background-position").split(" ")[1]:A.css("background-position-y"); A.css({"background-position":(a?"right":"left")+" "+b});G.css({display:a?"block":"none"});a?(h(document).bind("mousemove",z),t.css({"z-index":2147483647})):(h(document).unbind("mousemove",z),t.css({"z-index":""}))};document.addEventListener("fullscreenchange",function(){s=document.fullscreen;J(document.fullscreen)},!1);document.addEventListener("mozfullscreenchange",function(){s=document.mozFullScreen;J(document.mozFullScreen)},!1);document.addEventListener("webkitfullscreenchange",function(){s=document.webkitIsFullScreen; J(document.webkitIsFullScreen)},!1);m.get(0).addEventListener("webkitbeginfullscreen",function(){s=!0},!1);m.get(0).addEventListener("webkitendfullscreen",function(){s=!1},!1);h("head").append("");var A=h(".html5boxFullscreen",t);A.css({display:"block",position:"relative","float":"right",width:"32px",height:"32px",margin:Math.floor((j-32)/2),cursor:"pointer","background-image":"url('"+c+"html5boxplayer_fullscreen.png')", "background-position":"left top"}).hover(function(){var a=h(this).css("background-position")?h(this).css("background-position").split(" ")[0]:h(this).css("background-position-x");h(this).css({"background-position":a+" bottom"})},function(){var a=h(this).css("background-position")?h(this).css("background-position").split(" ")[0]:h(this).css("background-position-x");h(this).css({"background-position":a+" top"})}).bind(g,function(){(s=!s)?(m.get(0).requestFullscreen?m.get(0).requestFullscreen():m.get(0).webkitRequestFullScreen? m.get(0).webkitRequestFullScreen():m.get(0).mozRequestFullScreen?m.get(0).mozRequestFullScreen():m.get(0).webkitEnterFullScreen&&m.get(0).webkitEnterFullScreen(),m.get(0).msRequestFullscreen&&m.get(0).msRequestFullscreen()):document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()})}r&& h(".html5boxHD",t).css({display:"block",position:"relative","float":"right",width:"32px",height:"32px",margin:Math.floor((j-32)/2),cursor:"pointer","background-image":"url('"+c+"html5boxplayer_hd.png')","background-position":(p?"right":"left")+" center"}).bind(g,function(){p=!p;h(this).css({"background-position":(p?"right":"left")+" center"});e.isHd=p;var a=m.get(0).isPaused;m.get(0).setAttribute("src",(p?r:q)+"#t="+m.get(0).currentTime);a?n||m.get(0).pause():m.get(0).play()});u=m.get(0).volume;m.get(0).volume= u/2+0.1;if(m.get(0).volume===u/2+0.1){m.get(0).volume=u;var u=h(".html5boxVolume",t),F=h(".html5boxVolumeButton",t),K=h(".html5boxVolumeBar",t),x=h(".html5boxVolumeBarBg",t),B=h(".html5boxVolumeBarActive",t);u.css({display:"block",position:"relative","float":"right",width:"32px",height:"32px",margin:Math.floor((j-32)/2)}).hover(function(){clearTimeout(v);var a=m.get(0).volume;B.css({height:Math.round(100*a)+"%"});K.show()},function(){clearTimeout(v);v=setTimeout(function(){K.hide()},1E3)});F.css({display:"block", position:"absolute",top:0,left:0,width:"32px",height:"32px",cursor:"pointer","background-image":"url('"+c+"html5boxplayer_volume.png')","background-position":"top left"}).hover(function(){var a=h(this).css("background-position")?h(this).css("background-position").split(" ")[0]:h(this).css("background-position-x");h(this).css({"background-position":a+" bottom"})},function(){var a=h(this).css("background-position")?h(this).css("background-position").split(" ")[0]:h(this).css("background-position-x"); h(this).css({"background-position":a+" top"})}).bind(g,function(){var a=m.get(0).volume;0c?0:c;B.css({height:Math.round(100*c)+"%"});F.css({"background-position":"left "+(0b?0:b;B.css({height:Math.round(100*b)+"%"});F.css({"background-position":"left "+(0c?"0"+c:c)+":"+(10>a?"0"+a:a);0b?"0"+b:b)+":"+c);return c},d=function(){t.show();clearTimeout(f);D.show();H.show();I.hide()},k=function(){var a= m.get(0).currentTime;if(a){C.text(N(a));var b=m.get(0).duration;if(b){L.text(N(b));var c=w.width(),a=Math.round(c*a/b);E.css({width:a});O.css({left:a})}}},g=function(){if(m.get(0).buffered&&0":0");a.options.watermarkcode+="
";a.options.fv?a.options.watermarkcode+=a.options.fvm:0");a.options.watermarkcode+="
";if(a.options.fv||0";a.createStyle();a.createMarkup();a.createImageToolbox();0>=a.elemArray.length||(a.createEvents(),a.loadCarousel(),a.savedElem=-1,a.curElem= -1,a.nextElem=-1,a.prevElem=-1,a.isPaused=!a.options.autoslide,a.isFullscreen=!1,a.showingPoster=!1,a.disableTouchSwipe=!1,d=a.getParams(),a.slideRun(d.html5galleryid&&d.html5galleryid in a.elemArray?d.html5galleryid:0),a.options.responsive&&(a.resizeGallery(),c(window).resize(function(){a.resizeGallery()})))},resizeGallery:function(){switch(this.options.skin){case "vertical":case "showcase":this.resizeStyleVertical();break;default:this.resizeStyleDefault()}this.resizeImageToolbox()},initData:function(a){this.elemArray= [];if(this.options.src&&0this.options.xml.indexOf("?")?"?":"&",this.options.xml+=Math.random());var b=this;c.ajax({type:"GET",url:this.options.xml,dataType:"xml",success:function(d){c(d).find("slide").each(function(a){var d=c(this).find("title").text(),e=c(this).find("description").text()?c(this).find("description").text():c(this).find("information").text();d||(d="");e||(e="");var k=c(this).find("mediatype").text()?c(this).find("mediatype").text():b.checkType(c(this).find("file").text());b.elemArray.push([c(this).find("id").length? c(this).find("id").text():a,c(this).find("thumbnail").text(),c(this).find("file").text(),c(this).find("file-ogg").text(),c(this).find("file-webm").text(),c(this).find("link").text(),c(this).find("linktarget").text(),d,e,k,c(this).find("width").length&&!isNaN(parseInt(c(this).find("width").text()))?parseInt(c(this).find("width").text()):b.options.width,c(this).find("height").length&&!isNaN(parseInt(c(this).find("height").text()))?parseInt(c(this).find("height").text()):b.options.height,c(this).find("poster").text(), c(this).find("hd").text(),c(this).find("hdogg").text(),c(this).find("hdwebm").text(),c(this).find("duration").text()])});b.readTags();a(b)}})}else this.options.remote&&0
");this.$gallery.appendTo(this.container);this.options.socialurlforeach||this.createSocialMedia();this.options.googleanalyticsaccount&&!window._gaq&&(window._gaq=window._gaq||[],window._gaq.push(["_setAccount",this.options.googleanalyticsaccount]),window._gaq.push(["_trackPageview"]),c.getScript(("https:"==document.location.protocol?"https://ssl":"http://www")+ ".google-analytics.com/ga.js"))},createSocialMedia:function(){c(".html5gallery-viral-"+this.id,this.$gallery).empty();var a=window.location.href;this.options.socialurlforeach&&(a+=(0>window.location.href.indexOf("?")?"?":"&")+"html5galleryid="+this.elemArray[this.curElem][0]);if(this.options.showsocialmedia&&this.options.showfacebooklike){var d="
")}this.options.showsocialmedia&&this.options.showtwitter&& (d=""), c.getScript(("https:"==document.location.protocol?"https:":"http:")+"//platform.twitter.com/widgets.js"));this.options.showsocialmedia&&this.options.showgoogleplus&&(d="
"),c.getScript("https://apis.google.com/js/plusone.js"))}, playGallery:function(){var a=this;c(".html5gallery-play-"+a.id,a.$gallery).hide();c(".html5gallery-pause-"+a.id,a.$gallery).show();a.isPaused=!1;a.slideshowTimeout=setTimeout(function(){a.slideRun(-1)},a.elemArray[a.curElem][16]?a.elemArray[a.curElem][16]:a.options.slideshowinterval);c(".html5gallery-timer-"+a.id,a.$gallery).css({width:0});a.slideTimerCount=0;a.options.showtimer&&(a.slideTimer=setInterval(function(){a.showSlideTimer()},50))},pauseGallery:function(){c(".html5gallery-play-"+this.id, this.$gallery).show();c(".html5gallery-pause-"+this.id,this.$gallery).hide();this.isPaused=!0;clearTimeout(this.slideshowTimeout);c(".html5gallery-timer-"+this.id,this.$gallery).css({width:0});clearInterval(this.slideTimer);this.slideTimerCount=0},createEvents:function(){var a=this;c(".html5gallery-play-"+this.id,this.$gallery).click(function(){a.playGallery()});c(".html5gallery-pause-"+this.id,this.$gallery).click(function(){a.pauseGallery()});c(".html5gallery-lightbox-"+this.id,this.$gallery).click(function(){a.goFullscreen()}); c(".html5gallery-left-"+this.id,this.$gallery).click(function(){a.slideRun(-2,!0)});c(".html5gallery-right-"+this.id,this.$gallery).click(function(){a.slideRun(-1,!0)});if(a.options.enabletouchswipe){var d=a.options.isAndroid&&a.options.enabletouchswipeonandroid?!0:!1;c(".html5gallery-box-"+this.id,this.$gallery).touchSwipe({preventWebBrowser:d,swipeLeft:function(){a.disableTouchSwipe||a.slideRun(-1,!0)},swipeRight:function(){a.disableTouchSwipe||a.slideRun(-2,!0)}})}c(".html5gallery-box-"+this.id, this.$gallery).mousemove(function(){if("mouseover"==a.options.imagetoolboxmode){var c=a.elemArray[a.curElem][9];("always"==a.options.showimagetoolbox||"image"==a.options.showimagetoolbox&&1==c)&&a.showimagetoolbox(c,!0)}});c(".html5gallery-box-"+this.id,this.$gallery).hover(function(){a.onSlideshowOver();if("mouseover"==a.options.imagetoolboxmode){var c=a.elemArray[a.curElem][9];("always"==a.options.showimagetoolbox||"image"==a.options.showimagetoolbox&&1==c)&&a.showimagetoolbox(c)}},function(){"mouseover"== a.options.imagetoolboxmode&&a.hideimagetoolbox()});c(".html5gallery-container-"+this.id).mousemove(function(){a.options.titleoverlay&&a.options.titleautohide&&(c(".html5gallery-title-"+a.id,a.$gallery).show(),clearTimeout(a.hideTitleTimeout),a.hideTitleTimeout=setTimeout(function(){c(".html5gallery-title-"+a.id,a.$gallery).fadeOut()},3E3))});c(".html5gallery-container-"+this.id).hover(function(){a.options.titleoverlay&&a.options.titleautohide&&(c(".html5gallery-title-"+a.id,a.$gallery).fadeIn(),clearTimeout(a.hideTitleTimeout), a.hideTitleTimeout=setTimeout(function(){c(".html5gallery-title-"+a.id,a.$gallery).fadeOut()},3E3))},function(){a.options.titleoverlay&&a.options.titleautohide&&(c(".html5gallery-title-"+a.id,a.$gallery).fadeOut(),clearTimeout(a.hideTitleTimeout))});c(".html5gallery-car-left-"+this.id,this.$gallery).css({"background-position":"-"+String(2*this.options.carouselarrowwidth)+"px 0px",cursor:""});c(".html5gallery-car-left-"+this.id,this.$gallery).data("disabled",!0);c(".html5gallery-car-right-"+this.id, this.$gallery).css({"background-position":"0px 0px"});c(".html5gallery-car-left-"+this.id,this.$gallery).click(function(){c(this).data("disabled")||(a.disableupdatecarousel=!0,a.updateCarouselTimeout=setTimeout(function(){a.enableUpdateCarousel()},a.options.updatecarouselinterval),a.carouselPrev())});c(".html5gallery-car-right-"+this.id,this.$gallery).click(function(){c(this).data("disabled")||(a.disableupdatecarousel=!0,a.updateCarouselTimeout=setTimeout(function(){a.enableUpdateCarousel()},a.options.updatecarouselinterval), a.carouselNext())});c(".html5gallery-car-slider-"+this.id,this.$gallery).bind("drag",function(c,d){a.disableupdatecarousel=!0;a.updateCarouselTimeout=setTimeout(function(){a.enableUpdateCarousel()},a.options.updatecarouselinterval);a.carouselSliderDrag(c,d)});c(".html5gallery-car-slider-bar-"+this.id,this.$gallery).click(function(c){a.disableupdatecarousel=!0;a.updateCarouselTimeout=setTimeout(function(){a.enableUpdateCarousel()},a.options.updatecarouselinterval);a.carouselBarClicked(c)});c(".html5gallery-car-left-"+ this.id,this.$gallery).hover(function(){c(this).data("disabled")||c(this).css({"background-position":"-"+a.options.carouselarrowwidth+"px 0px"})},function(){c(this).data("disabled")||c(this).css({"background-position":"0px 0px"})});c(".html5gallery-car-right-"+this.id,this.$gallery).hover(function(){c(this).data("disabled")||c(this).css({"background-position":"-"+a.options.carouselarrowwidth+"px 0px"})},function(){c(this).data("disabled")||c(this).css({"background-position":"0px 0px"})})},createStyle:function(){switch(this.options.skin){case "vertical":case "showcase":this.createStyleVertical(); break;default:this.createStyleDefault()}},resizeStyleVertical:function(){if(this.container.parent()&&this.container.parent().width()){this.options.containerWidth=this.container.parent().width();this.options.totalWidth=this.options.containerWidth;this.options.showcarousel&&(this.options.carouselWidth="bottom"==this.options.carouselposition?this.options.width:this.options.thumbwidth);"bottom"==this.options.carouselposition?this.options.width=this.options.totalWidth-2*this.options.padding:(this.options.width= this.options.totalWidth-2*this.options.padding,0.html5gallery-tn-title-"+this.id+" {width: "+a+"px;}")}else this.options.carouselWidth=this.options.thumbwidth,this.options.carouselHeight=this.options.height+this.options.headerHeight,this.options.carTop=0,this.options.carBottom=0,this.options.carAreaLength=this.options.carouselHeight-this.options.carTop-this.options.carBottom, this.options.carouselSlider=Math.floor(this.options.carAreaLength/(this.options.thumbheight+this.options.thumbgap))=this.elemArray.length)){a=Math.floor(a/this.options.thumbShowNum)*this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);a>=this.options.thumbTotalHeight-this.options.thumbMaskHeight&&(a=this.options.thumbTotalHeight-this.options.thumbMaskHeight);var b=a/(this.elemArray.length*(this.options.thumbheight+this.options.thumbgap)-this.options.thumbMaskHeight),b=b*(this.options.carouselSliderMax-this.options.carouselSliderMin); c(".html5gallery-car-slider-"+this.id,this.$gallery).stop(!0).animate({top:b},300);c(".html5gallery-thumbs-"+this.id,this.$gallery).stop(!0).animate({marginTop:-1*a},300);this.updateCarouseButtons(-a)}},this.carouselBarClicked=function(a){var b=c(".html5gallery-thumbs-"+this.id,this.$gallery);a.pageY>c(".html5gallery-car-slider-"+this.id,this.$gallery).offset().top?(a=-1*parseInt(b.css("margin-top"))+this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap),a>=this.options.thumbTotalHeight- this.options.thumbMaskHeight&&(a=this.options.thumbTotalHeight-this.options.thumbMaskHeight)):(a=-1*parseInt(b.css("margin-top"))-this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap),0>a&&(a=0));b.stop(!0).animate({marginTop:-a},500);this.updateCarouseButtons(-a);a=a*(this.options.carouselSliderMax-this.options.carouselSliderMin)/(this.elemArray.length*(this.options.thumbheight+this.options.thumbgap)-this.options.thumbMaskHeight);athis.options.carouselSliderMax&&(a=this.options.carouselSliderMax);c(".html5gallery-car-slider-"+this.id,this.$gallery).stop(!0).animate({top:a},500)},this.carouselSliderDrag=function(a,b){var d=b.offsetY-c(".html5gallery-car-slider-bar-"+this.id,this.$gallery).offset().top;dthis.options.carouselSliderMax&&(d=this.options.carouselSliderMax);c(".html5gallery-car-slider-"+this.id,this.$gallery).css({top:d});var e=this.elemArray.length* (this.options.thumbheight+this.options.thumbgap)-this.options.thumbMaskHeight,e=e*d/(this.options.carouselSliderMax-this.options.carouselSliderMin),e=Math.round(e/(this.options.thumbheight+this.options.thumbgap)),e=-1*e*(this.options.thumbheight+this.options.thumbgap);c(".html5gallery-thumbs-"+this.id,this.$gallery).stop(!0).animate({marginTop:e},300)},this.carouselPrev=function(){var a=c(".html5gallery-thumbs-"+this.id,this.$gallery);if(0!=parseInt(a.css("margin-top"))){var b=-1*parseInt(a.css("margin-top"))- this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);0>b&&(b=0);a.animate({marginTop:-b},500,this.options.carouseleasing);this.updateCarouseButtons(-b)}},this.carouselNext=function(){var a=c(".html5gallery-thumbs-"+this.id,this.$gallery);if(parseInt(a.css("margin-top"))!=-(this.options.thumbTotalHeight-this.options.thumbMaskHeight)){var b=-1*parseInt(a.css("margin-top"))+this.options.thumbShowNum*(this.options.thumbheight+this.options.thumbgap);b>=this.options.thumbTotalHeight- this.options.thumbMaskHeight&&(b=this.options.thumbTotalHeight-this.options.thumbMaskHeight);a.animate({marginTop:-b},500,this.options.carouseleasing);this.updateCarouseButtons(-b)}},this.updateCarouseButtons=function(a){var b=c(".html5gallery-car-left-"+this.id,this.$gallery),d=c(".html5gallery-car-right-"+this.id,this.$gallery),e=-1*(this.options.thumbTotalHeight-this.options.thumbMaskHeight);0==a?(b.css({"background-position":"-"+String(2*this.options.carouselarrowwidth)+"px 0px",cursor:""}),b.data("disabled", !0)):b.data("disabled")&&(b.css({"background-position":"0px 0px",cursor:"pointer"}),b.data("disabled",!1));a==e?(d.css({"background-position":"-"+String(2*this.options.carouselarrowwidth)+"px 0px",cursor:""}),d.data("disabled",!0)):d.data("disabled")&&(d.css({"background-position":"0px 0px",cursor:"pointer"}),d.data("disabled",!1))}):b+=" .html5gallery-car-"+this.id+" { display:none; }";b+=".html5gallery-container-"+this.id+" div {box-sizing:content-box;}";c("head").append("")},resizeImageToolbox:function(){if("center"!=this.options.imagetoolboxstyle){var a=Math.round(("bottom"==this.options.headerpos?0:this.options.headerHeight)+this.options.height/2-24),d=a+Math.round(this.options.height/2)-32,b=this.options.width-54,e=this.options.showfullscreenbutton?b-48:b;c(".html5gallery-play-"+this.id).css({top:d+"px",left:e+"px"});c(".html5gallery-pause-"+this.id).css({top:d+"px",left:e+"px"});c(".html5gallery-left-"+this.id).css({top:a+"px"});c(".html5gallery-right-"+ this.id).css({top:a+"px",left:b+"px"});c(".html5gallery-lightbox-"+this.id).css({top:d+"px",left:b+"px"})}},createImageToolbox:function(){1>=this.elemArray.length&&(this.options.showplaybutton=this.options.showprevbutton=this.options.shownextbutton=!1);if("never"!=this.options.showimagetoolbox){var a;if("center"==this.options.imagetoolboxstyle)a=" .html5gallery-toolbox-"+this.id+" {display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; overflow:hidden; position:relative; margin:0px auto; text-align:center; height:40px;}", a+=" .html5gallery-toolbox-bg-"+this.id+" {display:block; left:0px; top:0px; width:100%; height:100%; position:absolute; filter:alpha(opacity=60); opacity:0.6; background-color:#222222; }",a+=" .html5gallery-toolbox-buttons-"+this.id+" {display:block; margin:0px auto; height:100%;}",a+=" .html5gallery-play-"+this.id+" { position:relative; float:left; display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+ Math.round(4)+"px; background:url('"+this.options.skinfolder+"play.png') no-repeat top left; } ",a+=" .html5gallery-pause-"+this.id+" { position:relative; float:left; display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+Math.round(4)+"px; background:url('"+this.options.skinfolder+"pause.png') no-repeat top left; } ",a+=" .html5gallery-left-"+this.id+" { position:relative; float:left; display:"+ ("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+Math.round(4)+"px; background:url('"+this.options.skinfolder+"prev.png') no-repeat top left; } ",a+=" .html5gallery-right-"+this.id+" { position:relative; float:left; display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+ Math.round(4)+"px; background:url('"+this.options.skinfolder+"next.png') no-repeat top left; } ",a+=" .html5gallery-lightbox-"+this.id+" {position:relative; float:left; display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; overflow:hidden; width:32px; height:32px; margin-left:2px; margin-right:2px; margin-top:"+Math.round(4)+"px; background:url('"+this.options.skinfolder+"lightbox.png') no-repeat top left; } ";else{var d=Math.round(("bottom"==this.options.headerpos?0: this.options.headerHeight)+this.options.height/2-24),b=d+Math.round(this.options.height/2)-32,e=this.options.width-54,g=this.options.showfullscreenbutton?e-48:e;a=" .html5gallery-toolbox-"+this.id+" {display:"+("show"==this.options.imagetoolboxmode?"block":"none")+";}";a+=" .html5gallery-toolbox-bg-"+this.id+" {display:none;}";a+=" .html5gallery-toolbox-buttons-"+this.id+" {display:block;}";a+=" .html5gallery-play-"+this.id+" { position:absolute; display:"+("show"==this.options.imagetoolboxmode?"block": "none")+"; cursor:pointer; top:"+b+"px; left:"+g+"px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_play.png') no-repeat top left;} ";a+=" .html5gallery-pause-"+this.id+" { position:absolute; display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; top:"+b+"px; left:"+g+"px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_pause.png') no-repeat top left;} ";a+=" .html5gallery-left-"+this.id+" { position:absolute; display:"+ ("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; top:"+d+"px; left:0px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_prev.png') no-repeat center center;} ";a+=" .html5gallery-right-"+this.id+" { position:absolute; display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; top:"+d+"px; left:"+e+"px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_next.png') no-repeat center center;} ";a+=" .html5gallery-lightbox-"+ this.id+" {position:absolute; display:"+("show"==this.options.imagetoolboxmode?"block":"none")+"; cursor:pointer; top:"+b+"px; left:"+e+"px; width:48px; height:48px; background:url('"+this.options.skinfolder+"side_lightbox.png') no-repeat top left;} "}c(".html5gallery-play-"+this.id,this.$gallery).hover(function(){c(this).css({"background-position":"right top"})},function(){c(this).css({"background-position":"left top"})});c(".html5gallery-pause-"+this.id,this.$gallery).hover(function(){c(this).css({"background-position":"right top"})}, function(){c(this).css({"background-position":"left top"})});c(".html5gallery-left-"+this.id,this.$gallery).hover(function(){c(this).css({"background-position":"right top"})},function(){c(this).css({"background-position":"left top"})});c(".html5gallery-right-"+this.id,this.$gallery).hover(function(){c(this).css({"background-position":"right top"})},function(){c(this).css({"background-position":"left top"})});c(".html5gallery-lightbox-"+this.id,this.$gallery).hover(function(){c(this).css({"background-position":"right top"})}, function(){c(this).css({"background-position":"left top"})});c("head").append("")}this.showimagetoolbox=function(a,b){if(this.options.showplaybutton||this.options.showprevbutton||this.options.shownextbutton||this.options.showfullscreenbutton){var d=this;clearTimeout(d.hideToolboxTimeout);d.hideToolboxTimeout=setTimeout(function(){d.hideimagetoolbox()},3E3);if("center"==this.options.imagetoolboxstyle){var e=Math.round(("bottom"==this.options.headerpos? 0:this.options.headerHeight)+this.options.height/2);if(6==a||7==a||8==a||9==a||10==a||11==a)e+=45;c(".html5gallery-toolbox-"+this.id,this.$gallery).css({top:e});e=0;this.options.showplaybutton&&1==a?(e+=36,this.isPaused?(c(".html5gallery-play-"+this.id,this.$gallery).show(),c(".html5gallery-pause-"+this.id,this.$gallery).hide()):(c(".html5gallery-play-"+this.id,this.$gallery).hide(),c(".html5gallery-pause-"+this.id,this.$gallery).show())):(c(".html5gallery-play-"+this.id,this.$gallery).hide(),c(".html5gallery-pause-"+ this.id,this.$gallery).hide());this.options.showprevbutton?(e+=36,c(".html5gallery-left-"+this.id,this.$gallery).show()):c(".html5gallery-left-"+this.id,this.$gallery).hide();this.options.shownextbutton?(e+=36,c(".html5gallery-right-"+this.id,this.$gallery).show()):c(".html5gallery-right-"+this.id,this.$gallery).hide();this.options.showfullscreenbutton&&1==a?(e+=36,c(".html5gallery-lightbox-"+this.id,this.$gallery).show()):c(".html5gallery-lightbox-"+this.id,this.$gallery).hide();c(".html5gallery-toolbox-"+ this.id,this.$gallery).css({width:e+16});c(".html5gallery-toolbox-buttons-"+this.id,this.$gallery).css({width:e})}else this.options.showplaybutton&&1==a?this.isPaused?(c(".html5gallery-play-"+this.id,this.$gallery).show(),c(".html5gallery-pause-"+this.id,this.$gallery).hide()):(c(".html5gallery-play-"+this.id,this.$gallery).hide(),c(".html5gallery-pause-"+this.id,this.$gallery).show()):(c(".html5gallery-play-"+this.id,this.$gallery).hide(),c(".html5gallery-pause-"+this.id,this.$gallery).hide()),this.options.showprevbutton? c(".html5gallery-left-"+this.id,this.$gallery).show():c(".html5gallery-left-"+this.id,this.$gallery).hide(),this.options.shownextbutton?c(".html5gallery-right-"+this.id,this.$gallery).show():c(".html5gallery-right-"+this.id,this.$gallery).hide(),this.options.showfullscreenbutton&&1==a?c(".html5gallery-lightbox-"+this.id,this.$gallery).show():c(".html5gallery-lightbox-"+this.id,this.$gallery).hide();this.options.isIE678||b?c(".html5gallery-toolbox-"+this.id,this.$gallery).show():c(".html5gallery-toolbox-"+ this.id,this.$gallery).fadeIn()}};this.hideimagetoolbox=function(){clearTimeout(this.hideToolboxTimeout);this.options.isIE678?c(".html5gallery-toolbox-"+this.id,this.$gallery).hide():c(".html5gallery-toolbox-"+this.id,this.$gallery).fadeOut()}},resizeStyleDefault:function(){if(this.container.parent()&&this.container.parent().width()){this.options.containerWidth=this.container.parent().width();this.options.totalWidth=this.options.containerWidth;this.options.width=this.options.totalWidth-2*this.options.padding; this.options.showcarousel&&(this.options.carouselHeight=this.options.thumbheight+2*this.options.thumbmargin,this.options.carouselmultirows&&(this.options.carouselcolumn=Math.floor(this.options.width/(this.options.thumbwidth+this.options.thumbgap)),1>this.options.carouselcolumn&&(this.options.carouselcolumn=1),this.options.carouselHeight=Math.ceil(this.elemArray.length/this.options.carouselcolumn)*(this.options.thumbheight+this.options.thumbrowgap)));this.options.responsivefullscreen&&0d&&(d=1),d=(this.options.width-d*this.options.thumbwidth-(d-1)*this.options.thumbgap)/2,c(".html5gallery-thumbs-"+ this.id).css({"margin-left":d+"px",width:this.options.width+"px"})):(this.options.thumbMaskWidth>this.options.thumbTotalWidth&&(d=this.options.thumbMaskWidth/2-this.options.thumbTotalWidth/2-this.options.thumbgap/2),c(".html5gallery-thumbs-"+this.id).css({"margin-left":d+"px",width:String(this.elemArray.length*(this.options.thumbwidth+this.options.thumbgap))+"px"})),a=Math.round((this.options.width-a-4)/2-this.options.thumbMaskWidth/2),c(".html5gallery-car-mask-"+this.id).css({left:a+"px",width:this.options.thumbMaskWidth+ "px"}),this.carouselHighlight(this.curElem,!0))}},createStyleDefault:function(){this.options.thumbimagewidth=this.options.thumbwidth-2*this.options.thumbimageborder;this.options.thumbimageheight=this.options.thumbheight-2*this.options.thumbimageborder;this.options.thumbshowtitle&&(this.options.thumbheight+=this.options.thumbtitleheight);this.options.showtitle||(this.options.titleheight=0);if(!this.options.showsocialmedia||!this.options.showfacebooklike&&!this.options.showtwitter&&!this.options.showgoogleplus)this.options.socialheight= 0;this.options.headerHeight=this.options.titleoverlay?this.options.socialheight:this.options.titleheight+this.options.socialheight;this.options.boxWidth=this.options.width;this.options.boxHeight=this.options.height+this.options.headerHeight;this.options.boxLeft=this.options.padding;this.options.boxTop=this.options.padding;this.options.slideshadow&&(this.options.boxLeft-=4,this.options.boxTop-=4);this.options.showcarousel?(this.options.carouselWidth=this.options.width,this.options.carouselHeight=this.options.thumbheight+ 2*this.options.thumbmargin,this.options.carouselLeft=this.options.padding,this.options.carouselTop=this.options.padding+this.options.boxHeight+this.options.carouselmargin,this.options.carouselmultirows&&(this.options.carouselHeight=Math.ceil(this.options.width/(this.options.thumbwidth+this.options.thumbgap))*(this.options.thumbheight+this.options.thumbrowgap))):(this.options.carouselWidth=0,this.options.carouselHeight=0,this.options.carouselLeft=0,this.options.carouselTop=0,this.options.carouselmargin= 0);this.options.totalWidth=this.options.width+2*this.options.padding;this.options.totalHeight=this.options.height+this.options.carouselHeight+this.options.carouselmargin+this.options.headerHeight+2*this.options.padding;this.options.containerWidth=this.options.totalWidth;this.options.containerHeight=this.options.totalHeight;this.options.responsive?(this.options.originalWidth=this.options.width,this.options.originalHeight=this.options.height,this.container.css({"max-width":"100%"})):this.container.css({width:this.options.containerWidth, height:this.options.containerHeight});var a=0,d=0;this.options.elemTop=0;"top"==this.options.headerpos?(d=0,a=this.options.socialheight,this.options.elemTop=this.options.headerHeight):"bottom"==this.options.headerpos&&(this.options.elemTop=0,a=this.options.titleoverlay?this.options.height-this.options.titleheight:this.options.height,d=this.options.titleoverlay?this.options.height:this.options.height+this.options.titleheight);var b=" .html5gallery-container-"+this.id+" { display:block; position:absolute; left:0px; top:0px; width:"+ this.options.totalWidth+"px; height:"+this.options.totalHeight+"px; "+(!this.options.bgimage?"":"background:url('"+this.options.skinfolder+this.options.bgimage+"') center top;")+" background-color:"+this.options.bgcolor+";}";this.options.galleryshadow&&(b+=" .html5gallery-container-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}");var b=b+(" .html5gallery-box-"+this.id+" {display:block; position:absolute; text-align:center; left:"+ this.options.boxLeft+"px; top:"+this.options.boxTop+"px; width:"+this.options.boxWidth+"px; height:"+this.options.boxHeight+"px;}"),e=Math.round(this.options.socialheight/2-12),b=b+(" .html5gallery-title-text-"+this.id+" "+this.options.titlecss+" .html5gallery-title-text-"+this.id+" "+this.options.titlecsslink+" .html5gallery-error-"+this.id+" "+this.options.errorcss),b=b+(" .html5gallery-description-text-"+this.id+" "+this.options.descriptioncss+" .html5gallery-description-text-"+this.id+" "+this.options.descriptioncsslink), b=b+(" .html5gallery-fullscreen-title-"+this.id+""+this.options.lightboxtitlecss+" .html5gallery-fullscreen-title-"+this.id+""+this.options.lightboxtitlelinkcss),b=b+(" .html5gallery-fullscreen-description-"+this.id+""+this.options.lightboxdescriptioncss+" .html5gallery-fullscreen-description-"+this.id+""+this.options.lightboxdescriptionlinkcss),b=b+(" .html5gallery-viral-"+this.id+" {display:block; overflow:hidden; position:absolute; text-align:left; top:"+d+"px; left:0px; width:"+this.options.boxWidth+ "px; height:"+this.options.socialheight+"px; padding-top:"+e+"px;}"),b=b+(" .html5gallery-title-"+this.id+" {display:"+(this.options.titleoverlay&&this.options.titleautohide?"none":"block")+"; overflow:hidden; position:absolute; left:0px; width:"+this.options.boxWidth+"px; "),b=this.options.titleoverlay?"top"==this.options.headerpos?b+"top:0px; height:auto; }":b+"bottom:0px; height:auto; }":b+("top:"+a+"px; height:"+this.options.titleheight+"px; }"),b=b+(" .html5gallery-timer-"+this.id+" {display:block; position:absolute; top:"+ String(this.options.elemTop+this.options.height-2)+"px; left:0px; width:0px; height:2px; background-color:#ccc; filter:alpha(opacity=60); opacity:0.6; }"),b=b+(" .html5gallery-elem-"+this.id+" {display:block; overflow:hidden; position:absolute; top:"+this.options.elemTop+"px; left:0px; width:"+this.options.width+"px; height:"+this.options.height+"px;}");this.options.isIE7||this.options.isIE6?(b+=" .html5gallery-loading-"+this.id+" {display:none; }",b+=" .html5gallery-loading-center-"+this.id+" {display:none; }"): (b+=" .html5gallery-loading-"+this.id+" {display:block; position:absolute; top:4px; right:4px; width:100%; height:100%; background:url('"+this.options.skinfolder+"loading.gif') no-repeat top right;}",b+=" .html5gallery-loading-center-"+this.id+" {display:block; position:absolute; top:0px; left:0px; width:100%; height:100%; background:url('"+this.options.skinfolder+"loading_center.gif') no-repeat center center;}");0a&&(a=1),d=(this.options.width-a*this.options.thumbwidth-(a-1)*this.options.thumbgap)/2,b=b+"}"+(".html5gallery-thumbs-"+this.id+" { position:relative; display:block; margin-left:"+d+"px; width:"+this.options.width+"px; top:0px; }"), b+=" .html5gallery-tn-"+this.id+" { display:block; float:left; margin-left:0px; margin-right:"+this.options.thumbgap+"px; margin-bottom:"+this.options.thumbrowgap+"px; text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+this.options.thumbheight+"px;overflow:hidden;}",this.options.thumbshadow&&(b+=" .html5gallery-tn-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}"),b+=" .html5gallery-tn-selected-"+this.id+ " { display:block; float:left; margin-left:0px; margin-right:"+this.options.thumbgap+"px; margin-bottom:"+this.options.thumbrowgap+"px; text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+this.options.thumbheight+"px;overflow:hidden;}",this.options.thumbshadow&&(b+=" .html5gallery-tn-selected-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}"),b+=" .html5gallery-tn-"+this.id+" {background-color:"+this.options.thumbimagebordercolor+ ";} .html5gallery-tn-"+this.id+" { filter:alpha(opacity="+Math.round(100*this.options.thumbopacity)+"); opacity:"+this.options.thumbopacity+"; } .html5gallery-tn-selected-"+this.id+" { filter:alpha(opacity=100); opacity:1; } ",b+=" .html5gallery-tn-img-"+this.id+" {display:block; overflow:hidden; width:"+String(this.options.thumbimagewidth+2*this.options.thumbimageborder)+"px;height:"+String(this.options.thumbimageheight+2*this.options.thumbimageborder)+"px;}",this.options.thumbunselectedimagebordercolor&& (b+=" .html5gallery-tn-selected-"+this.id+" {background-color:"+this.options.thumbunselectedimagebordercolor+";}"),this.options.thumbshowtitle?(b+=" .html5gallery-tn-title-"+this.id+" {display:block; overflow:hidden; float:top; height:"+this.options.thumbtitleheight+"px;width:"+String(this.options.thumbwidth-2)+"px;line-height:"+this.options.thumbtitleheight+"px;}",b+=" .html5gallery-tn-title-"+this.id+this.options.thumbtitlecss):b+=" .html5gallery-tn-title-"+this.id+" {display:none;}",this.carouselHighlight= function(){}):this.options.showcarousel?(b+=" .html5gallery-car-"+this.id+" { position:absolute; display:block; overflow:hidden; left:"+this.options.carouselLeft+"px; top:"+this.options.carouselTop+"px; width:"+this.options.width+"px; height:"+this.options.carouselHeight+"px;",b=this.options.carouselbgtransparent?b+"background-color:transparent;":b+("border-top:1px solid "+this.options.carouseltopborder+";border-bottom:1px solid "+this.options.carouselbottomborder+";background-color: "+this.options.carouselbgcolorend+ "; background: "+this.options.carouselbgcolorend+" -webkit-gradient(linear, left top, left bottom, from("+this.options.carouselbgcolorstart+"), to("+this.options.carouselbgcolorend+")) no-repeat; background: "+this.options.carouselbgcolorend+" -moz-linear-gradient(top, "+this.options.carouselbgcolorstart+", "+this.options.carouselbgcolorend+") no-repeat; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+", endColorstr="+this.options.carouselbgcolorend+ ") no-repeat; -ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr="+this.options.carouselbgcolorstart+", endColorstr="+this.options.carouselbgcolorend+")' no-repeat;"),this.options.carouselbgimage&&(b+="background:url('"+this.options.skinfolder+this.options.carouselbgimage+"') center top;"),b+="}",a=4,this.options.slideshadow&&(a+=12),b+=" .html5gallery-car-list-"+this.id+" { position:absolute; display:block; overflow:hidden; left:"+a+"px; width:"+String(this.options.width-a-4)+ "px; top:0px; height:"+this.options.carouselHeight+"px; }",this.options.carouselNavButton=!1,Math.floor((this.options.width-a-4)/(this.options.thumbwidth+this.options.thumbgap))this.options.thumbTotalWidth&&(d=this.options.thumbMaskWidth/2-this.options.thumbTotalWidth/2-this.options.thumbgap/2),b+=".html5gallery-thumbs-"+this.id+" { position:relative; display:block; margin-left:"+d+"px; width:"+String(this.elemArray.length*(this.options.thumbwidth+this.options.thumbgap))+"px; top:"+Math.round(this.options.carouselHeight/2-this.options.thumbheight/2)+"px; }",a=Math.round((this.options.width-a-4)/2-this.options.thumbMaskWidth/ 2),b+=" .html5gallery-car-mask-"+this.id+" { position:absolute; display:block; text-align:left; overflow:hidden; left:"+a+"px; width:"+this.options.thumbMaskWidth+"px; top:0px; height:"+this.options.carouselHeight+"px;} ",b+=" .html5gallery-tn-"+this.id+" { display:block; float:left; margin-left:"+Math.floor(this.options.thumbgap/2)+"px; margin-right:"+Math.floor(this.options.thumbgap/2)+"px; text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+this.options.thumbheight+ "px;overflow:hidden;}",this.options.thumbshadow&&(b+=" .html5gallery-tn-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}"),b+=" .html5gallery-tn-selected-"+this.id+" { display:block; float:left; margin-left:"+Math.floor(this.options.thumbgap/2)+"px; margin-right:"+Math.floor(this.options.thumbgap/2)+"px;text-align:center; cursor:pointer; width:"+this.options.thumbwidth+"px;height:"+this.options.thumbheight+"px;overflow:hidden;}", this.options.thumbshadow&&(b+=" .html5gallery-tn-selected-"+this.id+" { -moz-box-shadow: 0px 2px 5px #aaa; -webkit-box-shadow: 0px 2px 5px #aaa; box-shadow: 0px 2px 5px #aaa;}"),b+=" .html5gallery-tn-"+this.id+" {background-color:"+this.options.thumbimagebordercolor+";} .html5gallery-tn-"+this.id+" { filter:alpha(opacity="+Math.round(100*this.options.thumbopacity)+"); opacity:"+this.options.thumbopacity+"; } .html5gallery-tn-selected-"+this.id+" { filter:alpha(opacity=100); opacity:1; } ",b+=" .html5gallery-tn-img-"+ this.id+" {display:block; overflow:hidden; width:"+String(this.options.thumbimagewidth+2*this.options.thumbimageborder)+"px;height:"+String(this.options.thumbimageheight+2*this.options.thumbimageborder)+"px;}",this.options.thumbunselectedimagebordercolor&&(b+=" .html5gallery-tn-selected-"+this.id+" {background-color:"+this.options.thumbunselectedimagebordercolor+";}"),this.options.thumbshowtitle?(b+=" .html5gallery-tn-title-"+this.id+" {display:block; overflow:hidden; float:top; height:"+this.options.thumbtitleheight+ "px;width:"+String(this.options.thumbwidth-2)+"px;line-height:"+this.options.thumbtitleheight+"px;}",b+=" .html5gallery-tn-title-"+this.id+this.options.thumbtitlecss):b+=" .html5gallery-tn-title-"+this.id+" {display:none;}",this.carouselHighlight=function(a,b){c("#html5gallery-tn-"+this.id+"-"+a,this.$gallery).removeClass("html5gallery-tn-"+this.id).addClass("html5gallery-tn-selected-"+this.id);if(this.options.thumbShowNum>=this.elemArray.length)c(".html5gallery-car-left-"+this.id,this.$gallery).css({"background-position":"-"+ String(2*this.options.carouselarrowwidth)+"px 0px",cursor:""}),c(".html5gallery-car-left-"+this.id,this.$gallery).data("disabled",!0),c(".html5gallery-car-right-"+this.id,this.$gallery).css({"background-position":"-"+String(2*this.options.carouselarrowwidth)+"px 0px",cursor:""}),c(".html5gallery-car-right-"+this.id,this.$gallery).data("disabled",!0);else{var d=Math.floor(a/this.options.thumbShowNum)*this.options.thumbShowNum*(this.options.thumbwidth+this.options.thumbgap);d>=this.options.thumbTotalWidth- this.options.thumbMaskWidth+this.options.thumbgap&&(d=this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap);d=-d;b?c(".html5gallery-thumbs-"+this.id,this.$gallery).css({marginLeft:d}):c(".html5gallery-thumbs-"+this.id,this.$gallery).animate({marginLeft:d},500);this.updateCarouseButtons(d)}},this.carouselPrev=function(){var a=c(".html5gallery-thumbs-"+this.id,this.$gallery);if(0!=parseInt(a.css("margin-left"))){var b=-1*parseInt(a.css("margin-left"))-this.options.thumbShowNum* (this.options.thumbwidth+this.options.thumbgap);0>b&&(b=0);a.animate({marginLeft:-b},500,this.options.carouseleasing);this.updateCarouseButtons(-b)}},this.carouselNext=function(){var a=c(".html5gallery-thumbs-"+this.id,this.$gallery);if(parseInt(a.css("margin-left"))!=-(this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap)){var b=-1*parseInt(a.css("margin-left"))+this.options.thumbShowNum*(this.options.thumbwidth+this.options.thumbgap);b>=this.options.thumbTotalWidth-this.options.thumbMaskWidth+ this.options.thumbgap&&(b=this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap);a.animate({marginLeft:-b},500,this.options.carouseleasing);this.updateCarouseButtons(-b)}},this.updateCarouseButtons=function(a){var b=c(".html5gallery-car-left-"+this.id,this.$gallery),d=c(".html5gallery-car-right-"+this.id,this.$gallery),e=-1*(this.options.thumbTotalWidth-this.options.thumbMaskWidth+this.options.thumbgap);0==a?(b.css({"background-position":"-"+String(2*this.options.carouselarrowwidth)+ "px 0px",cursor:""}),b.data("disabled",!0)):b.data("disabled")&&(b.css({"background-position":"0px 0px",cursor:"pointer"}),b.data("disabled",!1));a==e?(d.css({"background-position":"-"+String(2*this.options.carouselarrowwidth)+"px 0px",cursor:""}),d.data("disabled",!0)):d.data("disabled")&&(d.css({"background-position":"0px 0px",cursor:"pointer"}),d.data("disabled",!1))}):b+=" .html5gallery-car-"+this.id+" { display:none; }";b+=".html5gallery-container-"+this.id+" div {box-sizing:content-box;}";c("head").append("")},loadCarousel:function(){var a=this,d=c(".html5gallery-thumbs-"+this.id,this.$gallery);d.empty();for(var b=0;b");e.appendTo(d);this.options.thumblinkintitle||e.unbind("click").click(function(){a.onThumbClick(c(this).data("index"));a.slideRun(c(this).data("index"),!0,!0)});e.hover(function(){a.onThumbOver();c(this).removeClass("html5gallery-tn-"+ a.id).addClass("html5gallery-tn-selected-"+a.id)},function(){c(this).data("index")!==a.curElem&&c(this).removeClass("html5gallery-tn-selected-"+a.id).addClass("html5gallery-tn-"+a.id)});e=new Image;e.data=b;c(e).load(function(){var b=Math.max(a.options.thumbimagewidth/this.width,a.options.thumbimageheight/this.height),e=Math.round(b*this.width),b=Math.round(b*this.height),f=a.options.thumbshowplayonvideo&&1!=a.elemArray[this.data][9]?"
":"";c("#html5gallery-tn-"+a.id+"-"+this.data,d).append("
"+f+"
"+a.elemArray[this.data][7]+(a.options.thumbshowdescription?"
"+a.elemArray[this.data][8]+"":"")+"
");a.options.thumblinkintitle&& c(".html5gallery-tn-img-"+a.id,d).unbind("click").click(function(){a.onThumbClick(c(this).parent().data("index"));a.slideRun(c(this).parent().data("index"),!0,!0)})});e.src=this.elemArray[b][1]}this.options.carouselmultirows&&d.append("
")},goNormal:function(){clearTimeout(this.slideshowTimeout);c(document).unbind("keyup.html5gallery");c(".html5gallery-timer-"+this.id,this.$gallery).css({width:0});clearInterval(this.slideTimer);this.slideTimerCount=0;this.isFullscreen= !1;var a=c(".html5gallery-elem-"+this.id,this.$fullscreen).empty().css({top:this.options.elemTop});c(".html5gallery-box-"+this.id,this.$gallery).prepend(a);this.slideRun(this.curElem);this.$fullscreen.remove();"show"==this.options.imagetoolboxmode?this.showimagetoolbox(this.elemArray[this.curElem][9]):this.hideimagetoolbox()},goFullscreen:function(){this.hideimagetoolbox();clearTimeout(this.slideshowTimeout);c(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).css({width:0});clearInterval(this.slideTimer); this.slideTimerCount=0;this.isFullscreen=!0;this.fullscreenInitial=20;this.fullscreenMargin=this.options.lightboxborder;this.fullscreenBarH=this.options.lightboxtextheight;this.fullscreenOutsideMargin=this.options.lightboxmargin;var a=this.options.isMobile?Math.max(c(window).width(),c(document).width()):c(window).width(),d=this.elemArray[this.curElem][10],b=this.elemArray[this.curElem][11];this.fullscreenWidth=a-2*this.fullscreenMargin-2*this.fullscreenOutsideMargin;var e=window.innerHeight?window.innerHeight: c(window).height();this.fullscreenHeight=e-2*this.fullscreenMargin-this.fullscreenBarH-2*this.fullscreenOutsideMargin;var g=Math.max(e,c(document).height()),j=Math.min(this.fullscreenWidth/d,this.fullscreenHeight/b);1>j&&(d*=j,b*=j);e=c(window).scrollTop()+Math.round((e-(b+2*this.fullscreenMargin+this.fullscreenBarH))/2);this.$fullscreen=c("
");this.$fullscreen.appendTo("body");var f=this;c(window).scroll(function(){var a=c(".html5gallery-fullscreen-box-"+ f.id,f.$fullscreen),b=window.innerHeight?window.innerHeight:c(window).height(),b=c(window).scrollTop()+Math.round((b-a.height())/2);a.css({top:b})});var h=c(".html5gallery-elem-"+this.id,this.$gallery).empty().css({top:0,position:"relative"});c(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).animate({height:b+2*this.fullscreenMargin},"slow",function(){c(this).animate({width:d+2*f.fullscreenMargin},"slow",function(){c(this).animate({height:"+="+f.fullscreenBarH},"slow",function(){c(".html5gallery-fullscreen-elem-wrapper-"+ f.id,f.$fullscreen).prepend(h);f.slideRun(f.curElem)})})});c(".html5gallery-fullscreen-overlay-"+this.id,this.$fullscreen).click(function(){f.goNormal()});c(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).hover(function(){1this.curElem-1?this.elemArray.length-1:this.curElem-1):-1==a?(this.prevElem=this.curElem,this.curElem=this.nextElem,this.nextElem=this.curElem+1>=this.elemArray.length?0:this.curElem+1):0<=a&&(this.curElem=a,this.prevElem=0>this.curElem-1?this.elemArray.length-1:this.curElem-1,this.nextElem=this.curElem+1>=this.elemArray.length?0:this.curElem+1)},showSlideTimer:function(){var a= this.elemArray[this.curElem][16]?this.elemArray[this.curElem][16]:this.options.slideshowinterval;this.slideTimerCount++;this.isFullscreen?c(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).width(Math.round(50*c(".html5gallery-fullscreen-elem-wrapper-"+this.id,this.$fullscreen).width()*(this.slideTimerCount+1)/a)):c(".html5gallery-timer-"+this.id,this.$gallery).width(Math.round(50*this.options.boxWidth*(this.slideTimerCount+1)/a))},setHd:function(a,c){var b=this.elemArray[this.curElem][9], b=this.isHd!=a&&c&&(5==b||6==b||7==b||8==b);this.isHd=a;b&&this.slideRun(this.curElem,!1,!1,!0)},enableUpdateCarousel:function(){this.disableupdatecarousel=!1},slideRun:function(a,d,b,e){clearTimeout(this.slideshowTimeout);this.isFullscreen?c(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).css({width:0}):c(".html5gallery-timer-"+this.id,this.$gallery).css({width:0});clearInterval(this.slideTimer);this.slideTimerCount=0;this.options.showcarousel&&0<=this.curElem&&c("#html5gallery-tn-"+ this.id+"-"+this.curElem,this.$gallery).removeClass("html5gallery-tn-selected-"+this.id).addClass("html5gallery-tn-"+this.id);this.calcIndex(a);this.options.socialurlforeach&&this.createSocialMedia();!this.isFullscreen&&this.options.showcarousel&&(c("#html5gallery-tn-"+this.id+"-"+this.curElem,this.$gallery).removeClass("html5gallery-tn-"+this.id).addClass("html5gallery-tn-selected-"+this.id),!this.options.notupdatecarousel&&!this.disableupdatecarousel&&this.carouselHighlight(this.curElem));if(this.options.showtitle|| this.options.lightboxshowtitle||this.options.lightboxshowdescription){var g=this.elemArray[this.curElem][7];a=this.elemArray[this.curElem][8];this.options.shownumbering&&(g=this.options.numberingformat.replace("%NUM",this.curElem+1).replace("%TOTAL",this.elemArray.length)+" "+g);if(this.isFullscreen){var j="";this.options.lightboxshowtitle&&g&&(j+=g);this.options.lightboxshowdescription&&a&&(j+="
"+a+"
");c(".html5gallery-fullscreen-title-"+ this.id,this.$fullscreen).html(j)}else this.options.showtitle&&(g="
"+g+"
",this.options.showdescription&&a&&(g+="
"+a+"
"),c(".html5gallery-title-"+this.id,this.$gallery).html(g))}a=this.elemArray[this.curElem][9];if(!(0>a)){!this.isFullscreen&&d?"always"==this.options.showimagetoolbox?("mouseover"==this.options.imagetoolboxmode||"show"==this.options.imagetoolboxmode)&&this.showimagetoolbox(a): "image"==this.options.showimagetoolbox&&1!=a&&this.hideimagetoolbox():"show"==this.options.imagetoolboxmode?this.showimagetoolbox(a):this.hideimagetoolbox();this.onChange();d=c(".html5gallery-elem-"+this.id,f);d.find("iframe").each(function(){c(this).attr("src","")});d.find("video").each(function(){c(this).attr("src","")});this.disableTouchSwipe=!1;b=this.options.autoplayvideo||this.options.playvideoonclick&&b||e;var f=this.isFullscreen?this.$fullscreen:this.$gallery;this.showingPoster=!1;(5==a|| 6==a||7==a||8==a||9==a||10==a||11==a)&&!b&&this.elemArray[this.curElem][12]?(this.showingPoster=!0,this.showPoster()):(c(".html5gallery-video-play-"+this.id,f).length&&c(".html5gallery-video-play-"+this.id,f).remove(),1==a?this.showImage():5==a||6==a||7==a||8==a?this.showVideo(b,e):9==a?this.showYoutube(b):10==a?this.showVimeo(b):11==a?this.showEmbedVideo(b):2==a?this.showSWF():12==a&&this.showIframe());this.prevElem in this.elemArray&&1==this.elemArray[this.prevElem][9]&&((new Image).src=this.elemArray[this.prevElem][2]); this.nextElem in this.elemArray&&1==this.elemArray[this.nextElem][9]&&((new Image).src=this.elemArray[this.nextElem][2]);this.prevElem in this.elemArray&&(!this.options.autoplayvideo&&this.elemArray[this.prevElem][12])&&((new Image).src=this.elemArray[this.prevElem][12]);this.nextElem in this.elemArray&&(!this.options.autoplayvideo&&this.elemArray[this.nextElem][12])&&((new Image).src=this.elemArray[this.nextElem][12]);this.curElem==this.elemArray.length-1&&this.looptimes++;var h=this;if((1==a||this.showingPoster)&& !this.isPaused&&1=this.options.loop&&(this.looptimes=0,this.pauseGallery());this.elemArray[this.curElem][5]?(d.css({cursor:"pointer"}),d.unbind("click").bind("click",function(){h.elemArray[h.curElem][6]?window.open(h.elemArray[h.curElem][5],h.elemArray[h.curElem][6]):window.open(h.elemArray[h.curElem][5])})):(d.css({cursor:""}),d.unbind("click"))}},showImage:function(){var a=c(".html5gallery-elem-"+this.id,this.isFullscreen?this.$fullscreen:this.$gallery);$preloading=""===a.html()? c("
").appendTo(a):c("
").appendTo(a);var d=this,b=new Image;c(b).load(function(){$preloading.remove();d.elemArray[d.curElem][10]=this.width;d.elemArray[d.curElem][11]=this.height;var b;d.isFullscreen?(b=Math.min(d.fullscreenWidth/this.width,d.fullscreenHeight/this.height),b=1"+d.options.watermarkcode+"");b=c(".html5gallery-elem-img-"+d.id,a);b.length?(a.prepend(e),a.html5boxTransition(d.id,b,e,{effect:d.options.effect,easing:d.options.easing,duration:d.options.duration, direction:d.curElem>=d.savedElem,slide:d.options.slide},function(){})):a.html(e);d.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Image","Play",d.elemArray[d.curElem][2]])});c(b).error(function(){$preloading.remove();d.isFullscreen&&d.adjustFullscreen(d.options.width,d.options.height);a.html("
The requested content cannot be found
");d.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Image","Error",d.elemArray[d.curElem][2]])});b.src=this.elemArray[this.curElem][2]},adjustFullscreen:function(a,d,b){var e=this.options.isMobile?Math.max(c(window).width(),c(document).width()):c(window).width();this.fullscreenWidth=e-2*this.fullscreenMargin-2*this.fullscreenOutsideMargin;var g=window.innerHeight? window.innerHeight:c(window).height();this.fullscreenHeight=g-2*this.fullscreenMargin-this.fullscreenBarH-2*this.fullscreenOutsideMargin;var j=Math.max(g,c(document).height()),f=Math.min(this.fullscreenWidth/a,this.fullscreenHeight/d);1>f&&(a*=f,d*=f);g=c(window).scrollTop()+Math.round((g-(d+2*this.fullscreenMargin+this.fullscreenBarH))/2);c(".html5gallery-fullscreen-"+this.id).css({width:e+"px",height:j+"px"});c(".html5gallery-fullscreen-title-"+this.id,this.$fullscreen).css({width:a-2*this.fullscreenMargin- 72});b?(c(".html5gallery-fullscreen-box-"+this.id,this.$fullscreen).css({width:a+2*this.fullscreenMargin,height:d+2*this.fullscreenMargin+this.fullscreenBarH,top:g}),c(".html5gallery-fullscreen-elem-"+this.id,this.$fullscreen).css({width:a+2*this.fullscreenMargin,height:d+2*this.fullscreenMargin}),c(".html5gallery-fullscreen-elem-wrapper-"+this.id,this.$fullscreen).css({width:a,height:d}),c(".html5gallery-fullscreen-bar-"+this.id,this.$fullscreen).css({width:a+2*this.fullscreenMargin})):(c(".html5gallery-fullscreen-box-"+ this.id,this.$fullscreen).animate({width:a+2*this.fullscreenMargin,height:d+2*this.fullscreenMargin+this.fullscreenBarH,top:g},"slow"),c(".html5gallery-fullscreen-elem-"+this.id,this.$fullscreen).animate({width:a+2*this.fullscreenMargin,height:d+2*this.fullscreenMargin},"slow"),c(".html5gallery-fullscreen-elem-wrapper-"+this.id,this.$fullscreen).animate({width:a,height:d},"slow"),c(".html5gallery-fullscreen-bar-"+this.id,this.$fullscreen).animate({width:a+2*this.fullscreenMargin},"slow"));c(".html5gallery-fullscreen-next-"+ this.id,this.$fullscreen).css({top:Math.round(d/2)});c(".html5gallery-fullscreen-prev-"+this.id,this.$fullscreen).css({top:Math.round(d/2)});c(".html5gallery-fullscreen-play-"+this.id,this.$fullscreen).css("display",this.isPaused&&1=this.elemArray.length||1!=this.elemArray[this.curElem][9]?"none":"block");c(".html5gallery-elem-"+this.id, this.$fullscreen).css({width:a,height:d});c(".html5gallery-fullscreen-timer-"+this.id,this.$fullscreen).css({top:String(d-4)+"px"});c(".html5gallery-elem-video-"+this.id,this.$fullscreen).css({width:a+"px",height:d+"px"});c(".html5gallery-elem-video-container-"+this.id,this.$fullscreen).css({width:a+"px",height:d+"px"});b=this.options.isIPhone?d-48:d;c(".html5gallery-elem-video-container-"+this.id,this.$fullscreen).find("video").css({width:a+"px",height:b+"px"});c("#html5gallery-elem-video-"+this.id, this.$fullscreen).css({width:a+"px",height:d+"px"});c("#html5gallery-elem-video-"+this.id,this.$fullscreen).attr("width",a);c("#html5gallery-elem-video-"+this.id,this.$fullscreen).attr("height",d);c(".html5gallery-elem-video-"+this.id,this.$fullscreen).find("iframe").attr("width",a);c(".html5gallery-elem-video-"+this.id,this.$fullscreen).find("iframe").attr("height",d);c("#html5gallery-elem-video-"+this.id,this.$fullscreen).find("iframe").attr("width",a);c("#html5gallery-elem-video-"+this.id,this.$fullscreen).find("iframe").attr("height", d)},showPoster:function(){var a=this.isFullscreen?this.$fullscreen:this.$gallery,d=c(".html5gallery-elem-"+this.id,a);$preloading=""===d.html()?c("
").appendTo(d):c("
").appendTo(d);var b=this,e=this.elemArray[this.curElem][10],g=this.elemArray[this.curElem][11],j=new Image;c(j).load(function(){$preloading.remove();var f,j,h;b.isFullscreen?(f=Math.max(e/this.width,g/this.height),f=1"+b.options.watermarkcode+"
");h=c(".html5gallery-elem-img-"+ b.id,d);h.length?(d.prepend(j),d.html5boxTransition(b.id,h,j,{effect:b.options.effect,easing:b.options.easing,duration:b.options.duration,direction:b.curElem>=b.savedElem,slide:b.options.slide},function(){})):d.html(j);c(".html5gallery-video-play-"+b.id,a).length||c("
").appendTo(d).unbind(b.eClick).bind(b.eClick, function(){c(this).remove();clearTimeout(b.slideshowTimeout);c(".html5gallery-timer-"+b.id,b.$gallery).css({width:0});clearInterval(b.slideTimer);b.slideTimerCount=0;b.showingPoster=!1;var a=b.elemArray[b.curElem][9];5==a||6==a||7==a||8==a?b.showVideo(!0):9==a?b.showYoutube(!0):10==a?b.showVimeo(!0):11==a&&b.showEmbedVideo(!0)})});c(j).error(function(){$preloading.remove();b.isFullscreen&&b.adjustFullscreen(b.options.width,b.options.height);d.html("
The requested content cannot be found
");b.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Image","Error",b.elemArray[b.curElem][12]])});j.src=this.elemArray[this.curElem][12]},showVideo:function(a,d){this.disableTouchSwipe=!0;var b=this.isFullscreen?this.$fullscreen:this.$gallery,e=this.elemArray[this.curElem][10],g=this.elemArray[this.curElem][11]; this.isFullscreen?this.adjustFullscreen(e,g):(c(".html5gallery-elem-"+this.id,this.$gallery).css({width:this.options.width,height:this.options.height}),e=this.options.width,g=this.options.height);var j=-1;d&&c(".html5gallery-elem-"+this.id,b).find("video").length&&(j=c(".html5gallery-elem-"+this.id,b).find("video:first").get(0).currentTime);c(".html5gallery-elem-"+this.id,b).html("
"+this.options.watermarkcode);this.isHTML5=!1;if(this.options.isIE678||this.options.isIE9&&this.options.useflashonie9||this.options.isIE10&&this.options.useflashonie10||this.options.isIE11&&this.options.useflashonie11)this.isHTML5=!1;else if(this.options.isMobile)this.isHTML5=!0;else if((this.options.html5player||!this.options.flashInstalled)&&this.options.html5VideoSupported)if(!this.options.isFirefox&& !this.options.isOpera||(this.options.isFirefox||this.options.isOpera)&&(this.elemArray[this.curElem][3]||this.elemArray[this.curElem][4]))this.isHTML5=!0;if(this.isHTML5){var f=this.elemArray[this.curElem][2],h=this.elemArray[this.curElem][13];if(this.options.isFirefox||this.options.isOpera||!f)f=this.elemArray[this.curElem][4]?this.elemArray[this.curElem][4]:this.elemArray[this.curElem][3],h=this.elemArray[this.curElem][15]?this.elemArray[this.curElem][15]:this.elemArray[this.curElem][14];this.embedHTML5Video(c(".html5gallery-elem-video-"+ this.id,b),e,g,f,h,a,j,d)}else j=this.elemArray[this.curElem][2],"/"!=j.charAt(0)&&("http:"!=j.substring(0,5)&&"https:"!=j.substring(0,6))&&(j=this.options.htmlfolder+j),f="",this.elemArray[this.curElem][13]&&(f=this.elemArray[this.curElem][13],"/"!=f.charAt(0)&&("http:"!=f.substring(0,5)&&"https:"!=f.substring(0,6))&&(f=this.options.htmlfolder+f)),this.embedFlash(c(".html5gallery-elem-video-"+this.id,b),"100%","100%",this.options.jsfolder+"html5boxplayer.swf","transparent",{width:e,height:g,hidecontrols:this.options.videohidecontrols? "1":"0",hideplaybutton:"0",videofile:j,hdfile:f,ishd:this.isHd?"1":"0",autoplay:a?"1":"0",errorcss:".html5box-error"+this.options.errorcss,id:this.id});this.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Video","Play",this.elemArray[this.curElem][2]])},showSWF:function(){var a=this.isFullscreen?this.$fullscreen:this.$gallery,d=this.elemArray[this.curElem][10],b=this.elemArray[this.curElem][11];this.isFullscreen?this.adjustFullscreen(d,b):c(".html5gallery-elem-"+this.id, this.$gallery).css({width:this.options.width,height:this.options.height});var e=this.isFullscreen?0:Math.round((this.options.height-b)/2)+(this.options.slideshadow?4:0),g=this.isFullscreen?0:Math.round((this.options.width-d)/2)+(this.options.slideshadow?4:0);c(".html5gallery-elem-"+this.id,a).html("
"+this.options.watermarkcode);this.embedFlash(c(".html5gallery-elem-flash-"+ this.id,a),d,b,this.elemArray[this.curElem][2],"window",{});this.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Flash","Play",this.elemArray[this.curElem][2]])},prepareYoutubeHref:function(a){var c=a.match(/(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/)[2],c=("https:"==document.location.protocol?"https:":"http:")+"//www.youtube.com/embed/"+c;a=this.getYoutubeParams(a);var b=!0,e;for(e in a)b?(c+="?",b=!1):c+="&",c+=e+"="+a[e];return c},getYoutubeParams:function(a){var c= {};if(0>a.indexOf("?"))return c;a=a.substring(a.indexOf("?")+1).split("&");for(var b=0;b
"+this.options.watermarkcode);if(g.match(/\:\/\/.*(dai\.ly)/i))var j= g.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2],g=(g.match(/https\:\/\//i)?"https":"http")+"://www.dailymotion.com/embed/video/"+j;a&&(g=0>g.indexOf("?")?g+"?autoplay=1":g+"&autoplay=1");c("#html5gallery-elem-video-"+this.id,d).html("");this.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Video","Play",this.elemArray[this.curElem][2]])},showYoutube:function(a){var d= this.isFullscreen?this.$fullscreen:this.$gallery,b=this.elemArray[this.curElem][10],e=this.elemArray[this.curElem][11];this.isFullscreen?this.adjustFullscreen(b,e):(c(".html5gallery-elem-"+this.id,this.$gallery).css({width:this.options.width,height:this.options.height}),b=this.options.width,e=this.options.height);var g=this.elemArray[this.curElem][2];c(".html5gallery-elem-"+this.id,d).html("
"+this.options.watermarkcode);var j=this;if(!ASYouTubeIframeAPIReady&&(ASYouTubeTimeout+=100,3E3>ASYouTubeTimeout)){setTimeout(function(){j.showYoutube(a)},100);return}if(ASYouTubeIframeAPIReady&&!this.options.isMobile&&!this.options.isIE6&&!this.options.isIE7){d=this.elemArray[this.curElem][2].match(/(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/)[2]; g=null;a&&(g=function(a){a.target.playVideo()});var f=this.getYoutubeParams(this.elemArray[this.curElem][2]),f=c.extend({html5:1,controls:j.options.videohidecontrols?"0":"1",showinfo:j.options.videohidecontrols?"0":"1",autoplay:a?1:0,rel:0,wmode:"transparent"},f);new YT.Player("html5gallery-elem-video-"+this.id,{width:b,height:e,videoId:d,playerVars:f,events:{onReady:g,onStateChange:function(a){a.data==YT.PlayerState.ENDED&&(j.onVideoEnd(),j.isPaused||j.slideRun(-1))}}})}else g=this.prepareYoutubeHref(g), a&&(g=0>g.indexOf("?")?g+"?autoplay=1":g+"&autoplay=1"),g=0>g.indexOf("?")?g+"?wmode=transparent&rel=0":g+"&wmode=transparent&rel=0",j.options.videohidecontrols&&(g+="&controls=0&showinfo=0"),c("#html5gallery-elem-video-"+this.id,d).html("");this.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Video","Play",this.elemArray[this.curElem][2]])}, showVimeo:function(a){var d=this;if("function"!==typeof $f&&(ASVimeoTimeout+=100,3E3>ASVimeoTimeout)){setTimeout(function(){d.showVimeo(a)},100);return}var b=this.isFullscreen?this.$fullscreen:this.$gallery,e=this.elemArray[this.curElem][10],g=this.elemArray[this.curElem][11];this.isFullscreen?this.adjustFullscreen(e,g):(c(".html5gallery-elem-"+this.id,this.$gallery).css({width:this.options.width,height:this.options.height}),e=this.options.width,g=this.options.height);var j=this.elemArray[this.curElem][2], j=0>j.indexOf("?")?j+"?":j+"&",j=a&&!this.options.isAndroid?j+"autoplay=1":j+"autoplay=0",j=j+("&api=1&player_id=html5gallery_vimeo_"+this.id);c(".html5gallery-elem-"+this.id,b).html("
"+ this.options.watermarkcode);c(".html5gallery-elem-video-"+this.id,b).html("");if("function"===typeof $f&&a&&!this.options.isAndroid){var b=c("#html5gallery_vimeo_"+this.id)[0],f=$f(b),d=this;f.addEvent("ready",function(){f.addEvent("finish",function(){d.onVideoEnd();d.isPaused||d.slideRun(-1)})})}this.options.googleanalyticsaccount&& window._gaq&&window._gaq.push(["_trackEvent","Video","Play",this.elemArray[this.curElem][2]])},showIframe:function(){var a=this.isFullscreen?this.$fullscreen:this.$gallery,d=this.elemArray[this.curElem][10],b=this.elemArray[this.curElem][11];this.isFullscreen?this.adjustFullscreen(d,b):(c(".html5gallery-elem-"+this.id,this.$gallery).css({width:this.options.width,height:this.options.height}),d=this.options.width,b=this.options.height);var e=this.elemArray[this.curElem][2];c(".html5gallery-elem-"+this.id, a).html("
"+this.options.watermarkcode);c(".html5gallery-elem-iframe-"+this.id,a).html(""); this.options.googleanalyticsaccount&&window._gaq&&window._gaq.push(["_trackEvent","Iframe","Play",this.elemArray[this.curElem][2]])},checkType:function(a){return!a?-1:a.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)?1:a.match(/[^\.]\.(swf)\s*$/i)?2:a.match(/[^\.]\.(mp3)\s*$/i)?3:a.match(/[^\.]\.(pdf)\s*$/i)?4:a.match(/\.(flv)(.*)?$/i)?5:a.match(/\.(mp4|m4v)(.*)?$/i)?6:a.match(/\.(ogv|ogg)(.*)?$/i)?7:a.match(/\.(webm)(.*)?$/i)?8:a.match(/\:\/\/.*(youtube\.com)/i)||a.match(/\:\/\/.*(youtu\.be)/i)?9:a.match(/\:\/\/.*(vimeo\.com)/i)? 10:a.match(/\:\/\/.*(dailymotion\.com)/i)||a.match(/\:\/\/.*(dai\.ly)/i)?11:0},onChange:function(){if(this.options.onchange&&window[this.options.onchange]&&"function"==typeof window[this.options.onchange])window[this.options.onchange](this.elemArray[this.curElem].concat([this.id]))},onSlideshowOver:function(){if(this.options.onslideshowover&&window[this.options.onslideshowover]&&"function"==typeof window[this.options.onslideshowover])window[this.options.onslideshowover](this.elemArray[this.curElem])}, onThumbOver:function(){if(this.options.onthumbover&&window[this.options.onthumbover]&&"function"==typeof window[this.options.onthumbover])window[this.options.onthumbover](this.elemArray[this.curElem])},onThumbClick:function(a){if(this.options.onthumbclick&&window[this.options.onthumbclick]&&"function"==typeof window[this.options.onthumbclick])window[this.options.onthumbclick](this.elemArray[a].concat([this.id]));this.options.thumbjumptotop&&(0<=this.options.thumbjumpposition?c(window).scrollTop(this.options.thumbjumpposition): (a=this.container.offset().top,a