-
Notifications
You must be signed in to change notification settings - Fork 1
/
jquery.ddGallery.min.js
11 lines (11 loc) · 38 KB
/
jquery.ddGallery.min.js
1
2
3
4
5
6
7
8
9
10
11
////////////////////////////////////////////////////////////////////////////////////
/*
* jQuery ddGallery v3.6.7.1 :: 2012-05-22
* http://inventurous.net/ddgallery
*
* Copyright (c) 2012, Darren Doyle
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
////////////////////////////////////////////////////////////////////////////////////
window.ddGalleryWaitForYoutube=true;if(typeof(onYouTubePlayerAPIReady)!="function"){function onYouTubePlayerAPIReady(){window.ddGalleryWaitForYoutube=false}}(function($){var galleryTpl,arrowTpl,youtubeLoaded=false,loadYoutubeAPI=function(){var newTag,firstScript;newTag=document.createElement("script");newTag.src="http://www.youtube.com/player_api";newTag.type="text/javascript";firstScript=document.getElementsByTagName("script")[0];firstScript.parentNode.insertBefore(newTag,firstScript)};galleryTpl='<div class="ddGallery-stage-wrapper" style="width:100%; height:100%; position:relative; overflow:hidden;">';galleryTpl+='<div class="ddGallery-stage loading" style="width:100%; height:100%;"></div>';galleryTpl+="</div>";galleryTpl+='<div class="ddGallery-count"></div>';galleryTpl+='<div class="ddGallery-toggles">';galleryTpl+='<a href="javascript:;" class="ddGallery-fullScreen"><div><div></div></div></a>';galleryTpl+='<a href="javascript:;" class="ddGallery-zoom"></a>';galleryTpl+="</div>";galleryTpl+='<div class="ddGallery-controls" style="position:absolute; top:auto; bottom:0; overflow:hidden;">';galleryTpl+='<div class="ddGallery-thumbs-wrapper" style="position:relative; width:auto; height:100%; overflow:hidden">';galleryTpl+='<div class="ddGallery-thumbs" style="position:absolute; top:0; left:0; height:100%;"></div>';galleryTpl+="</div>";galleryTpl+="</div>";galleryTpl+='<div class="ddGallery-dotNav"></div>';galleryTpl+='<div class="ddGallery-caption-wrapper" style="position:absolute; top:auto; bottom:0; overflow:hidden; width:100%; height:0">';galleryTpl+='<div class="ddGallery-caption"></div>';galleryTpl+="</div>";galleryTpl+='<div class="ddGallery-control-tab" style="position:absolute; top:auto; overflow:hidden;"></div>';galleryTpl+='<div class="ddGallery-arrow-wrap ddGallery-arrow-wrap-left" style="position: absolute; display:block; overflow:hidden;">';galleryTpl+='<a class="ddGallery-arrow ddGallery-arrow-left" style="display:block; overflow:hidden;" href="">';galleryTpl+='<span style="position:absolute; width:0; height:0;"></span>';galleryTpl+="</a>";galleryTpl+="</div>";galleryTpl+='<div class="ddGallery-arrow-wrap ddGallery-arrow-wrap-right" style="position: absolute; display:block; overflow:hidden;">';galleryTpl+='<a class="ddGallery-arrow ddGallery-arrow-right" style="display:block; overflow:hidden;" href="">';galleryTpl+='<span style="position:absolute; width:0; height:0;"></span>';galleryTpl+="</a>";galleryTpl+="</div>";$.ddGallery=function(element,options){var dd=this;dd.gal=$(element);dd.settings=$.extend({},$.ddGallery.defaultOptions,options);dd.id="ddGallery-gallery-"+(Math.floor(Math.random()*10000));dd.itemCount=dd.gal.children("a,img,div,iframe").length;dd.hover=false;dd.animating=false;dd.initial=true;dd.initialSpeed=250;dd.curItem=0;dd.youtubePlayers=[];dd.imageDimensions=[];dd.videoPlaying=false;dd.pinned=false;dd.autopinned=false;dd.userPlay=false;dd.paused=false;dd.touched=false;dd.fullScreen=false;dd.navSource="";dd.resizer={timer:"",cW:dd.gal.width(),cH:dd.gal.height(),wW:$(window).width(),wH:$(window).height()};dd.animList=[];dd.capSizes={heights:{},borders:{t:0,b:0},margins:{t:0,b:0},padding:{t:0,b:0}};dd.debug=$("#ddGallery-debug");dd.draw(dd)};$.ddGallery.defaultOptions={captions:true,externalCaptions:false,captionHideSpeed:250,captionPause:2000,hideCaptions:true,count:false,countType:"total",hideCount:true,pinTab:true,pinned:false,autoPlay:false,arrows:true,hideArrows:true,arrowsHideSpeed:250,startItem:1,keyboard:true,thumbs:true,hideThumbs:true,dotNav:false,dotNavNumbers:false,thumbsHideSpeed:150,thumbsScrollSpeed:350,thumbsNumbers:false,thumbsPush:false,stageRotateType:"fade",stageRotateSpeed:500,stagePause:4000,rotate:true,playlist:false,hoverPause:true,fill:false,enlarge:true,stretch:false,fullScreen:true,thumbsPushOnFull:true,hideThumbsOnFull:false,hideCaptionsOnFull:false,hideCountOnFull:true,hoverPauseOnFull:true,zoom:false,hideZoom:true};$.ddGallery.prototype={draw:function(dd){if(dd.itemCount<=1){dd.settings.thumbs=false;dd.settings.arrows=false;dd.settings.count=false}dd.animList=["fade","pushV","pushH","slideH","slideV","drop","lift"];if($.inArray(dd.settings.stageRotateType,dd.animList)===-1&&dd.settings.stageRotateType!="random"){dd.settings.stageRotateType="fade"}dd.settings.startItem=parseInt(dd.settings.startItem);dd.settings.startItem=(dd.settings.startItem>dd.itemCount)?dd.itemCount:(dd.settings.startItem<1)?1:dd.settings.startItem;if(dd.settings.fill){dd.settings.enlarge=false}if(dd.settings.playlist){dd.userPaused=!dd.settings.autoPlay;dd.settings.autoPlay=false}dd.origCSS=(dd.gal.css("position")=="static")?"relative":dd.gal.css("position");dd.gal.css({position:dd.origCSS}).addClass("ddGallery-main");dd.origBody=$("body").css("overflow");dd.origData=dd.gal.html();dd.orig=$("<div />").html(dd.gal.html());dd.gal.html(galleryTpl).ready(function(){var thumbContent="",dotContent="",itemCounter=1;dd.caption=dd.gal.find(".ddGallery-caption-wrapper");dd.arrows=dd.gal.find(".ddGallery-arrow-wrap");dd.arrowOrig=dd.arrows.width();dd.controls=dd.gal.find(".ddGallery-controls");dd.tab=dd.gal.find(".ddGallery-control-tab");dd.tabB=parseInt(dd.tab.css("bottom"));dd.count=dd.gal.find(".ddGallery-count");dd.stageWrap=dd.gal.find(".ddGallery-stage-wrapper");dd.stage=dd.stageWrap.children(".ddGallery-stage");dd.thumbWrap=dd.gal.find(".ddGallery-thumbs-wrapper");dd.thumbs=dd.thumbWrap.children(".ddGallery-thumbs");dd.zoom=dd.gal.find(".ddGallery-zoom");dd.full=dd.gal.find(".ddGallery-fullScreen");dd.dot=dd.gal.find(".ddGallery-dotNav");dd.mainZ=(dd.gal.css("z-index")=="auto")?0:parseInt(dd.gal.css("z-index"));dd.gal.find(".ddGallery-stage-wrapper").css({"z-index":dd.mainZ});dd.gal.find(".ddGallery-arrows").css({"z-index":dd.mainZ+5});dd.controls.css({"z-index":dd.mainZ+5});dd.tab.css({"z-index":dd.mainZ+5});dd.zoom.parent(".ddGallery-toggles").css({"z-index":dd.mainZ+5});dd.caption.css({"z-index":dd.mainZ+5});if(dd.settings.dotNav){dd.dot.css({display:"block","z-index":dd.mainZ+7})}else{dd.dot.css({display:"none"})}if(dd.settings.arrows){dd.arrows.css({width:0})}else{dd.arrows.css({display:"none"})}if(dd.settings.count){dd.count.css({display:"block","z-index":dd.mainZ+3})}else{dd.count.css({display:"none"})}if(dd.settings.zoom){dd.zoom.css({display:"none",opacity:0})}else{dd.zoom.css({display:"none"})}if(dd.settings.fullScreen){dd.full.css({display:"block",opacity:1})}else{dd.full.css({display:"none"})}if(!dd.settings.pinTab||(!dd.settings.captions&&!dd.settings.thumbs)||((dd.settings.thumbsPush&&!dd.settings.hideThumbs)&&!dd.settings.captions)){dd.tab.css({display:"none"});dd.settings.pinTab=false}else{dd.tab.css({left:Math.floor(dd.stage.width()/2)-Math.floor(dd.tab.outerWidth()/2),top:"auto"})}dd.orig.children("a, img, div, iframe").each(function(){var me=$(this),url="",thumb,cap,numberTag="",linkOut="",linkTarget="",type="img",thumbResize="",sourceId="",sourceClass="",itemId="ddGallery"+(Math.floor(Math.random()*1000000)),kid=me.children("img");href=me.attr("href"),forced=(me.attr("type")==undefined)?"":me.attr("type"),linkType=(href==""||href==undefined)?[,false]:(href.match(/http:\/\/(?:www\.|)(vimeo|youtube)\.com(?:.*)((?:\/)([a-zA-Z0-9-_]+)(?:$|&|\?)|((?:[0-9]\/)|(?:embed\/)|(?:v\/)|(?:v=))([a-zA-Z0-9-_\#\=]+)(?:$|&|\?))/i)||href.match(/.*(?=\.(jpg|jpeg|gif|png)(?:$|\?))/i)||[,false]);if(me.is("a")||me.is("img")){if(me.is("img")||((!linkType[1]||forced=="link")&&forced!="image")){if(me.is("a")){type="clickable";linkOut=me.attr("href");linkTarget=(me.attr("target")==undefined)?"":me.attr("target");me=kid}url=me.attr("src"),thumb=me.attr("src"),cap=me.attr("alt");thumbResize=";background-repeat:no-repeat round;background-size:auto 100%;"}else{if((linkType[1]=="jpg"||linkType[1]=="jpeg"||linkType[1]=="gif"||linkType[1]=="png")||forced=="image"){url=me.attr("href"),thumb=kid.attr("src"),cap=me.children("img").attr("alt")}else{if(linkType[1]=="youtube"){url="?"+linkType[5];me.addClass(url);cap=me.attr("title");type="youtube";thumb="http://img.youtube.com/vi/"+linkType[5]+"/2.jpg";if(!youtubeLoaded){loadYoutubeAPI();youtubeLoaded=true}window.ddGalleryWaitForYoutube=(window.ddGalleryWaitForYoutube===undefined||window.ddGalleryWaitForYoutube===true)?true:false}else{if(linkType[1]=="vimeo"){url="http://player.vimeo.com/video/"+linkType[3]+"?api=1&player_id="+itemId;me.addClass(url);cap=me.attr("title");type="vimeo";$.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+linkType[3]+".json",jsonp:"callback",dataType:"jsonp",success:function(data){dd.thumbs.find('a[itemId="'+itemId+'"]').css("background-image","url("+data[0]["thumbnail_small"]+")")}})}}}}}else{if(me.is("div")){sourceClass=me.attr("class");sourceId=me.attr("id");me.addClass(itemId);thumb=me.attr("thumb");cap=me.attr("title");type="div"}else{if(me.is("iframe")){sourceClass=me.attr("class");sourceId=me.attr("id");url=me.attr("src");me.addClass(url);thumb=me.attr("thumb");cap=me.attr("title");type="iframe"}}}sourceClass=(sourceClass==undefined)?"":sourceClass;sourceId=(sourceId==undefined)?"":sourceId;cap=(cap==undefined||cap==null||cap==""||cap==" ")?" ":cap;thumb=(thumb==undefined)?"":";background-image:url("+thumb+")";numberTag=(dd.settings.thumbsNumbers)?'<span class="ddGallery-number">'+itemCounter+"</span>":"";thumbContent+='<a href="'+url+'" itemId="'+itemId+'" sourceId="'+sourceId+'" sourceClass="'+sourceClass+'" class="'+type+'" style="position:relative;display:block;float:left'+thumb+thumbResize+'" title="'+cap+'" linkOut="'+linkOut+'" linkTarget="'+linkTarget+'">'+numberTag+'<span class="ddGallery-watermark"></span></a>';if(dd.settings.dotNav){dotContent+='<a href="javascript:;" itemId="'+itemId+'" class="'+((dd.settings.dotNavNumbers)?"number":"dot")+'">'+((dd.settings.dotNavNumbers)?itemCounter:"")+"</a>"}if(dd.settings.captions){if(cap==" "){dd.capSizes.heights[itemId]=0}else{dd.caption.children(".ddGallery-caption").html(cap);dd.capSizes.heights[itemId]=dd.caption.children(".ddGallery-caption").outerHeight()}}itemCounter++});dd.dot.html(dotContent);dd.thumbs.append(thumbContent).ready(function(){if(dd.settings.thumbs){dd.thumbW=dd.thumbs.children("a:first-child").outerWidth(true);dd.thumbH=dd.thumbs.children("a:first-child").outerHeight(true);dd.controlH=dd.thumbH;dd.caption.css({bottom:dd.controlH})}else{dd.controls.css({display:"none"});dd.controlH=0;dd.caption.css({bottom:0})}dd.positionArrows();if(dd.settings.thumbs){dd.controlH=dd.controls.css({width:"100%",height:dd.controlH}).outerHeight();dd.thumbs.css({width:(dd.thumbW*dd.itemCount)});dd.maxScroll=dd.thumbWrap.outerWidth()-dd.thumbs.outerWidth()}dd.stageWrap.height((dd.settings.thumbsPush||(dd.settings.thumbsPushOnFull&&dd.fullScreen))?dd.gal.height()-dd.controlH:dd.gal.height());dd.gal.ready(function(){dd.gal.find(".ddGallery-thumbs a:nth-child("+dd.settings.startItem+")").click();if(!dd.settings.hideArrows){dd.arrows.css({width:dd.arrowOrig})}if(dd.settings.hideThumbs){dd.controls.css({height:0})}if(dd.settings.captions){dd.caption.css({height:0,bottom:((dd.settings.hideThumbs||!dd.settings.thumbs)?0:dd.controlH)}).addClass("collapsed")}if(dd.settings.pinTab){dd.tab.css({bottom:dd.tabB+((!dd.settings.thumbs||dd.settings.hideThumbs)?0:dd.controlH)})}if(dd.settings.pinned&&dd.settings.pinTab){dd.tab.mouseup()}dd.gal.on("mousemove",function(){dd.gal.mouseenter();dd.gal.off("mousemove")})})});dd.gal.find(".ddGallery-thumbs a").on("click",function(e){e.preventDefault();var thisThumb=$(this),type=thisThumb.attr("class"),typeFrom=dd.thumbs.children("a:nth-child("+dd.curItem+")").attr("class"),url=thisThumb.attr("href"),url=(type=="youtube")?url.match(/\?(.*)/i)[1]:url,itemId=thisThumb.attr("itemId"),cap=thisThumb.attr("title"),sourceId=thisThumb.attr("sourceId"),sourceClass=thisThumb.attr("sourceClass"),linkOut=thisThumb.attr("linkOut"),linkTarget=thisThumb.attr("linkTarget"),tL=parseInt(dd.thumbs.css("left")),thumbL=parseInt(thisThumb.position().left)-(parseInt(thisThumb.css("border-left-width")))-(parseInt(thisThumb.css("margin-left"))),anim=dd.settings.stageRotateType,newLeft,wW,isLast=false,dir=(dd.curItem==1&&($(this).index()+1)==dd.itemCount&&dd.itemCount>2&&dd.navSource!="")?false:(dd.curItem==dd.itemCount&&($(this).index()+1)==1&&dd.navSource!="")?true:(dd.curItem<($(this).index()+1));if(dd.settings.stageRotateType=="random"){anim=dd.animList[parseInt(Math.random()*dd.animList.length)]}dd.stageWrap.height((dd.settings.thumbsPush||(dd.settings.thumbsPushOnFull&&dd.fullScreen))?dd.gal.height()-dd.controlH:dd.gal.height());dd.curItem=$(this).index()+1;isLast=dd.curItem==dd.itemCount;if(dd.navSource=="left"&&dd.itemCount<3){dir=!dir}dd.navSource="";if(type=="youtube"&&window.ddGalleryWaitForYoutube){setTimeout(function(){thisThumb.click()},0);return}if(!($(this).is(".selected")||dd.animating)){cap=(cap=="undefined")?"":cap;dd.animating=true;dd.stage.stop(1,0);dd.caption.stop(1,0);dd.stage.find(".ddGallery-youtube-wrapper").each(function(){dd.autoPause=true;try{dd.youtubePlayers[$(this).attr("id")].pauseVideo()}catch(err){}});if(dd.autopinned){dd.tab.mouseup()}clearTimeout(dd.rotator);clearTimeout(dd.captionDelay);thisThumb.siblings("a").removeClass("selected");thisThumb.addClass("selected");dd.dot.children("a").removeClass("selected");dd.dot.children('a[itemId="'+itemId+'"]').addClass("selected");dd.stage.addClass("loading");if(dd.stage.find(".selected").length>0){eval("dd.animOut_"+anim+'(dd.stage.find(".selected"),type,typeFrom,dir);')}if(dd.stage.find("#"+itemId).length===0){switch(type){case"img":dd.stage.append('<img src="'+url+'" class="ddGallery-item" id="'+itemId+'" alt="'+cap+'" style="opacity:0;position:absolute;" />');dd.stage.children("#"+itemId).load(function(){dd.stage.removeClass("loading");dd.stage.find("#"+itemId).addClass("selected");dd.setImageDimensions(dd.stage.children("#"+itemId),typeFrom,dir,"in",anim)});break;case"clickable":dd.stage.append('<a href="'+linkOut+'" target="'+linkTarget+'"><img id="'+itemId+'" src="'+url+'" class="ddGallery-item" alt="'+cap+'" style="opacity:0;position:absolute;" /></a>');dd.stage.find("#"+itemId).load(function(){dd.stage.removeClass("loading");dd.stage.find("#"+itemId).addClass("selected");dd.setImageDimensions(dd.stage.find("#"+itemId),typeFrom,dir,"in",anim)});break;case"div":dd.showZoom(false,dd.settings.stageRotateSpeed);dd.stage.append('<div class="ddGallery-div-wrapper ddGallery-item" id="'+itemId+'" style="opacity:0;position:absolute;width:100%;height:100%;overflow:auto"><div class="'+sourceClass+'" id="'+sourceId+'">'+dd.orig.find("."+itemId).html()+"</div></div>").ready(function(){dd.stage.removeClass("loading");dd.stage.find("#"+itemId).addClass("selected");eval("dd.animIn_"+anim+'(dd.gal.find("#"+itemId),type,typeFrom,dir);')});break;case"iframe":dd.showZoom(false,dd.settings.stageRotateSpeed);dd.stage.append('<div class="ddGallery-iframe-wrapper ddGallery-item" style="opacity:0;position:absolute;width:100%;height:100%;overflow:auto" id="'+itemId+'"><iframe allowfullscreen scrolling="auto" style="border:none;width:100%;height:100%;margin-bottom:-5px;" class="'+sourceClass+'" id="'+sourceId+'" src="'+url+'"></iframe></div>').ready(function(){dd.stage.removeClass("loading");dd.stage.find("#"+itemId).addClass("selected");eval("dd.animIn_"+anim+'(dd.gal.find("#"+itemId),type,typeFrom,dir);')});break;case"youtube":dd.showZoom(false,dd.settings.stageRotateSpeed);dd.stage.append('<div class="ddGallery-youtube-wrapper ddGallery-item" style="opacity:0;position:absolute;width:100%;height:100%;overflow:hidden" id="'+itemId+'"><div id="'+itemId+'-video"></div></div>').ready(function(){dd.stage.removeClass("loading");dd.stage.find("#"+itemId).addClass("selected");eval("dd.animIn_"+anim+'(dd.gal.find("#"+itemId),type,typeFrom,dir);');dd.youtubePlayers[itemId]=new window.YT.Player(itemId+"-video",{height:"100%",width:"100%",videoId:url,playerVars:{wmode:"opaque"},events:{onReady:function(event){dd.animating=false;if(dd.settings.autoPlay||(dd.settings.playlist&&!dd.userPaused)){event.target.playVideo()}},onStateChange:function(event){switch(event.data){case window.YT.PlayerState.BUFFERING:case window.YT.PlayerState.PLAYING:clearTimeout(dd.rotator);clearTimeout(dd.youtubeDelay);dd.youtubeDelay=false;dd.videoPlaying=true;dd.userPaused=false;if(!dd.pinned){dd.tab.mouseup();dd.autopinned=true}break;case window.YT.PlayerState.PAUSED:if(!dd.autoPause){dd.userPaused=true}dd.autoPause=false;if(!dd.youtubeDelay){dd.youtubeDelay=setTimeout(function(){dd.videoPlaying=false;if(dd.pinned&&dd.autopinned){dd.tab.mouseup()}if((dd.settings.rotate||dd.userPlay)&&(!dd.hover||(!dd.fullScreen&&!dd.settings.hoverPause)||(dd.fullScreen&&!dd.settings.hoverPauseOnFull))&&!dd.settings.playlist&&!dd.paused){clearTimeout(dd.rotator);dd.rotator=setTimeout(function(){dd.navSource="auto";dd.rotateItems(true)},dd.settings.stagePause)}},300)}break;case window.YT.PlayerState.ENDED:if(dd.settings.playlist&&!isLast&&!dd.paused){dd.userPaused=false;event.target.seekTo(0,true);dd.navSource="auto";dd.rotateItems(true)}else{if(!dd.youtubeDelay){dd.youtubeDelay=setTimeout(function(){dd.videoPlaying=false;if(dd.pinned&&dd.autopinned){dd.tab.mouseup()}if((dd.settings.rotate||dd.userPlay)&&(!dd.hover||(!dd.fullScreen&&!dd.settings.hoverPause)||(dd.fullScreen&&!dd.settings.hoverPauseOnFull))&&!dd.paused){clearTimeout(dd.rotator);dd.rotator=setTimeout(function(){dd.navSource="auto";dd.rotateItems(true)},dd.settings.stagePause)}},300)}}break}}}})});break;case"vimeo":dd.stage.append('<div class="ddGallery-vimeo-wrapper" style="opacity:0;position:absolute;width:100%;height:100%;overflow:hidden" id="'+itemId+'"><iframe allowfullscreen scrolling="auto" style="border:none;width:100%;height:100%;margin-bottom:-5px;" class="'+sourceClass+'" id="'+sourceId+'" src="'+url+'"></div></div>').ready(function(){dd.stage.removeClass("loading");dd.stage.find("#"+itemId).addClass("selected");eval("dd.animIn_"+anim+'(dd.gal.find("#"+itemId),type,typeFrom,dir);')});break}}else{dd.stage.find("#"+itemId).addClass("selected");if(type=="img"){dd.stage.removeClass("loading");dd.setImageDimensions(dd.stage.children("#"+itemId),typeFrom,dir,"in",anim)}else{if(type=="clickable"){dd.stage.removeClass("loading");dd.setImageDimensions(dd.stage.find("#"+itemId),typeFrom,dir,"in",anim)}else{dd.showZoom(false,dd.settings.stageRotateSpeed);dd.stage.removeClass("loading");eval("dd.animIn_"+anim+'(dd.gal.find("#"+itemId),type,typeFrom,dir);');if(dd.settings.playlist&&!dd.userPaused){dd.youtubePlayers[itemId].seekTo(0,true);dd.youtubePlayers[itemId].playVideo()}}}}if(dd.settings.count){switch(dd.settings.countType){case"total":dd.count.html(dd.itemCount);break;case"paged":dd.count.html(dd.curItem+" of "+dd.itemCount);break}}if(dd.settings.externalCaptions){$(dd.settings.externalCaptions).html('<span class="ddGallery-externalCaptions">'+cap+"</span>")}dd.caption.attr("itemId",itemId).children(".ddGallery-caption").stop(1,0).animate({opacity:0},dd.settings.captionHideSpeed/2,function(){var obj=$(this);obj.html(cap).ready(function(){var showCon=false;showCap=false;if(!dd.pinned){if(dd.settings.thumbs&&((!dd.settings.hideThumbs||dd.hover)||(!dd.settings.hideThumbsOnFull&&dd.fullScreen))){showCon=true}if(dd.settings.captions&&cap){showCap=true}dd.moveControls(showCon,showCap,dd.settings.stageRotateSpeed)}$.when(dd.caption).done(function(){obj.animate({opacity:1},(dd.settings.captionHideSpeed/2))});if(showCap){dd.captionTimer(showCon)}})})}if(dd.settings.thumbs){wW=dd.thumbWrap.width();if((thumbL+dd.thumbW+tL)>wW){newLeft=wW-(thumbL+dd.thumbW+parseInt(dd.thumbs.css("padding-left")));newLeft=(newLeft<dd.maxScroll)?dd.maxScroll:(newLeft>0)?0:newLeft;dd.thumbs.stop(1,0).animate({left:newLeft},dd.settings.thumbsScrollSpeed)}else{if((thumbL+tL)<0){newLeft=0-thumbL;dd.thumbs.stop(1,0).animate({left:newLeft},dd.settings.thumbsScrollSpeed)}}}});dd.dot.children("a").on("click",function(){dd.thumbs.children('a[itemId="'+$(this).attr("itemId")+'"]').click()});dd.gal.on("click",".ddGallery-arrow-left",function(e){e.preventDefault();dd.navSource="left";dd.rotateItems(false)});dd.gal.on("click",".ddGallery-arrow-right",function(e){e.preventDefault();dd.navSource="right";dd.rotateItems(true)});if(dd.settings.keyboard){$(document).on("keydown."+dd.id,function(e){switch(e.keyCode){case 37:dd.navSource="left";dd.rotateItems(false);break;case 39:dd.navSource="right";dd.rotateItems(true);break;case 27:if(dd.fullScreen){dd.full.click()}break}})}dd.gal.on("mouseenter",function(){var con=false,rs=false;dd.hover=true;if((!dd.fullScreen&&dd.settings.hoverPause)||(dd.fullScreen&&dd.settings.hoverPauseOnFull)){clearTimeout(dd.rotator)}if(dd.captionDelay){clearTimeout(dd.captionDelay)}if(dd.settings.arrows){dd.arrows.stop(1,0).animate({width:dd.arrowOrig},dd.settings.arrowsHideSpeed)}if(dd.settings.count&&(dd.settings.hideCount||(dd.settings.hideCountOnFull&&dd.fullScreen))){dd.count.stop(1,0).animate({opacity:0},dd.settings.thumbsHideSpeed)}if(dd.thumbs.find(".selected").is(".img, .clickable")){try{rs=dd.imageDimensions[dd.thumbs.find(".selected").attr("itemId")].o.z}catch(err){}}if(dd.settings.zoom&&dd.settings.hideZoom&&rs){dd.showZoom(true,dd.settings.thumbsHideSpeed)}if(!dd.pinned){if(dd.settings.thumbs){con=true}dd.moveControls(con,true,dd.settings.thumbsHideSpeed)}});dd.gal.on("mouseleave",function(){var con=false;dd.hover=false;if((dd.settings.rotate||dd.userPlay)&&((!dd.fullScreen&&dd.settings.hoverPause)||(dd.fullScreen&&dd.settings.hoverPauseOnFull))&&!dd.videoPlaying&&!dd.paused){clearTimeout(dd.rotator);dd.rotator=setTimeout(function(){dd.navSource="auto";dd.rotateItems(true)},dd.settings.stagePause)}if(dd.settings.arrows&&dd.settings.hideArrows){dd.arrows.stop(1,0).animate({width:0},dd.settings.arrowsHideSpeed)}if(dd.settings.count&&(dd.settings.hideCount&&!(dd.settings.hideCountOnFull&&dd.fullScreen))){dd.count.stop(1,0).animate({opacity:1},dd.settings.thumbsHideSpeed)}if(dd.settings.zoom&&dd.settings.hideZoom){dd.showZoom(false,dd.settings.thumbsHideSpeed)}if(!dd.pinned){if(dd.settings.thumbs&&((!dd.fullScreen&&!dd.settings.hideThumbs)||(dd.fullScreen&&!dd.settings.hideThumbsOnFull))){con=true}dd.moveControls(con,true,dd.settings.thumbsHideSpeed)}dd.captionTimer(con)});dd.thumbWrap.on("mouseover",function(){var pad=50,wX=dd.thumbWrap.offset().left,wW=dd.thumbWrap.width();wX+=pad;wW-=(pad*2);if(dd.maxScroll<0){dd.thumbWrap.on("mousemove",function(e){var x=e.pageX-wX;nL=Math.ceil((x/wW)*dd.maxScroll);nL=(nL<dd.maxScroll)?dd.maxScroll:(nL>0)?0:nL;dd.thumbs.css({left:nL})})}});dd.gal.on("mouseenter",function(){dd.thumbWrap.off("mousemove")});dd.stage.on("touchend",function(){if(dd.zoom.is(".active")){}else{clearTimeout(dd.touchy);if(dd.touched){dd.touched=false;dd.gal.mouseleave()}else{dd.touched=true;dd.gal.mouseenter();dd.touchy=setTimeout(function(){dd.touched=false;dd.gal.mouseleave()},dd.settings.stagePause/2)}}});if(dd.settings.thumbs){dd.thumbs.on("touchstart",function(event){clearTimeout(dd.touchy);$(document).on("touchmove",function(event){var e=event.originalEvent;e.preventDefault()});var e=event.originalEvent,tStartX=e.touches[0].pageX,nStartL=parseInt(dd.thumbs.css("left"));dd.thumbs.on("touchmove",function(event){var e=event.originalEvent,x=e.touches[0].pageX,nL=nStartL+(x-tStartX);nL=(nL<dd.maxScroll)?dd.maxScroll:(nL>0)?0:nL;dd.thumbs.css({left:nL})})});dd.thumbs.on("touchend",function(event){$(document).off("touchmove");dd.arrowDisplay()})}dd.zoom.on("click",function(e){var image=dd.stage.find(".selected");if(dd.animating||!image.is("img")){return}if(dd.zoom.is(".active")){dd.zoom.removeClass("active");image.off();dd.setImageDimensions(image,"","","unzoom","")}else{dd.zoom.addClass("active");var sW=dd.stage.width(),sH=dd.stage.height(),iW=dd.imageDimensions[image.attr("id")].o.w,iH=dd.imageDimensions[image.attr("id")].o.h,tW=Math.floor(sW*0.6),tH=Math.floor(sH*0.6),tX=Math.floor((sW-tW)/2)+dd.stage.offset().left,tY=Math.floor((sH-tH)/2)+dd.stage.offset().top,x=e.pageX-tX,y=e.pageY-tY;clearTimeout(dd.touchy);x=(e.pageX==undefined)?Math.floor(tW/2):(x>tW)?tW:(x<0)?0:x;y=(e.pageY==undefined)?Math.floor(tH/2):(y>tH)?tH:(y<0)?0:y;image.animate({left:((iW>sW)?(-1*Math.ceil((x/tW)*(iW-sW))):Math.floor((sW-iW)/2)),top:((iH>sH)?(-1*Math.ceil((y/tH)*(iH-sH))):Math.floor((sH-iH)/2)),width:iW,height:iH},dd.settings.thumbsHideSpeed,function(){image.on("mousemove",function(e){var tX=Math.floor((sW-tW)/2)+dd.stage.offset().left,tY=Math.floor((sH-tH)/2)+dd.stage.offset().top,x=e.pageX-tX,y=e.pageY-tY;x=(x>tW)?tW:(x<0)?0:x;y=(y>tH)?tH:(y<0)?0:y;if(iW>sW){image.css({left:-1*Math.ceil((x/tW)*(iW-sW))})}if(iH>sH){image.css({top:-1*Math.ceil((y/tH)*(iH-sH))})}});image.on("touchstart",function(event){clearTimeout(dd.rotator);clearTimeout(dd.touchy);dd.touched=false;dd.gal.mouseleave();$(document).on("touchmove",function(event){var e=event.originalEvent;e.preventDefault()});var e=event.originalEvent,tStartX=e.touches[0].pageX,tStartY=e.touches[0].pageY,iStartL=parseInt(image.css("left")),iStartT=parseInt(image.css("top"));image.on("touchmove",function(event){var e=event.originalEvent,x=e.touches[0].pageX,y=e.touches[0].pageY,nL=iStartL+(x-tStartX),nT=iStartT+(y-tStartY);nL=(nL<((iW-sW)*-1))?((iW-sW)*-1):(nL>0)?0:nL;nT=(nT<((iH-sH)*-1))?((iH-sH)*-1):(nT>0)?0:nT;if(iW>sW){image.css({left:nL})}if(iH>sH){image.css({top:nT})}})});image.on("touchend",function(event){$(document).off("touchmove");dd.touched=true;dd.gal.mouseenter();dd.touchy=setTimeout(function(){dd.touched=false;dd.gal.mouseleave()},dd.settings.stagePause/2)})})}});dd.full.on("click",function(){if(dd.fullScreen){$("body").css({overflow:dd.origBody});dd.full.removeClass("active");if(!dd.settings.fullScreen){dd.showFullScreen(false,dd.settings.thumbsHideSpeed)}dd.fullScreen=false;dd.resizeMe(false)}else{$("body").css({overflow:"hidden"});dd.full.addClass("active");dd.showFullScreen(true,dd.settings.thumbsHideSpeed);dd.fullScreen=true;dd.resizeMe(true);dd.thumbs.css({left:0})}});dd.tab.on("mouseup touchend",function(){var con=false;clearTimeout(dd.tabTouchy);dd.tabTouchy=setTimeout(function(){if(dd.pinned){dd.pinned=false;dd.tab.removeClass("pinned");dd.autopinned=false;if(dd.hover){dd.gal.mouseenter()}else{dd.gal.mouseleave()}}else{dd.pinned=true;dd.tab.addClass("pinned");dd.touched=false;if(dd.settings.thumbs&&((!dd.fullScreen&&dd.settings.thumbsPush&&!dd.settings.hideThumbs)||(dd.fullScreen&&dd.settings.thumbsPushOnFull))){con=true}dd.moveControls(con,false,dd.settings.thumbsHideSpeed)}},100)});dd.resizer.interval=setInterval(function(){var cW=dd.gal.width(),cH=dd.gal.height();if(cW!=dd.resizer.cW||cH!=dd.resizer.cH){dd.resizeMe(dd.fullScreen);dd.resizer.cW=cW;dd.resizer.cH=cH}},500);$(window).on("resize."+dd.id,function(){dd.resizeMe(dd.fullScreen)})})},animFinish:function(item){var dd=this;dd.stage.find("img").off();dd.zoom.removeClass("active");dd.animating=false;if((dd.settings.rotate||dd.userPlay)&&(!dd.hover||(!dd.fullScreen&&!dd.settings.hoverPause)||(dd.fullScreen&&!dd.settings.hoverPauseOnFull))&&!dd.paused){dd.rotator=setTimeout(function(){dd.navSource="auto";dd.rotateItems(true)},dd.settings.stagePause)}dd.initial=false;dd.animRand=-1},animOut_fade:function(item,type,typeFrom,dir){var dd=this;item.stop(1,0).animate({opacity:0},dd.settings.stageRotateSpeed,function(){item.css({display:"none"}).removeClass("selected")})},animIn_fade:function(item,type,typeFrom,dir){var dd=this;item.stop(1,0).css({display:"block",opacity:0}).animate({opacity:1},(dd.initial?dd.initialSpeed:dd.settings.stageRotateSpeed),function(){dd.animFinish(item)})},animOut_pushH:function(item,type,typeFrom,dir){var dd=this,m=dd.stage.width(),nL=(parseInt(item.css("left"))||0);if(dir){m=m*-1}item.stop(1,0).animate({left:nL+m},dd.settings.stageRotateSpeed,function(){item.css({display:"none",left:0}).removeClass("selected")})},animIn_pushH:function(item,type,typeFrom,dir){var dd=this,m=dd.stage.width(),oL=(parseInt(item.css("left"))||0);oL=(oL>m||oL<0)?0:oL;if(!dir){m=m*-1}item.stop(1,0).css({display:"block",opacity:1,left:m}).animate({left:oL},(dd.initial?dd.initialSpeed:dd.settings.stageRotateSpeed),function(){dd.animFinish(item)})},animOut_pushV:function(item,type,typeFrom,dir){var dd=this,m=dd.stage.height(),nT=(parseInt(item.css("top"))||0);if(dir){m=m*-1}item.stop(1,0).animate({top:nT+m},dd.settings.stageRotateSpeed,function(){item.css({display:"none",top:0}).removeClass("selected")})},animIn_pushV:function(item,type,typeFrom,dir){var dd=this,m=dd.stage.height(),oT=(parseInt(item.css("top"))||0);oT=(oT>m||oT<0)?0:oT;if(!dir){m=m*-1}item.stop(1,0).css({display:"block",opacity:1,top:m}).animate({top:oT},(dd.initial?dd.initialSpeed:dd.settings.stageRotateSpeed),function(){dd.animFinish(item)})},animOut_slideH:function(item,type,typeFrom,dir){var dd=this;item.css({"z-index":dd.mainZ});dd.animOut_fade(item,type,typeFrom,dir)},animIn_slideH:function(item,type,typeFrom,dir){var dd=this;item.css({"z-index":dd.mainZ+1});dd.animIn_pushH(item,type,typeFrom,dir)},animOut_slideV:function(item,type,typeFrom,dir){var dd=this;item.css({"z-index":dd.mainZ});dd.animOut_fade(item,type,typeFrom,dir)},animIn_slideV:function(item,type,typeFrom,dir){var dd=this;item.css({"z-index":dd.mainZ+1});dd.animIn_pushV(item,type,typeFrom,dir)},animOut_lift:function(item,type,typeFrom,dir){var dd=this,oW,oH,oL,oT,nW,nH,nL,nT;item.css({"z-index":dd.mainZ+1});if(typeFrom=="img"||typeFrom=="img selected"||typeFrom=="clickable"||typeFrom=="clickable selected"){oW=item.width();oH=item.height();oL=parseInt(item.css("left"));oT=parseInt(item.css("top"));nW=Math.ceil(oW*2);nH=Math.ceil(oH*2);nL=Math.ceil(oL-((nW-oW)/2));nT=Math.ceil(oT-((nH-oH)/2));item.stop(1,0).animate({width:nW,height:nH,left:nL,top:nT,opacity:0},dd.settings.stageRotateSpeed,function(){item.css({width:oW,height:oH,left:oL,top:oT,display:"none"}).removeClass("selected")})}else{dd.animOut_fade(item,type,typeFrom,dir)}},animIn_lift:function(item,type,typeFrom,dir){var dd=this;item.css({"z-index":dd.mainZ});this.animIn_fade(item,type,typeFrom,dir)},animOut_drop:function(item,type,typeFrom,dir){var dd=this;item.css({"z-index":dd.mainZ});dd.animOut_fade(item,type,typeFrom,dir)},animIn_drop:function(item,type,typeFrom,dir){var dd=this,oW,oH,oL,oT,nW,nH,nL,nT;item.css({"z-index":dd.mainZ+1});if(typeFrom=="img"||typeFrom=="img selected"||typeFrom=="clickable"||typeFrom=="clickable selected"){oW=item.width();oH=item.height();oL=parseInt(item.css("left"));oT=parseInt(item.css("top"));nW=Math.ceil(oW*2);nH=Math.ceil(oH*2);nL=Math.ceil(oL-((nW-oW)/2));nT=Math.ceil(oT-((nH-oH)/2));item.stop(1,0).css({display:"block",width:nW,height:nH,left:nL,top:nT,opacity:0}).animate({width:oW,height:oH,left:oL,top:oT,opacity:1},(dd.initial?dd.initialSpeed:dd.settings.stageRotateSpeed),function(){dd.animFinish(item)})}else{dd.animIn_fade(item,type,typeFrom,dir)}},resizeMe:function(full){var dd=this,cur=dd.stage.find(".selected"),fWplus=0,fHplus=0,pinned=dd.pinned;if(pinned){dd.tab.mouseup()}dd.stage.find(".ddGallery-item").stop(1,1);if(full){fWplus+=parseInt(dd.gal.css("border-left-width"))+parseInt(dd.gal.css("padding-left"))+parseInt(dd.gal.css("padding-right"))+parseInt(dd.gal.css("border-right-width"));fHplus+=parseInt(dd.gal.css("border-top-width"))+parseInt(dd.gal.css("padding-top"))+parseInt(dd.gal.css("padding-bottom"))+parseInt(dd.gal.css("border-bottom-width"));dd.gal.css({"z-index":10000,position:"fixed",top:0,left:0,width:$(window).width()-fWplus,height:$(window).height()-fHplus,margin:0}).addClass("fullScreen")}else{dd.gal.css({"z-index":"",position:dd.origCSS,top:"",left:"",width:"",height:"",margin:""}).removeClass("fullScreen")}dd.stageWrap.height((dd.settings.thumbsPush||(dd.settings.thumbsPushOnFull&&dd.fullScreen))?dd.gal.height()-dd.controlH:dd.gal.height());if(dd.settings.pinTab){dd.tab.css({left:Math.floor(dd.stage.width()/2)-Math.floor(dd.tab.outerWidth()/2)})}if(dd.settings.thumbs){dd.maxScroll=dd.thumbWrap.outerWidth()-dd.thumbs.outerWidth()}if(dd.settings.arrows){dd.positionArrows()}if(dd.zoom.is(".active")){dd.zoom.click()}if(cur.is("img")){dd.setImageDimensions(cur,"","","resize","")}},positionArrows:function(){var dd=this,wH,bW,bH,aW,aH,box,top;if(!dd.settings.arrows){dd.arrows.css({display:"none"});return}wH=dd.arrows.height();bW=dd.arrows.children(".ddGallery-arrow").width();bH=dd.arrows.children(".ddGallery-arrow").height();box=Math.floor(((bW>bH)?bH:bW)*0.75);aW=Math.ceil(box*0.6);aH=Math.ceil((aW*1.1)/2);dd.arrows.find("span").css({top:Math.floor((bH/2)-(aH)),left:Math.floor(((bW/2)-(aW/2)-(aW*0.1))),"border-top":"0.53em dashed transparent","border-bottom":"0.53em dashed transparent","border-left-style":"dashed","border-left-width":"0","border-right-style":"solid","border-right-width":aW+"px"});dd.arrows.find(".ddGallery-arrow-right span").css({left:Math.floor(((bW/2)-(aW/2))+(aW*0.1)),"border-right-style":"dashed","border-right-width":"0","border-left-style":"solid","border-left-width":aW+"px"});top=Math.floor((dd.stageWrap.height()/2)-(wH/2));dd.arrows.css({top:top})},setImageDimensions:function(image,typeFrom,dir,target,anim){var dd=this,clickable=false,itemId=image.attr("id"),iW,iH,iR,orig,sW,sR,nW,nH,speed;if(target=="resize"){orig={width:image.css("width"),height:image.css("height"),top:image.css("top"),left:image.css("left")}}image.css({width:"",height:""});iW=image.width();iH=image.height();iR=iW/iH;sW=dd.stage.width();sH=dd.stage.height();sR=sW/sH;dd.imageDimensions[itemId]={o:{w:iW,h:iH,z:((iW>sW)||(iH>sH))},n:{}};if(dd.settings.zoom){dd.zoom.removeClass("active");if(((iH>sH)||(iW>sW))&&(dd.hover||!dd.settings.hideZoom)){dd.showZoom(true,dd.settings.stageRotateSpeed)}else{dd.showZoom(false,dd.settings.stageRotateSpeed)}}if(dd.settings.stretch){iW=sW;iH=sH}else{if(((iH>sH)||(iW>sW))||(((iH<sH)&&(iW<sW))&&dd.settings.enlarge)||dd.settings.fill){if((sR>iR&&dd.settings.enlarge)||(iR>1&&dd.settings.fill)){nH=sH;iW=Math.round(iW*(nH/iH));iH=nH}else{nW=sW;iH=Math.round(iH*(nW/iW));iW=nW}dd.imageDimensions[itemId].n={w:iW,h:iH}}}switch(target){case"in":speed=0;break;case"resize":image.css(orig);speed=0;break;case"unzoom":speed=dd.settings.thumbsHideSpeed;break}image.css({display:"block"}).animate({width:iW,height:iH,left:((sW/2)-(iW/2)),top:((sH/2)-(iH/2))},speed,function(){if(clickable){image=image.parent("a")}if(target=="in"){eval("dd.animIn_"+anim+'(image,"img",typeFrom,dir);')}})},showZoom:function(show,speed){var dd=this,s=((dd.zoom.css("display")=="block")?1:0),o=(show?1:0),d=(show?"block":"none");dd.zoom.css({display:"block",opacity:s}).animate({opacity:o},speed,function(){dd.zoom.css({display:d,opacity:""})})},showFullScreen:function(show,speed){var dd=this,s=((dd.full.css("display")=="block")?1:0),o=(show?1:0),d=(show?"block":"none");dd.full.css({display:"block",opacity:s}).animate({opacity:o},speed,function(){dd.full.css({display:d,opacity:""})})},moveControls:function(con,cap,speed){var dd=this,id=dd.caption.attr("itemId"),child=dd.caption.find(".ddGallery-caption"),conH=0,capH=0;if(con){conH=dd.controlH}dd.controls.stop(1,0).animate({height:conH},speed);if(dd.settings.captions){dd.caption.stop(1,0).css({opacity:1});if(cap&dd.capSizes.heights[id]>0){capH=dd.capSizes.heights[id];child.animate({opacity:1},speed);dd.caption.animate({bottom:conH,height:dd.capSizes.heights[id]},speed).removeClass("collapsed")}else{child.animate({opacity:0},speed);dd.caption.animate({height:0,bottom:conH},speed).addClass("collapsed")}}if(dd.settings.pinTab){dd.tab.stop(1,0).animate({bottom:dd.tabB+conH+capH},speed)}},rotateItems:function(forward){var dd=this,n=dd.curItem;if(forward){n=((n+1)<=dd.itemCount)?n+1:1}else{n=((n-1)>=1)?n-1:dd.itemCount}dd.thumbs.children("a:nth-child("+n+")").click()},captionTimer:function(showControls){var dd=this;if(!dd.pinned&&dd.settings.captions&&((!dd.fullScreen&&dd.settings.hideCaptions&&!dd.hover)||(dd.fullScreen&&dd.settings.hideCaptionsOnFull&&!dd.hover))){clearTimeout(dd.captionDelay);dd.captionDelay=setTimeout(function(){dd.moveControls(showControls,false,dd.settings.captionHideSpeed)},dd.settings.captionPause)}},destroy:function(){var dd=this;dd.gal.off();$(document).off("keydown."+dd.id);$(window).off("resize."+dd.id);clearTimeout(dd.rotator);clearInterval(dd.resizer.timer);dd.gal.find().stop(1,0);$(dd.settings.externalCaptions).html("");dd.gal.html(dd.origData);dd.debug.html("")}};$.fn.ddGallery=function(options,goTo){var control="load",args,extControls=["goTo","togglePlay","play","pause","last","next","fullScreen","zoom","showControls","hideControls","toggleControls","resize"];options=(options==undefined)?{}:options;if((typeof options!=="object")&&$.inArray(options,extControls)>=0){control=options}else{args=(typeof options==="object"||!options)?options:arguments[1]}this.each(function(){var dd=$(this).data("ddGallery");switch(control){case"load":case"reload":case"destroy":if(dd){dd.destroy.apply(dd);$(this).removeData("ddGallery")}if(options!="destroy"){$(this).data("ddGallery",new $.ddGallery(this,args))}break;case"goTo":goTo=(goTo>dd.itemCount)?itemCount:(goTo<1)?1:goTo;dd.thumbs.children("a:nth-child("+goTo+")").click();break;case"next":dd.rotateItems.call(dd,true);break;case"last":dd.rotateItems.call(dd,false);break;case"play":if(dd.paused||(!dd.settings.rotate&&!dd.userPlay)){dd.userPlay=true;dd.paused=false;if((!dd.hover||(!dd.fullScreen&&!dd.settings.hoverPause)||(dd.fullScreen&&!dd.settings.hoverPauseOnFull))){dd.rotator=setTimeout(function(){dd.navSource="auto";dd.rotateItems(true)},dd.settings.stagePause)}}break;case"pause":if(!dd.paused){clearTimeout(dd.rotator);dd.paused=true;dd.userPlay=false}break;case"togglePlay":if(dd.paused||(!dd.settings.rotate&&!dd.userPlay)){if((!dd.hover||(!dd.fullScreen&&!dd.settings.hoverPause)||(dd.fullScreen&&!dd.settings.hoverPauseOnFull))){dd.userPlay=true;dd.paused=false;dd.rotator=setTimeout(function(){dd.navSource="auto";dd.rotateItems(true)},dd.settings.stagePause)}}else{if(!dd.paused){clearTimeout(dd.rotator);dd.paused=true;dd.userPlay=false}}break;case"fullScreen":dd.full.click();break;case"zoom":dd.zoom.click();break;case"hideControls":if(!dd.pinned){dd.tab.mouseup()}break;case"showControls":if(dd.pinned){dd.pinned=false;dd.tab.removeClass("pinned");dd.autopinned=false}dd.moveControls(true,true,dd.settings.thumbsHideSpeed);break;case"toggleControls":if(!dd.pinned){dd.tab.mouseup()}else{dd.pinned=false;dd.tab.removeClass("pinned");dd.autopinned=false;dd.moveControls(true,true,dd.settings.thumbsHideSpeed)}break;case"resize":dd.resizeMe.call(dd,dd.fullScreen);break}});return this}})(jQuery);