diff --git a/Source/jBox.js b/Source/jBox.js
index 4875b18..a2594a3 100644
--- a/Source/jBox.js
+++ b/Source/jBox.js
@@ -396,7 +396,7 @@ function jBox(type, options) {
if (this.options.draggable) {
// Get the handle where jBox will be dragged with
- var handle = (this.options.draggable == 'title') && this.titleContainer ? this.titleContainer : (this.options.draggable.length ? this.options.draggable : this.wrapper);
+ var handle = (this.options.draggable == 'title') && this.titleContainer ? this.titleContainer : ($(this.options.draggable).length ? $(this.options.draggable) : this.wrapper);
// Add mouse events
handle.addClass('jBox-draggable').on('mousedown', function (ev)
diff --git a/Source/jBox.min.js b/Source/jBox.min.js
index a26980a..652c312 100644
--- a/Source/jBox.min.js
+++ b/Source/jBox.min.js
@@ -1,2 +1,2 @@
-function jBox(t,i){return this.options={id:null,width:"auto",height:"auto",minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,responsiveWidth:!0,responsiveHeight:!0,responsiveMinWidth:100,responsiveMinHeight:100,attach:null,trigger:"click",preventDefault:!1,title:null,content:null,getTitle:null,getContent:null,isolateScroll:!0,ajax:{url:null,data:"",reload:!1,getURL:"data-url",getData:"data-ajax",setContent:!0,spinner:!0,spinnerDelay:300,spinnerReposition:!0},target:null,position:{x:"center",y:"center"},outside:null,offset:0,attributes:{x:"left",y:"top"},fixed:!1,adjustPosition:!0,adjustTracker:!1,adjustDistance:5,reposition:!0,repositionOnOpen:!0,repositionOnContent:!0,pointer:!1,pointTo:"target",fade:180,animation:null,transition:!1,theme:"Default",addClass:null,overlay:!1,zIndex:1e4,delayOpen:0,delayClose:0,closeOnEsc:!1,closeOnClick:!1,closeOnMouseleave:!1,closeButton:!1,appendTo:jQuery("body"),createOnInit:!1,blockScroll:!1,draggable:!1,dragOver:!0,autoClose:!1,preloadAudio:!0,audio:null,volume:100,onInit:null,onAttach:null,onPosition:null,onCreated:null,onOpen:null,onClose:null,onCloseComplete:null},this._pluginOptions={Tooltip:{getContent:"title",trigger:"mouseenter",position:{x:"center",y:"top"},outside:"y",pointer:!0},Mouse:{responsiveWidth:!1,responsiveHeight:!1,adjustPosition:"flip",target:"mouse",trigger:"mouseenter",position:{x:"right",y:"bottom"},outside:"xy",offset:5},Modal:{target:jQuery(window),fixed:!0,blockScroll:!0,closeOnEsc:!0,closeOnClick:"overlay",closeButton:"title",overlay:!0,animation:"zoomIn"}},this.options=jQuery.extend(!0,this.options,this._pluginOptions[t]?this._pluginOptions[t]:jBox._pluginOptions[t],i),"string"==jQuery.type(t)&&(this.type=t),this._fireEvent=function(t,i){this.options["_"+t]&&this.options["_"+t].bind(this)(i),this.options[t]&&this.options[t].bind(this)(i)},null===this.options.id&&(this.options.id="jBox"+jBox._getUniqueID()),this.id=this.options.id,("center"==this.options.position.x&&"x"==this.options.outside||"center"==this.options.position.y&&"y"==this.options.outside)&&(this.options.outside=null),"target"==this.options.pointTo&&(!this.options.outside||"xy"==this.options.outside)&&(this.options.pointer=!1),this.options.offset="object"!=jQuery.type(this.options.offset)?{x:this.options.offset,y:this.options.offset}:jQuery.extend({x:0,y:0},this.options.offset),this.options.adjustDistance="object"!=jQuery.type(this.options.adjustDistance)?{top:this.options.adjustDistance,right:this.options.adjustDistance,bottom:this.options.adjustDistance,left:this.options.adjustDistance}:jQuery.extend({top:5,left:5,right:5,bottom:5},this.options.adjustDistance),this.outside=this.options.outside&&"xy"!=this.options.outside?this.options.position[this.options.outside]:!1,this.align=this.outside?this.outside:"center"!=this.options.position.y&&"number"!=jQuery.type(this.options.position.y)?this.options.position.x:"center"!=this.options.position.x&&"number"!=jQuery.type(this.options.position.x)?this.options.position.y:this.options.attributes.x,this._getOpp=function(t){return{left:"right",right:"left",top:"bottom",bottom:"top",x:"y",y:"x"}[t]},this._getXY=function(t){return{left:"x",right:"x",top:"y",bottom:"y",center:"x"}[t]},this._getTL=function(t){return{left:"left",right:"left",top:"top",bottom:"top",center:"left",x:"left",y:"top"}[t]},this._getInt=function(t,i){return"auto"==t?"auto":t&&"string"==jQuery.type(t)&&"%"==t.slice(-1)?jQuery(window)["height"==i?"innerHeight":"innerWidth"]()*parseInt(t.replace("%",""))/100:t},this._createSVG=function(t,i){var o=document.createElementNS("http://www.w3.org/2000/svg",t);return jQuery.each(i,function(t,i){o.setAttribute(i[0],i[1]||"")}),o},this._isolateScroll=function(t){t&&t.length&&t.on("DOMMouseScroll.jBoxIsolateScroll mousewheel.jBoxIsolateScroll",function(i){var o=i.wheelDelta||i.originalEvent&&i.originalEvent.wheelDelta||-i.detail,s=this.scrollTop+t.outerHeight()-this.scrollHeight>=0,e=this.scrollTop<=0;(0>o&&s||o>0&&e)&&i.preventDefault()})},this._create=function(){if(!this.wrapper){if(this.wrapper=jQuery("
",{id:this.id,"class":"jBox-wrapper"+(this.type?" jBox-"+this.type:"")+(this.options.theme?" jBox-"+this.options.theme:"")+(this.options.addClass?" "+this.options.addClass:"")}).css({position:this.options.fixed?"fixed":"absolute",display:"none",opacity:0,zIndex:this.options.zIndex}).data("jBox",this),this.options.closeOnMouseleave&&this.wrapper.on("mouseleave",function(t){!this.source||!(t.relatedTarget==this.source[0]||-1!==jQuery.inArray(this.source[0],jQuery(t.relatedTarget).parents("*")))&&this.close()}.bind(this)),"box"==this.options.closeOnClick&&this.wrapper.on("touchend click",function(){this.close({ignoreDelay:!0})}.bind(this)),this.container=jQuery('').appendTo(this.wrapper),this.content=jQuery('').appendTo(this.container),this.options.isolateScroll&&this._isolateScroll(this.content),this.options.closeButton){var t=this._createSVG("svg",[["viewBox","0 0 24 24"]]);t.appendChild(this._createSVG("path",[["d","M22.2,4c0,0,0.5,0.6,0,1.1l-6.8,6.8l6.9,6.9c0.5,0.5,0,1.1,0,1.1L20,22.3c0,0-0.6,0.5-1.1,0L12,15.4l-6.9,6.9c-0.5,0.5-1.1,0-1.1,0L1.7,20c0,0-0.5-0.6,0-1.1L8.6,12L1.7,5.1C1.2,4.6,1.7,4,1.7,4L4,1.7c0,0,0.6-0.5,1.1,0L12,8.5l6.8-6.8c0.5-0.5,1.1,0,1.1,0L22.2,4z"]])),this.closeButton=jQuery('').on("touchend click",function(){this.close({ignoreDelay:!0})}.bind(this)).append(t),("box"==this.options.closeButton||this.options.closeButton===!0&&!this.options.overlay&&!this.options.title)&&(this.wrapper.addClass("jBox-closeButton-box"),this.closeButton.appendTo(this.container))}if(this.wrapper.appendTo(this.options.appendTo),this.wrapper.find(".jBox-closeButton").length&&jQuery.each(["top","right","bottom","left"],function(t,i){this.wrapper.find(".jBox-closeButton").css(i)&&"auto"!=this.wrapper.find(".jBox-closeButton").css(i)&&(this.options.adjustDistance[i]=Math.max(this.options.adjustDistance[i],this.options.adjustDistance[i]+-1*((parseInt(this.wrapper.find(".jBox-closeButton").css(i))||0)+(parseInt(this.container.css("border-"+i+"-width"))||0))))}.bind(this)),this.options.pointer){if(this.pointer={position:"target"!=this.options.pointTo?this.options.pointTo:this._getOpp(this.outside),xy:this._getXY("target"!=this.options.pointTo?this.options.pointTo:this.outside),align:"center",offset:0},this.pointer.element=jQuery('').appendTo(this.wrapper),this.pointer.dimensions={x:this.pointer.element.outerWidth(),y:this.pointer.element.outerHeight()},"string"==jQuery.type(this.options.pointer)){var i=this.options.pointer.split(":");i[0]&&(this.pointer.align=i[0]),i[1]&&(this.pointer.offset=parseInt(i[1]))}this.pointer.alignAttribute="x"==this.pointer.xy?"bottom"==this.pointer.align?"bottom":"top":"right"==this.pointer.align?"right":"left",this.wrapper.css("padding-"+this.pointer.position,this.pointer.dimensions[this.pointer.xy]),this.pointer.element.css(this.pointer.alignAttribute,"center"==this.pointer.align?"50%":0).css("margin-"+this.pointer.alignAttribute,this.pointer.offset),this.pointer.margin={},this.pointer.margin["margin-"+this.pointer.alignAttribute]=this.pointer.offset,"center"==this.pointer.align&&this.pointer.element.css("transform","translate("+("y"==this.pointer.xy?this.pointer.dimensions.x*-.5+"px":0)+", "+("x"==this.pointer.xy?this.pointer.dimensions.y*-.5+"px":0)+")"),this.pointer.element.css("x"==this.pointer.xy?"width":"height",parseInt(this.pointer.dimensions[this.pointer.xy])+parseInt(this.container.css("border-"+this.pointer.alignAttribute+"-width"))),this.wrapper.addClass("jBox-pointerPosition-"+this.pointer.position)}if(this.setContent(this.options.content,!0),this.setTitle(this.options.title,!0),this.options.draggable){var o="title"==this.options.draggable&&this.titleContainer?this.titleContainer:this.options.draggable.length?this.options.draggable:this.wrapper;o.addClass("jBox-draggable").on("mousedown",function(t){if(2!=t.button&&!jQuery(t.target).hasClass("jBox-noDrag")&&!jQuery(t.target).parents(".jBox-noDrag").length){this.options.dragOver&&this.wrapper.css("zIndex")<=jBox.zIndexMax&&(jBox.zIndexMax+=1,this.wrapper.css("zIndex",jBox.zIndexMax));var i=this.wrapper.outerHeight(),o=this.wrapper.outerWidth(),s=this.wrapper.offset().top+i-t.pageY,e=this.wrapper.offset().left+o-t.pageX;jQuery(document).on("mousemove.jBox-draggable-"+this.id,function(t){this.wrapper.offset({top:t.pageY+s-i,left:t.pageX+e-o})}.bind(this)),t.preventDefault()}}.bind(this)).on("mouseup",function(){jQuery(document).off("mousemove.jBox-draggable-"+this.id)}.bind(this)),jBox.zIndexMax=jBox.zIndexMax?Math.max(jBox.zIndexMax,this.options.zIndex):this.options.zIndex}this._fireEvent("onCreated")}},this.options.createOnInit&&this._create(),this.options.attach&&this.attach(),this._attachEvents=function(){this.options.closeOnEsc&&jQuery(document).on("keyup.jBox-"+this.id,function(t){27==t.keyCode&&this.close({ignoreDelay:!0})}.bind(this)),(this.options.closeOnClick===!0||"body"==this.options.closeOnClick)&&jQuery(document).on("touchend.jBox-"+this.id+" click.jBox-"+this.id,function(t){this.blockBodyClick||"body"==this.options.closeOnClick&&(t.target==this.wrapper[0]||this.wrapper.has(t.target).length)||this.close({ignoreDelay:!0})}.bind(this)),(this.options.adjustPosition||this.options.reposition)&&!this.fixed&&this.outside&&(this.options.adjustTracker&&jQuery(window).on("scroll.jBox-"+this.id,function(){this.position()}.bind(this)),(this.options.adjustPosition||this.options.reposition)&&jQuery(window).on("resize.jBox-"+this.id,function(){this.position()}.bind(this))),"mouse"==this.options.target&&jQuery("body").on("mousemove.jBox-"+this.id,function(t){this.position({mouseTarget:{top:t.pageY,left:t.pageX}})}.bind(this))},this._detachEvents=function(){this.options.closeOnEsc&&jQuery(document).off("keyup.jBox-"+this.id),(this.options.closeOnClick===!0||"body"==this.options.closeOnClick)&&jQuery(document).off("touchend.jBox-"+this.id+" click.jBox-"+this.id),this.options.adjustTracker&&jQuery(window).off("scroll.jBox-"+this.id),(this.options.adjustPosition||this.options.reposition)&&jQuery(window).off("resize.jBox-"+this.id),"mouse"==this.options.target&&jQuery("body").off("mousemove.jBox-"+this.id)},this._showOverlay=function(){this.overlay||(this.overlay=jQuery('').addClass("jBox-overlay"+(this.type?" jBox-overlay-"+this.type:"")).css({display:"none",opacity:0,zIndex:this.options.zIndex-1}).appendTo(this.options.appendTo),("overlay"==this.options.closeButton||this.options.closeButton===!0)&&this.overlay.append(this.closeButton),"overlay"==this.options.closeOnClick&&this.overlay.on("touchend click",function(){this.close({ignoreDelay:!0})}.bind(this)),jQuery("#"+this.id+"-overlay .jBox-closeButton").length&&(this.options.adjustDistance.top=Math.max(jQuery("#"+this.id+"-overlay .jBox-closeButton").outerHeight(),this.options.adjustDistance.top))),"block"!=this.overlay.css("display")&&(this.options.fade?this.overlay.stop()&&this.overlay.animate({opacity:1},{queue:!1,duration:this.options.fade,start:function(){this.overlay.css({display:"block"})}.bind(this)}):this.overlay.css({display:"block",opacity:1}))},this._hideOverlay=function(){this.overlay&&(this.options.fade?this.overlay.stop()&&this.overlay.animate({opacity:0},{queue:!1,duration:this.options.fade,complete:function(){this.overlay.css({display:"none"})}.bind(this)}):this.overlay.css({display:"none",opacity:0}))},this._exposeDimensions=function(){this.wrapper.css({top:-1e4,left:-1e4,right:"auto",bottom:"auto"});var t={x:this.wrapper.outerWidth(),y:this.wrapper.outerHeight()};return this.wrapper.css({top:"auto",left:"auto"}),t},this._setTitleWidth=function(){if(!this.titleContainer)return null;if("none"==this.wrapper.css("display")){this.wrapper.css("display","block");var t=this.content.outerWidth();this.wrapper.css("display","none")}else var t=this.content.outerWidth();this.titleContainer.css({maxWidth:t||null})},this._generateAnimationCSS=function(){"object"!=jQuery.type(this.options.animation)&&(this.options.animation={pulse:{open:"pulse",close:"zoomOut"},zoomIn:{open:"zoomIn",close:"zoomIn"},zoomOut:{open:"zoomOut",close:"zoomOut"},move:{open:"move",close:"move"},slide:{open:"slide",close:"slide"},flip:{open:"flip",close:"flip"},tada:{open:"tada",close:"zoomOut"}}[this.options.animation]),this.options.animation.open&&(this.options.animation.open=this.options.animation.open.split(":")),this.options.animation.close&&(this.options.animation.close=this.options.animation.close.split(":")),this.options.animation.openDirection=this.options.animation.open?this.options.animation.open[1]:null,this.options.animation.closeDirection=this.options.animation.close?this.options.animation.close[1]:null,this.options.animation.open&&(this.options.animation.open=this.options.animation.open[0]),this.options.animation.close&&(this.options.animation.close=this.options.animation.close[0]),this.options.animation.open&&(this.options.animation.open+="Open"),this.options.animation.close&&(this.options.animation.close+="Close");var t={pulse:{duration:350,css:[["0%","scale(1)"],["50%","scale(1.1)"],["100%","scale(1)"]]},zoomInOpen:{duration:this.options.fade||180,css:[["0%","scale(0.9)"],["100%","scale(1)"]]},zoomInClose:{duration:this.options.fade||180,css:[["0%","scale(1)"],["100%","scale(0.9)"]]},zoomOutOpen:{duration:this.options.fade||180,css:[["0%","scale(1.1)"],["100%","scale(1)"]]},zoomOutClose:{duration:this.options.fade||180,css:[["0%","scale(1)"],["100%","scale(1.1)"]]},moveOpen:{duration:this.options.fade||180,positions:{top:{"0%":-12},right:{"0%":12},bottom:{"0%":12},left:{"0%":-12}},css:[["0%","translate%XY(%Vpx)"],["100%","translate%XY(0px)"]]},moveClose:{duration:this.options.fade||180,timing:"ease-in",positions:{top:{"100%":-12},right:{"100%":12},bottom:{"100%":12},left:{"100%":-12}},css:[["0%","translate%XY(0px)"],["100%","translate%XY(%Vpx)"]]},slideOpen:{duration:400,positions:{top:{"0%":-400},right:{"0%":400},bottom:{"0%":400},left:{"0%":-400}},css:[["0%","translate%XY(%Vpx)"],["100%","translate%XY(0px)"]]},slideClose:{duration:400,timing:"ease-in",positions:{top:{"100%":-400},right:{"100%":400},bottom:{"100%":400},left:{"100%":-400}},css:[["0%","translate%XY(0px)"],["100%","translate%XY(%Vpx)"]]},flipOpen:{duration:600,css:[["0%","perspective(400px) rotateX(90deg)"],["40%","perspective(400px) rotateX(-15deg)"],["70%","perspective(400px) rotateX(15deg)"],["100%","perspective(400px) rotateX(0deg)"]]},flipClose:{duration:this.options.fade||300,css:[["0%","perspective(400px) rotateX(0deg)"],["100%","perspective(400px) rotateX(90deg)"]]},tada:{duration:800,css:[["0%","scale(1)"],["10%, 20%","scale(0.9) rotate(-3deg)"],["30%, 50%, 70%, 90%","scale(1.1) rotate(3deg)"],["40%, 60%, 80%","scale(1.1) rotate(-3deg)"],["100%","scale(1) rotate(0)"]]}};jQuery.each(["pulse","tada"],function(i,o){t[o+"Open"]=t[o+"Close"]=t[o]});var i=function(i,o){return keyframe_css="@keyframes jBox-"+this.id+"-animation-"+this.options.animation[i]+"-"+i+(o?"-"+o:"")+" {",jQuery.each(t[this.options.animation[i]].css,function(s,e){var n=o?e[1].replace("%XY",this._getXY(o).toUpperCase()):e[1];t[this.options.animation[i]].positions&&(n=n.replace("%V",t[this.options.animation[i]].positions[o][e[0]])),keyframe_css+=e[0]+" {transform:"+n+";}"}.bind(this)),keyframe_css+="}",keyframe_css+=".jBox-"+this.id+"-animation-"+this.options.animation[i]+"-"+i+(o?"-"+o:"")+" {",keyframe_css+="animation-duration: "+t[this.options.animation[i]].duration+"ms;",keyframe_css+="animation-name: jBox-"+this.id+"-animation-"+this.options.animation[i]+"-"+i+(o?"-"+o:"")+";",keyframe_css+=t[this.options.animation[i]].timing?"animation-timing-function: "+t[this.options.animation[i]].timing+";":"",keyframe_css+="}"}.bind(this);this._animationCSS="",jQuery.each(["open","close"],function(o,s){return this.options.animation[s]&&t[this.options.animation[s]]&&("close"!=s||this.options.fade)?void(t[this.options.animation[s]].positions?jQuery.each(["top","right","bottom","left"],function(t,o){this._animationCSS+=i(s,o)}):this._animationCSS+=i(s)):""}.bind(this))},this.options.animation&&this._generateAnimationCSS(),this._blockBodyClick=function(){this.blockBodyClick=!0,setTimeout(function(){this.blockBodyClick=!1}.bind(this),10)},this._animate=function(t){if(!t&&(t=this.isOpen?"open":"close"),!this.options.fade&&"close"==t)return null;var i=this.options.animation[t+"Direction"]||("center"!=this.align?this.align:this.options.attributes.x);this.flipped&&this._getXY(i)==this._getXY(this.align)&&(i=this._getOpp(i));var o="jBox-"+this.id+"-animation-"+this.options.animation[t]+"-"+t+" jBox-"+this.id+"-animation-"+this.options.animation[t]+"-"+t+"-"+i;this.wrapper.addClass(o);var s=1e3*parseFloat(this.wrapper.css("animation-duration"));"close"==t&&(s=Math.min(s,this.options.fade)),setTimeout(function(){this.wrapper.removeClass(o)}.bind(this),s)},this._abortAnimation=function(){var t="jBox-"+this.id+"-animation",i=this.wrapper.attr("class").split(" ").filter(function(i){return 0!==i.lastIndexOf(t,0)});this.wrapper.attr("class",i.join(" "))},(this.options.responsiveWidth||this.options.responsiveHeight)&&jQuery(window).on("resize.responsivejBox-"+this.id,function(){this.isOpen&&this.position()}.bind(this)),"string"===jQuery.type(this.options.preloadAudio)&&(this.options.preloadAudio=[this.options.preloadAudio]),"string"===jQuery.type(this.options.audio)&&(this.options.audio={open:this.options.audio}),"number"===jQuery.type(this.options.volume)&&(this.options.volume={open:this.options.volume,close:this.options.volume}),this.options.preloadAudio===!0&&this.options.audio&&(this.options.preloadAudio=[],jQuery.each(this.options.audio,function(t,i){this.options.preloadAudio.push(i+".mp3"),this.options.preloadAudio.push(i+".ogg")}.bind(this))),this.options.preloadAudio.length&&jQuery.each(this.options.preloadAudio,function(t,i){var o=new Audio;o.src=i,o.preload="auto"}),this._fireEvent("onInit"),this}function jBoxPlugin(t,i){jBox._pluginOptions[t]=i}jBox.prototype.attach=function(t,i){return!t&&(t=jQuery(this.options.attach.selector||this.options.attach)),!i&&(i=this.options.trigger),t&&t.length&&jQuery.each(t,function(t,o){o=jQuery(o),o.data("jBox-attached-"+this.id)||("title"==this.options.getContent&&void 0!=o.attr("title")&&o.data("jBox-getContent",o.attr("title")).removeAttr("title"),this.attachedElements||(this.attachedElements=[]),this.attachedElements.push(o[0]),o.on(i+".jBox-attach-"+this.id,function(t){if(this.timer&&clearTimeout(this.timer),"mouseenter"!=i||!this.isOpen||this.source[0]!=o[0]){if(this.isOpen&&this.source&&this.source[0]!=o[0])var s=!0;this.source=o,!this.options.target&&(this.target=o),"click"==i&&this.options.preventDefault&&t.preventDefault(),this["click"!=i||s?"open":"toggle"]()}}.bind(this)),"mouseenter"==this.options.trigger&&o.on("mouseleave",function(t){(!this.options.closeOnMouseleave||t.relatedTarget!=this.wrapper[0]&&!jQuery(t.relatedTarget).parents("#"+this.id).length)&&this.close()}.bind(this)),o.data("jBox-attached-"+this.id,i),this._fireEvent("onAttach",o))}.bind(this)),this},jBox.prototype.detach=function(t){return!t&&(t=this.attachedElements||[]),t&&t.length&&jQuery.each(t,function(t,i){i=jQuery(i),i.data("jBox-attached-"+this.id)&&(i.off(i.data("jBox-attached-"+this.id)+".jBox-attach-"+this.id),i.data("jBox-attached-"+this.id,null)),this.attachedElements=jQuery.grep(this.attachedElements,function(t){return t!=i[0]})}.bind(this)),this},jBox.prototype.setTitle=function(t,i){if(null==t||void 0==t)return this;!this.wrapper&&this._create();var o=this.wrapper.outerHeight(),s=this.wrapper.outerWidth();return this.title||(this.titleContainer=jQuery(''),this.title=jQuery("").appendTo(this.titleContainer),this.wrapper.addClass("jBox-hasTitle"),("title"==this.options.closeButton||this.options.closeButton===!0&&!this.options.overlay)&&(this.wrapper.addClass("jBox-closeButton-title"),this.closeButton.appendTo(this.titleContainer)),this.titleContainer.insertBefore(this.content),this._setTitleWidth()),this.title.html(t),s!=this.wrapper.outerWidth()&&this._setTitleWidth(),!i&&this.options.repositionOnContent&&(o!=this.wrapper.outerHeight()||s!=this.wrapper.outerWidth())&&this.position(),this},jBox.prototype.setContent=function(t,i){if(null==t||void 0==t)return this;!this.wrapper&&this._create();var o=this.wrapper.outerHeight(),s=this.wrapper.outerWidth();switch(this.content.children("[data-jbox-content-appended]").appendTo("body").css({display:"none"}),jQuery.type(t)){case"string":this.content.html(t);break;case"object":this.content.html(""),t.attr("data-jbox-content-appended",1).appendTo(this.content).css({display:"block"})}return s!=this.wrapper.outerWidth()&&this._setTitleWidth(),!i&&this.options.repositionOnContent&&(o!=this.wrapper.outerHeight()||s!=this.wrapper.outerWidth())&&this.position(),this},jBox.prototype.setDimensions=function(t,i,o){!this.wrapper&&this._create(),this.content.css(t,this._getInt(i)),"width"==t&&this._setTitleWidth(),(void 0==o||o)&&this.position()},jBox.prototype.setWidth=function(t,i){this.setDimensions("width",t,i)},jBox.prototype.setHeight=function(t,i){this.setDimensions("height",t,i)},jBox.prototype.position=function(t){!t&&(t={}),t=jQuery.extend(!0,this.options,t),this.target=t.target||this.target||jQuery(window),this.content.css({width:this._getInt(t.width,"width"),height:this._getInt(t.height,"height"),minWidth:this._getInt(t.minWidth,"width"),minHeight:this._getInt(t.minHeight,"height"),maxWidth:this._getInt(t.maxWidth,"width"),maxHeight:this._getInt(t.maxHeight,"height")}),this._setTitleWidth();var i=this._exposeDimensions();"mouse"!=this.target&&!this.target.data("jBox-"+this.id+"-fixed")&&this.target.data("jBox-"+this.id+"-fixed",this.target[0]==jQuery(window)[0]||"fixed"!=this.target.css("position")&&this.target.parents().filter(function(){return"fixed"==jQuery(this).css("position")}).length<=0?"static":"fixed");var o={x:jQuery(window).outerWidth(),y:jQuery(window).outerHeight(),top:t.fixed&&this.target.data("jBox-"+this.id+"-fixed")?0:jQuery(window).scrollTop(),left:t.fixed&&this.target.data("jBox-"+this.id+"-fixed")?0:jQuery(window).scrollLeft()};o.bottom=o.top+o.y,o.right=o.left+o.x;try{var s=this.target.offset()}catch(e){var s={top:0,left:0}}"mouse"!=this.target&&"fixed"==this.target.data("jBox-"+this.id+"-fixed")&&t.fixed&&(s.top=s.top-jQuery(window).scrollTop(),s.left=s.left-jQuery(window).scrollLeft());var n={x:"mouse"==this.target?12:this.target.outerWidth(),y:"mouse"==this.target?20:this.target.outerHeight(),top:"mouse"==this.target&&t.mouseTarget?t.mouseTarget.top:s?s.top:0,left:"mouse"==this.target&&t.mouseTarget?t.mouseTarget.left:s?s.left:0},a=t.outside&&!("center"==t.position.x&&"center"==t.position.y),r={x:o.x-t.adjustDistance.left-t.adjustDistance.right,y:o.y-t.adjustDistance.top-t.adjustDistance.bottom,left:a?n.left-jQuery(window).scrollLeft()-t.adjustDistance.left:0,right:a?o.x-n.left+jQuery(window).scrollLeft()-n.x-t.adjustDistance.right:0,top:a?n.top-jQuery(window).scrollTop()-this.options.adjustDistance.top:0,bottom:a?o.y-n.top+jQuery(window).scrollTop()-n.y-t.adjustDistance.bottom:0},h={x:"x"!=t.outside&&"xy"!=t.outside||"number"==jQuery.type(t.position.x)?null:t.position.x,y:"y"!=t.outside&&"xy"!=t.outside||"number"==jQuery.type(t.position.y)?null:t.position.y},p={x:!1,y:!1};if(h.x&&i.x>r[h.x]&&r[this._getOpp(h.x)]>r[h.x]&&(h.x=this._getOpp(h.x))&&(p.x=!0),h.y&&i.y>r[h.y]&&r[this._getOpp(h.y)]>r[h.y]&&(h.y=this._getOpp(h.y))&&(p.y=!0),t.responsiveWidth||t.responsiveHeight){var l=function(){if(t.responsiveWidth&&i.x>r[h.x||"x"]){var o=r[h.x||"x"]-(this.pointer&&a&&"x"==t.outside?this.pointer.dimensions.x:0)-parseInt(this.container.css("border-left-width"))-parseInt(this.container.css("border-right-width"));this.content.css({width:o>this.options.responsiveMinWidth?o:null,minWidth:or[h.y]&&r[this._getOpp(h.y)]>r[h.y]&&(h.y=this._getOpp(h.y))&&(p.y=!0);var d=function(){if(t.responsiveHeight&&i.y>r[h.y||"y"]){var o=function(){if(!this.titleContainer)return 0;if("none"==this.wrapper.css("display")){this.wrapper.css("display","block");var t=this.titleContainer.outerHeight();this.wrapper.css("display","none")}else var t=this.titleContainer.outerHeight();return t||0}.bind(this),s=r[h.y||"y"]-(this.pointer&&a&&"y"==t.outside?this.pointer.dimensions.y:0)-o()-parseInt(this.container.css("border-top-width"))-parseInt(this.container.css("border-bottom-width"));this.content.css({height:s>this.options.responsiveMinHeight?s:null}),this._setTitleWidth()}i=this._exposeDimensions()}.bind(this);t.responsiveHeight&&d(),t.responsiveHeight&&!p.x&&h.x&&i.x>r[h.x]&&r[this._getOpp(h.x)]>r[h.x]&&(h.x=this._getOpp(h.x))&&(p.x=!0),t.adjustPosition&&"move"!=t.adjustPosition&&(p.x&&l(),p.y&&d())}var c={},u=function(o){if("number"==jQuery.type(t.position[o]))return void(c[t.attributes[o]]=t.position[o]);var s=t.attributes[o]="x"==o?"left":"top";return c[s]=n[s],"center"==t.position[o]?(c[s]+=Math.ceil((n[o]-i[o])/2),void("mouse"!=this.target&&this.target[0]&&this.target[0]==jQuery(window)[0]&&(c[s]+=.5*(t.adjustDistance[s]-t.adjustDistance[this._getOpp(s)])))):(s!=t.position[o]&&(c[s]+=n[o]-i[o]),void((t.outside==o||"xy"==t.outside)&&(c[s]+=i[o]*(s!=t.position[o]?1:-1))))}.bind(this);if(u("x"),u("y"),this.pointer&&"target"==t.pointTo&&"number"!=jQuery.type(t.position.x)&&"number"!=jQuery.type(t.position.y)){var g=0;switch(this.pointer.align){case"center":"center"!=t.position[this._getOpp(t.outside)]&&(g+=i[this._getOpp(t.outside)]/2);break;default:switch(t.position[this._getOpp(t.outside)]){case"center":g+=(i[this._getOpp(t.outside)]/2-this.pointer.dimensions[this._getOpp(t.outside)]/2)*(this.pointer.align==this._getTL(this.pointer.align)?1:-1);break;default:g+=this.pointer.align!=t.position[this._getOpp(t.outside)]?this.dimensions[this._getOpp(t.outside)]*(-1!==jQuery.inArray(this.pointer.align,["top","left"])?1:-1)+this.pointer.dimensions[this._getOpp(t.outside)]/2*(-1!==jQuery.inArray(this.pointer.align,["top","left"])?-1:1):this.pointer.dimensions[this._getOpp(t.outside)]/2*(-1!==jQuery.inArray(this.pointer.align,["top","left"])?1:-1)}}g*=t.position[this._getOpp(t.outside)]==this.pointer.alignAttribute?-1:1,g+=this.pointer.offset*(this.pointer.align==this._getOpp(this._getTL(this.pointer.align))?1:-1),c[this._getTL(this._getOpp(this.pointer.xy))]+=g}if(c[t.attributes.x]+=t.offset.x,c[t.attributes.y]+=t.offset.y,this.wrapper.css(c),t.adjustPosition){this.positionAdjusted&&(this.pointer&&this.wrapper.css("padding",0).css("padding-"+this._getOpp(this.outside),this.pointer.dimensions[this._getXY(this.outside)]).removeClass("jBox-pointerPosition-"+this._getOpp(this.pointer.position)).addClass("jBox-pointerPosition-"+this.pointer.position),this.pointer&&this.pointer.element.attr("class","jBox-pointer jBox-pointer-"+this._getOpp(this.outside)).css(this.pointer.margin),this.positionAdjusted=!1,this.flipped=!1);var m=o.top>c.top-(t.adjustDistance.top||0),f=o.rightc.left-(t.adjustDistance.left||0),j=x?"left":f?"right":null,b=m?"top":y?"bottom":null,v=j||b;if(v){var B=function(o){this.wrapper.css(this._getTL(o),c[this._getTL(o)]+(i[this._getXY(o)]+t.offset[this._getXY(o)]*("top"==o||"left"==o?-2:2)+n[this._getXY(o)])*("top"==o||"left"==o?1:-1)),this.pointer&&this.wrapper.removeClass("jBox-pointerPosition-"+this.pointer.position).addClass("jBox-pointerPosition-"+this._getOpp(this.pointer.position)).css("padding",0).css("padding-"+o,this.pointer.dimensions[this._getXY(o)]),this.pointer&&this.pointer.element.attr("class","jBox-pointer jBox-pointer-"+o),this.positionAdjusted=!0,this.flipped=!0}.bind(this);p.x&&B(this.options.position.x),p.y&&B(this.options.position.y);var w="x"==this._getXY(this.outside)?b:j;if(this.pointer&&"target"==t.pointTo&&"flip"!=t.adjustPosition&&this._getXY(w)==this._getOpp(this._getXY(this.outside))){if("center"==this.pointer.align)var _=i[this._getXY(w)]/2-this.pointer.dimensions[this._getOpp(this.pointer.xy)]/2-parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))*(w!=this._getTL(w)?-1:1);else var _=w==this.pointer.alignAttribute?parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute)):i[this._getXY(w)]-parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))-this.pointer.dimensions[this._getXY(w)];spaceDiff=w==this._getTL(w)?o[this._getTL(w)]-c[this._getTL(w)]+t.adjustDistance[w]:-1*(o[this._getOpp(this._getTL(w))]-c[this._getTL(w)]-t.adjustDistance[w]-i[this._getXY(w)]),w==this._getOpp(this._getTL(w))&&c[this._getTL(w)]-spaceDiff=spaceDiff&&spaceDiff>0&&(this.pointer.element.css("margin-"+this.pointer.alignAttribute,parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))-spaceDiff*(w!=this.pointer.alignAttribute?-1:1)),this.wrapper.css(this._getTL(w),c[this._getTL(w)]+spaceDiff*(w!=this._getTL(w)?-1:1)),this.positionAdjusted=!0)}}}return this._fireEvent("onPosition"),this},jBox.prototype.open=function(t){if(!t&&(t={}),this.isDestroyed)return!1;if(!this.wrapper&&this._create(),!this._styles&&(this._styles=jQuery("").append(this._animationCSS).appendTo(jQuery("head"))),this.timer&&clearTimeout(this.timer),this._blockBodyClick(),this.isDisabled)return this;var i=function(){this.source&&this.options.getTitle&&(this.source.attr(this.options.getTitle)&&this.setTitle(this.source.attr(this.options.getTitle)),!0),this.source&&this.options.getContent&&(this.source.data("jBox-getContent")?this.setContent(this.source.data("jBox-getContent"),!0):this.source.attr(this.options.getContent)?this.setContent(this.source.attr(this.options.getContent),!0):"html"==this.options.getContent?this.setContent(this.source.html(),!0):null),this._fireEvent("onOpen"),(this.options.ajax&&(this.options.ajax.url||this.source&&this.source.attr(this.options.ajax.getURL))&&(!this.ajaxLoaded||this.options.ajax.reload)||t.ajax&&(t.ajax.url||t.ajax.data))&&("strict"==this.options.ajax.reload||!this.source||!this.source.data("jBox-ajax-data")||t.ajax&&(t.ajax.url||t.ajax.data)?this.ajax(t.ajax||null,!0):this.setContent(this.source.data("jBox-ajax-data"))),(!this.positionedOnOpen||this.options.repositionOnOpen)&&this.position(t)&&(this.positionedOnOpen=!0),this.isClosing&&this._abortAnimation(),this.isOpen||(this.isOpen=!0,this.options.autoClose&&(this.options.delayClose=this.options.autoClose)&&this.close(),this._attachEvents(),this.options.blockScroll&&jQuery("body").addClass("jBox-blockScroll-"+this.id),this.options.overlay&&this._showOverlay(),this.options.animation&&!this.isClosing&&this._animate("open"),this.options.audio&&this.options.audio.open&&this.audio(this.options.audio.open,this.options.volume.open),this.options.fade?this.wrapper.stop().animate({opacity:1},{queue:!1,duration:this.options.fade,start:function(){this.isOpening=!0,this.wrapper.css({display:"block"})}.bind(this),always:function(){this.isOpening=!1,this.positionOnFadeComplete&&this.position()&&(this.positionOnFadeComplete=!1)}.bind(this)}):(this.wrapper.css({display:"block",opacity:1}),this.positionOnFadeComplete&&this.position()&&(this.positionOnFadeComplete=!1)))}.bind(this);return!this.options.delayOpen||this.isOpen||this.isClosing||t.ignoreDelay?i():this.timer=setTimeout(i,this.options.delayOpen),this},jBox.prototype.close=function(t){if(t||(t={}),this.isDestroyed)return!1;if(this.timer&&clearTimeout(this.timer),this._blockBodyClick(),this.isDisabled)return this;var i=function(){this._fireEvent("onClose"),this.isOpen&&(this.isOpen=!1,this._detachEvents(),this.options.blockScroll&&jQuery("body").removeClass("jBox-blockScroll-"+this.id),this.options.overlay&&this._hideOverlay(),this.options.animation&&!this.isOpening&&this._animate("close"),this.options.audio&&this.options.audio.close&&this.audio(this.options.audio.close,this.options.volume.close),this.options.fade?this.wrapper.stop().animate({opacity:0},{queue:!1,duration:this.options.fade,start:function(){this.isClosing=!0
-}.bind(this),complete:function(){this.wrapper.css({display:"none"}),this.options.onCloseComplete&&this.options.onCloseComplete.bind(this)(),this.options._onCloseComplete&&this.options._onCloseComplete.bind(this)()}.bind(this),always:function(){this.isClosing=!1}.bind(this)}):(this.wrapper.css({display:"none",opacity:0}),this.options._onCloseComplete&&this.options._onCloseComplete.bind(this)()))}.bind(this);return t.ignoreDelay?i():this.timer=setTimeout(i,Math.max(this.options.delayClose,10)),this},jBox.prototype.toggle=function(t){return this[this.isOpen?"close":"open"](t),this},jBox.prototype.disable=function(){return this.isDisabled=!0,this},jBox.prototype.enable=function(){return this.isDisabled=!1,this},jBox.prototype.hide=function(){return this.disable(),this.wrapper&&this.wrapper.css({display:"none"}),this},jBox.prototype.show=function(){return this.enable(),this.wrapper&&this.wrapper.css({display:"block"}),this},jBox.prototype.ajax=function(t,i){t||(t={}),jQuery.each([["getData","data"],["getURL","url"]],function(i,o){this.options.ajax[o[0]]&&!t[o[1]]&&this.source&&void 0!=this.source.attr(this.options.ajax[o[0]])&&(t[o[1]]=this.source.attr(this.options.ajax[o[0]])||"")}.bind(this));var o=jQuery.extend(!0,{},this.options.ajax);this.ajaxRequest&&this.ajaxRequest.abort();var s=t.beforeSend||o.beforeSend||function(){},e=t.complete||o.complete||function(){},n=t.success||o.success||function(){},a=t.error||o.error||function(){},r=jQuery.extend(!0,o,t);return r.beforeSend=function(){this.wrapper.addClass("jBox-loading"),r.spinner&&(this.spinnerDelay=setTimeout(function(){this.wrapper.addClass("jBox-loading-spinner"),r.spinnerReposition&&(i?this.positionOnFadeComplete=!0:this.position()),this.spinner=jQuery(r.spinner!==!0?r.spinner:'').appendTo(this.container),this.titleContainer&&"absolute"==this.spinner.css("position")&&this.spinner.css({transform:"translateY("+.5*this.titleContainer.outerHeight()+"px)"})}.bind(this),""==this.content.html()?0:r.spinnerDelay||0)),s.bind(this)()}.bind(this),r.complete=function(t){this.spinnerDelay&&clearTimeout(this.spinnerDelay),this.wrapper.removeClass("jBox-loading jBox-loading-spinner jBox-loading-spinner-delay"),this.spinner&&this.spinner.length&&this.spinner.remove()&&r.spinnerReposition&&(i?this.positionOnFadeComplete=!0:this.position()),this.ajaxLoaded=!0,e.bind(this)(t)}.bind(this),r.success=function(t){r.setContent&&this.setContent(t,!0)&&(i?this.positionOnFadeComplete=!0:this.position()),r.setContent&&this.source&&this.source.data("jBox-ajax-data",t),n.bind(this)(t)}.bind(this),r.error=function(t){a.bind(this)(t)}.bind(this),this.ajaxRequest=jQuery.ajax(r),this},jBox.prototype.audio=function(t,i){if(!t)return this;if(!jBox._audio&&(jBox._audio={}),!jBox._audio[t]){var o=jQuery("");jQuery("",{src:t+".mp3"}).appendTo(o),jQuery("",{src:t+".ogg"}).appendTo(o),jBox._audio[t]=o[0]}jBox._audio[t].volume=Math.min((void 0!=i?i:100)/100,1);try{jBox._audio[t].pause(),jBox._audio[t].currentTime=0}catch(s){}return jBox._audio[t].play(),this},jBox.prototype.destroy=function(){return this.detach().close({ignoreDelay:!0}),this.wrapper&&this.wrapper.remove(),this.overlay&&this.overlay.remove(),this._styles&&this._styles.remove(),this.isDestroyed=!0,this},jBox._getUniqueID=function(){var t=1;return function(){return t++}}(),jBox._pluginOptions={},jQuery.fn.jBox=function(t,i){return!t&&(t={}),!i&&(i={}),new jBox(t,jQuery.extend(i,{attach:this}))};
\ No newline at end of file
+function jBox(t,i){return this.options={id:null,width:"auto",height:"auto",minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,responsiveWidth:!0,responsiveHeight:!0,responsiveMinWidth:100,responsiveMinHeight:100,attach:null,trigger:"click",preventDefault:!1,title:null,content:null,getTitle:null,getContent:null,isolateScroll:!0,ajax:{url:null,data:"",reload:!1,getURL:"data-url",getData:"data-ajax",setContent:!0,spinner:!0,spinnerDelay:300,spinnerReposition:!0},target:null,position:{x:"center",y:"center"},outside:null,offset:0,attributes:{x:"left",y:"top"},fixed:!1,adjustPosition:!0,adjustTracker:!1,adjustDistance:5,reposition:!0,repositionOnOpen:!0,repositionOnContent:!0,pointer:!1,pointTo:"target",fade:180,animation:null,transition:!1,theme:"Default",addClass:null,overlay:!1,zIndex:1e4,delayOpen:0,delayClose:0,closeOnEsc:!1,closeOnClick:!1,closeOnMouseleave:!1,closeButton:!1,appendTo:jQuery("body"),createOnInit:!1,blockScroll:!1,draggable:!1,dragOver:!0,autoClose:!1,preloadAudio:!0,audio:null,volume:100,onInit:null,onAttach:null,onPosition:null,onCreated:null,onOpen:null,onClose:null,onCloseComplete:null},this._pluginOptions={Tooltip:{getContent:"title",trigger:"mouseenter",position:{x:"center",y:"top"},outside:"y",pointer:!0},Mouse:{responsiveWidth:!1,responsiveHeight:!1,adjustPosition:"flip",target:"mouse",trigger:"mouseenter",position:{x:"right",y:"bottom"},outside:"xy",offset:5},Modal:{target:jQuery(window),fixed:!0,blockScroll:!0,closeOnEsc:!0,closeOnClick:"overlay",closeButton:"title",overlay:!0,animation:"zoomIn"}},this.options=jQuery.extend(!0,this.options,this._pluginOptions[t]?this._pluginOptions[t]:jBox._pluginOptions[t],i),"string"==jQuery.type(t)&&(this.type=t),this._fireEvent=function(t,i){this.options["_"+t]&&this.options["_"+t].bind(this)(i),this.options[t]&&this.options[t].bind(this)(i)},null===this.options.id&&(this.options.id="jBox"+jBox._getUniqueID()),this.id=this.options.id,("center"==this.options.position.x&&"x"==this.options.outside||"center"==this.options.position.y&&"y"==this.options.outside)&&(this.options.outside=null),"target"==this.options.pointTo&&(!this.options.outside||"xy"==this.options.outside)&&(this.options.pointer=!1),this.options.offset="object"!=jQuery.type(this.options.offset)?{x:this.options.offset,y:this.options.offset}:jQuery.extend({x:0,y:0},this.options.offset),this.options.adjustDistance="object"!=jQuery.type(this.options.adjustDistance)?{top:this.options.adjustDistance,right:this.options.adjustDistance,bottom:this.options.adjustDistance,left:this.options.adjustDistance}:jQuery.extend({top:5,left:5,right:5,bottom:5},this.options.adjustDistance),this.outside=this.options.outside&&"xy"!=this.options.outside?this.options.position[this.options.outside]:!1,this.align=this.outside?this.outside:"center"!=this.options.position.y&&"number"!=jQuery.type(this.options.position.y)?this.options.position.x:"center"!=this.options.position.x&&"number"!=jQuery.type(this.options.position.x)?this.options.position.y:this.options.attributes.x,this._getOpp=function(t){return{left:"right",right:"left",top:"bottom",bottom:"top",x:"y",y:"x"}[t]},this._getXY=function(t){return{left:"x",right:"x",top:"y",bottom:"y",center:"x"}[t]},this._getTL=function(t){return{left:"left",right:"left",top:"top",bottom:"top",center:"left",x:"left",y:"top"}[t]},this._getInt=function(t,i){return"auto"==t?"auto":t&&"string"==jQuery.type(t)&&"%"==t.slice(-1)?jQuery(window)["height"==i?"innerHeight":"innerWidth"]()*parseInt(t.replace("%",""))/100:t},this._createSVG=function(t,i){var s=document.createElementNS("http://www.w3.org/2000/svg",t);return jQuery.each(i,function(t,i){s.setAttribute(i[0],i[1]||"")}),s},this._isolateScroll=function(t){t&&t.length&&t.on("DOMMouseScroll.jBoxIsolateScroll mousewheel.jBoxIsolateScroll",function(i){var s=i.wheelDelta||i.originalEvent&&i.originalEvent.wheelDelta||-i.detail,o=this.scrollTop+t.outerHeight()-this.scrollHeight>=0,e=this.scrollTop<=0;(0>s&&o||s>0&&e)&&i.preventDefault()})},this._setTitleWidth=function(){if(!this.titleContainer)return null;if("none"==this.wrapper.css("display")){this.wrapper.css("display","block");var t=this.content.outerWidth();this.wrapper.css("display","none")}else var t=this.content.outerWidth();this.titleContainer.css({maxWidth:t||null})},this._create=function(){if(!this.wrapper){if(this.wrapper=jQuery("",{id:this.id,"class":"jBox-wrapper"+(this.type?" jBox-"+this.type:"")+(this.options.theme?" jBox-"+this.options.theme:"")+(this.options.addClass?" "+this.options.addClass:"")}).css({position:this.options.fixed?"fixed":"absolute",display:"none",opacity:0,zIndex:this.options.zIndex}).data("jBox",this),this.options.closeOnMouseleave&&this.wrapper.on("mouseleave",function(t){!this.source||!(t.relatedTarget==this.source[0]||-1!==jQuery.inArray(this.source[0],jQuery(t.relatedTarget).parents("*")))&&this.close()}.bind(this)),"box"==this.options.closeOnClick&&this.wrapper.on("touchend click",function(){this.close({ignoreDelay:!0})}.bind(this)),this.container=jQuery('').appendTo(this.wrapper),this.content=jQuery('').appendTo(this.container),this.options.isolateScroll&&this._isolateScroll(this.content),this.options.closeButton){var t=this._createSVG("svg",[["viewBox","0 0 24 24"]]);t.appendChild(this._createSVG("path",[["d","M22.2,4c0,0,0.5,0.6,0,1.1l-6.8,6.8l6.9,6.9c0.5,0.5,0,1.1,0,1.1L20,22.3c0,0-0.6,0.5-1.1,0L12,15.4l-6.9,6.9c-0.5,0.5-1.1,0-1.1,0L1.7,20c0,0-0.5-0.6,0-1.1L8.6,12L1.7,5.1C1.2,4.6,1.7,4,1.7,4L4,1.7c0,0,0.6-0.5,1.1,0L12,8.5l6.8-6.8c0.5-0.5,1.1,0,1.1,0L22.2,4z"]])),this.closeButton=jQuery('').on("touchend click",function(){this.close({ignoreDelay:!0})}.bind(this)).append(t),("box"==this.options.closeButton||this.options.closeButton===!0&&!this.options.overlay&&!this.options.title)&&(this.wrapper.addClass("jBox-closeButton-box"),this.closeButton.appendTo(this.container))}if(this.wrapper.appendTo(this.options.appendTo),this.wrapper.find(".jBox-closeButton").length&&jQuery.each(["top","right","bottom","left"],function(t,i){this.wrapper.find(".jBox-closeButton").css(i)&&"auto"!=this.wrapper.find(".jBox-closeButton").css(i)&&(this.options.adjustDistance[i]=Math.max(this.options.adjustDistance[i],this.options.adjustDistance[i]+-1*((parseInt(this.wrapper.find(".jBox-closeButton").css(i))||0)+(parseInt(this.container.css("border-"+i+"-width"))||0))))}.bind(this)),this.options.pointer){if(this.pointer={position:"target"!=this.options.pointTo?this.options.pointTo:this._getOpp(this.outside),xy:this._getXY("target"!=this.options.pointTo?this.options.pointTo:this.outside),align:"center",offset:0},this.pointer.element=jQuery('').appendTo(this.wrapper),this.pointer.dimensions={x:this.pointer.element.outerWidth(),y:this.pointer.element.outerHeight()},"string"==jQuery.type(this.options.pointer)){var i=this.options.pointer.split(":");i[0]&&(this.pointer.align=i[0]),i[1]&&(this.pointer.offset=parseInt(i[1]))}this.pointer.alignAttribute="x"==this.pointer.xy?"bottom"==this.pointer.align?"bottom":"top":"right"==this.pointer.align?"right":"left",this.wrapper.css("padding-"+this.pointer.position,this.pointer.dimensions[this.pointer.xy]),this.pointer.element.css(this.pointer.alignAttribute,"center"==this.pointer.align?"50%":0).css("margin-"+this.pointer.alignAttribute,this.pointer.offset),this.pointer.margin={},this.pointer.margin["margin-"+this.pointer.alignAttribute]=this.pointer.offset,"center"==this.pointer.align&&this.pointer.element.css("transform","translate("+("y"==this.pointer.xy?this.pointer.dimensions.x*-.5+"px":0)+", "+("x"==this.pointer.xy?this.pointer.dimensions.y*-.5+"px":0)+")"),this.pointer.element.css("x"==this.pointer.xy?"width":"height",parseInt(this.pointer.dimensions[this.pointer.xy])+parseInt(this.container.css("border-"+this.pointer.alignAttribute+"-width"))),this.wrapper.addClass("jBox-pointerPosition-"+this.pointer.position)}if(this.setContent(this.options.content,!0),this.setTitle(this.options.title,!0),this.options.draggable){var s="title"==this.options.draggable&&this.titleContainer?this.titleContainer:this.options.draggable.length?this.options.draggable:this.wrapper;s.addClass("jBox-draggable").on("mousedown",function(t){if(2!=t.button&&!jQuery(t.target).hasClass("jBox-noDrag")&&!jQuery(t.target).parents(".jBox-noDrag").length){this.options.dragOver&&this.wrapper.css("zIndex")<=jBox.zIndexMax&&(jBox.zIndexMax+=1,this.wrapper.css("zIndex",jBox.zIndexMax));var i=this.wrapper.outerHeight(),s=this.wrapper.outerWidth(),o=this.wrapper.offset().top+i-t.pageY,e=this.wrapper.offset().left+s-t.pageX;jQuery(document).on("mousemove.jBox-draggable-"+this.id,function(t){this.wrapper.offset({top:t.pageY+o-i,left:t.pageX+e-s})}.bind(this)),t.preventDefault()}}.bind(this)).on("mouseup",function(){jQuery(document).off("mousemove.jBox-draggable-"+this.id)}.bind(this)),jBox.zIndexMax=jBox.zIndexMax?Math.max(jBox.zIndexMax,this.options.zIndex):this.options.zIndex}this._fireEvent("onCreated")}},this.options.createOnInit&&this._create(),this.options.attach&&this.attach(),this._attachEvents=function(){this.options.closeOnEsc&&jQuery(document).on("keyup.jBox-"+this.id,function(t){27==t.keyCode&&this.close({ignoreDelay:!0})}.bind(this)),(this.options.closeOnClick===!0||"body"==this.options.closeOnClick)&&jQuery(document).on("touchend.jBox-"+this.id+" click.jBox-"+this.id,function(t){this.blockBodyClick||"body"==this.options.closeOnClick&&(t.target==this.wrapper[0]||this.wrapper.has(t.target).length)||this.close({ignoreDelay:!0})}.bind(this)),(this.options.adjustPosition||this.options.reposition)&&!this.fixed&&this.outside&&(this.options.adjustTracker&&jQuery(window).on("scroll.jBox-"+this.id,function(){this.position()}.bind(this)),(this.options.adjustPosition||this.options.reposition)&&jQuery(window).on("resize.jBox-"+this.id,function(){this.position()}.bind(this))),"mouse"==this.options.target&&jQuery("body").on("mousemove.jBox-"+this.id,function(t){this.position({mouseTarget:{top:t.pageY,left:t.pageX}})}.bind(this))},this._detachEvents=function(){this.options.closeOnEsc&&jQuery(document).off("keyup.jBox-"+this.id),(this.options.closeOnClick===!0||"body"==this.options.closeOnClick)&&jQuery(document).off("touchend.jBox-"+this.id+" click.jBox-"+this.id),this.options.adjustTracker&&jQuery(window).off("scroll.jBox-"+this.id),(this.options.adjustPosition||this.options.reposition)&&jQuery(window).off("resize.jBox-"+this.id),"mouse"==this.options.target&&jQuery("body").off("mousemove.jBox-"+this.id)},this._showOverlay=function(){this.overlay||(this.overlay=jQuery('').addClass("jBox-overlay"+(this.type?" jBox-overlay-"+this.type:"")).css({display:"none",opacity:0,zIndex:this.options.zIndex-1}).appendTo(this.options.appendTo),("overlay"==this.options.closeButton||this.options.closeButton===!0)&&this.overlay.append(this.closeButton),"overlay"==this.options.closeOnClick&&this.overlay.on("touchend click",function(){this.close({ignoreDelay:!0})}.bind(this)),jQuery("#"+this.id+"-overlay .jBox-closeButton").length&&(this.options.adjustDistance.top=Math.max(jQuery("#"+this.id+"-overlay .jBox-closeButton").outerHeight(),this.options.adjustDistance.top))),"block"!=this.overlay.css("display")&&(this.options.fade?this.overlay.stop()&&this.overlay.animate({opacity:1},{queue:!1,duration:this.options.fade,start:function(){this.overlay.css({display:"block"})}.bind(this)}):this.overlay.css({display:"block",opacity:1}))},this._hideOverlay=function(){this.overlay&&(this.options.fade?this.overlay.stop()&&this.overlay.animate({opacity:0},{queue:!1,duration:this.options.fade,complete:function(){this.overlay.css({display:"none"})}.bind(this)}):this.overlay.css({display:"none",opacity:0}))},this._exposeDimensions=function(){this.wrapper.css({top:-1e4,left:-1e4,right:"auto",bottom:"auto"});var t={x:this.wrapper.outerWidth(),y:this.wrapper.outerHeight()};return this.wrapper.css({top:"auto",left:"auto"}),t},this._generateAnimationCSS=function(){"object"!=jQuery.type(this.options.animation)&&(this.options.animation={pulse:{open:"pulse",close:"zoomOut"},zoomIn:{open:"zoomIn",close:"zoomIn"},zoomOut:{open:"zoomOut",close:"zoomOut"},move:{open:"move",close:"move"},slide:{open:"slide",close:"slide"},flip:{open:"flip",close:"flip"},tada:{open:"tada",close:"zoomOut"}}[this.options.animation]),this.options.animation.open&&(this.options.animation.open=this.options.animation.open.split(":")),this.options.animation.close&&(this.options.animation.close=this.options.animation.close.split(":")),this.options.animation.openDirection=this.options.animation.open?this.options.animation.open[1]:null,this.options.animation.closeDirection=this.options.animation.close?this.options.animation.close[1]:null,this.options.animation.open&&(this.options.animation.open=this.options.animation.open[0]),this.options.animation.close&&(this.options.animation.close=this.options.animation.close[0]),this.options.animation.open&&(this.options.animation.open+="Open"),this.options.animation.close&&(this.options.animation.close+="Close");var t={pulse:{duration:350,css:[["0%","scale(1)"],["50%","scale(1.1)"],["100%","scale(1)"]]},zoomInOpen:{duration:this.options.fade||180,css:[["0%","scale(0.9)"],["100%","scale(1)"]]},zoomInClose:{duration:this.options.fade||180,css:[["0%","scale(1)"],["100%","scale(0.9)"]]},zoomOutOpen:{duration:this.options.fade||180,css:[["0%","scale(1.1)"],["100%","scale(1)"]]},zoomOutClose:{duration:this.options.fade||180,css:[["0%","scale(1)"],["100%","scale(1.1)"]]},moveOpen:{duration:this.options.fade||180,positions:{top:{"0%":-12},right:{"0%":12},bottom:{"0%":12},left:{"0%":-12}},css:[["0%","translate%XY(%Vpx)"],["100%","translate%XY(0px)"]]},moveClose:{duration:this.options.fade||180,timing:"ease-in",positions:{top:{"100%":-12},right:{"100%":12},bottom:{"100%":12},left:{"100%":-12}},css:[["0%","translate%XY(0px)"],["100%","translate%XY(%Vpx)"]]},slideOpen:{duration:400,positions:{top:{"0%":-400},right:{"0%":400},bottom:{"0%":400},left:{"0%":-400}},css:[["0%","translate%XY(%Vpx)"],["100%","translate%XY(0px)"]]},slideClose:{duration:400,timing:"ease-in",positions:{top:{"100%":-400},right:{"100%":400},bottom:{"100%":400},left:{"100%":-400}},css:[["0%","translate%XY(0px)"],["100%","translate%XY(%Vpx)"]]},flipOpen:{duration:600,css:[["0%","perspective(400px) rotateX(90deg)"],["40%","perspective(400px) rotateX(-15deg)"],["70%","perspective(400px) rotateX(15deg)"],["100%","perspective(400px) rotateX(0deg)"]]},flipClose:{duration:this.options.fade||300,css:[["0%","perspective(400px) rotateX(0deg)"],["100%","perspective(400px) rotateX(90deg)"]]},tada:{duration:800,css:[["0%","scale(1)"],["10%, 20%","scale(0.9) rotate(-3deg)"],["30%, 50%, 70%, 90%","scale(1.1) rotate(3deg)"],["40%, 60%, 80%","scale(1.1) rotate(-3deg)"],["100%","scale(1) rotate(0)"]]}};jQuery.each(["pulse","tada"],function(i,s){t[s+"Open"]=t[s+"Close"]=t[s]});var i=function(i,s){return keyframe_css="@keyframes jBox-"+this.id+"-animation-"+this.options.animation[i]+"-"+i+(s?"-"+s:"")+" {",jQuery.each(t[this.options.animation[i]].css,function(o,e){var n=s?e[1].replace("%XY",this._getXY(s).toUpperCase()):e[1];t[this.options.animation[i]].positions&&(n=n.replace("%V",t[this.options.animation[i]].positions[s][e[0]])),keyframe_css+=e[0]+" {transform:"+n+";}"}.bind(this)),keyframe_css+="}",keyframe_css+=".jBox-"+this.id+"-animation-"+this.options.animation[i]+"-"+i+(s?"-"+s:"")+" {",keyframe_css+="animation-duration: "+t[this.options.animation[i]].duration+"ms;",keyframe_css+="animation-name: jBox-"+this.id+"-animation-"+this.options.animation[i]+"-"+i+(s?"-"+s:"")+";",keyframe_css+=t[this.options.animation[i]].timing?"animation-timing-function: "+t[this.options.animation[i]].timing+";":"",keyframe_css+="}"}.bind(this);this._animationCSS="",jQuery.each(["open","close"],function(s,o){return this.options.animation[o]&&t[this.options.animation[o]]&&("close"!=o||this.options.fade)?void(t[this.options.animation[o]].positions?jQuery.each(["top","right","bottom","left"],function(t,s){this._animationCSS+=i(o,s)}):this._animationCSS+=i(o)):""}.bind(this))},this.options.animation&&this._generateAnimationCSS(),this._blockBodyClick=function(){this.blockBodyClick=!0,setTimeout(function(){this.blockBodyClick=!1}.bind(this),10)},this._animate=function(t){if(!t&&(t=this.isOpen?"open":"close"),!this.options.fade&&"close"==t)return null;var i=this.options.animation[t+"Direction"]||("center"!=this.align?this.align:this.options.attributes.x);this.flipped&&this._getXY(i)==this._getXY(this.align)&&(i=this._getOpp(i));var s="jBox-"+this.id+"-animation-"+this.options.animation[t]+"-"+t+" jBox-"+this.id+"-animation-"+this.options.animation[t]+"-"+t+"-"+i;this.wrapper.addClass(s);var o=1e3*parseFloat(this.wrapper.css("animation-duration"));"close"==t&&(o=Math.min(o,this.options.fade)),setTimeout(function(){this.wrapper.removeClass(s)}.bind(this),o)},this._abortAnimation=function(){var t="jBox-"+this.id+"-animation",i=this.wrapper.attr("class").split(" ").filter(function(i){return 0!==i.lastIndexOf(t,0)});this.wrapper.attr("class",i.join(" "))},(this.options.responsiveWidth||this.options.responsiveHeight)&&jQuery(window).on("resize.responsivejBox-"+this.id,function(){this.isOpen&&this.position()}.bind(this)),"string"===jQuery.type(this.options.preloadAudio)&&(this.options.preloadAudio=[this.options.preloadAudio]),"string"===jQuery.type(this.options.audio)&&(this.options.audio={open:this.options.audio}),"number"===jQuery.type(this.options.volume)&&(this.options.volume={open:this.options.volume,close:this.options.volume}),this.options.preloadAudio===!0&&this.options.audio&&(this.options.preloadAudio=[],jQuery.each(this.options.audio,function(t,i){this.options.preloadAudio.push(i+".mp3"),this.options.preloadAudio.push(i+".ogg")}.bind(this))),this.options.preloadAudio.length&&jQuery.each(this.options.preloadAudio,function(t,i){var s=new Audio;s.src=i,s.preload="auto"}),this._fireEvent("onInit"),this}function jBoxPlugin(t,i){jBox._pluginOptions[t]=i}jBox.prototype.attach=function(t,i){return!t&&(t=jQuery(this.options.attach.selector||this.options.attach)),!i&&(i=this.options.trigger),t&&t.length&&jQuery.each(t,function(t,s){s=jQuery(s),s.data("jBox-attached-"+this.id)||("title"==this.options.getContent&&void 0!=s.attr("title")&&s.data("jBox-getContent",s.attr("title")).removeAttr("title"),this.attachedElements||(this.attachedElements=[]),this.attachedElements.push(s[0]),s.on(i+".jBox-attach-"+this.id,function(t){if(this.timer&&clearTimeout(this.timer),"mouseenter"!=i||!this.isOpen||this.source[0]!=s[0]){if(this.isOpen&&this.source&&this.source[0]!=s[0])var o=!0;this.source=s,!this.options.target&&(this.target=s),"click"==i&&this.options.preventDefault&&t.preventDefault(),this["click"!=i||o?"open":"toggle"]()}}.bind(this)),"mouseenter"==this.options.trigger&&s.on("mouseleave",function(t){(!this.options.closeOnMouseleave||t.relatedTarget!=this.wrapper[0]&&!jQuery(t.relatedTarget).parents("#"+this.id).length)&&this.close()}.bind(this)),s.data("jBox-attached-"+this.id,i),this._fireEvent("onAttach",s))}.bind(this)),this},jBox.prototype.detach=function(t){return!t&&(t=this.attachedElements||[]),t&&t.length&&jQuery.each(t,function(t,i){i=jQuery(i),i.data("jBox-attached-"+this.id)&&(i.off(i.data("jBox-attached-"+this.id)+".jBox-attach-"+this.id),i.data("jBox-attached-"+this.id,null)),this.attachedElements=jQuery.grep(this.attachedElements,function(t){return t!=i[0]})}.bind(this)),this},jBox.prototype.setTitle=function(t,i){if(null==t||void 0==t)return this;!this.wrapper&&this._create();var s=this.wrapper.outerHeight(),o=this.wrapper.outerWidth();return this.title||(this.titleContainer=jQuery(''),this.title=jQuery("").appendTo(this.titleContainer),this.wrapper.addClass("jBox-hasTitle"),("title"==this.options.closeButton||this.options.closeButton===!0&&!this.options.overlay)&&(this.wrapper.addClass("jBox-closeButton-title"),this.closeButton.appendTo(this.titleContainer)),this.titleContainer.insertBefore(this.content),this._setTitleWidth()),this.title.html(t),o!=this.wrapper.outerWidth()&&this._setTitleWidth(),!i&&this.options.repositionOnContent&&(s!=this.wrapper.outerHeight()||o!=this.wrapper.outerWidth())&&this.position(),this},jBox.prototype.setContent=function(t,i){if(null==t||void 0==t)return this;!this.wrapper&&this._create();var s=this.wrapper.outerHeight(),o=this.wrapper.outerWidth();switch(this.content.children("[data-jbox-content-appended]").appendTo("body").css({display:"none"}),jQuery.type(t)){case"string":this.content.html(t);break;case"object":this.content.html(""),t.attr("data-jbox-content-appended",1).appendTo(this.content).css({display:"block"})}return o!=this.wrapper.outerWidth()&&this._setTitleWidth(),!i&&this.options.repositionOnContent&&(s!=this.wrapper.outerHeight()||o!=this.wrapper.outerWidth())&&this.position(),this},jBox.prototype.setDimensions=function(t,i,s){!this.wrapper&&this._create(),this.content.css(t,this._getInt(i)),"width"==t&&this._setTitleWidth(),(void 0==s||s)&&this.position()},jBox.prototype.setWidth=function(t,i){this.setDimensions("width",t,i)},jBox.prototype.setHeight=function(t,i){this.setDimensions("height",t,i)},jBox.prototype.position=function(t){!t&&(t={}),t=jQuery.extend(!0,this.options,t),this.target=t.target||this.target||jQuery(window),this.content.css({width:this._getInt(t.width,"width"),height:this._getInt(t.height,"height"),minWidth:this._getInt(t.minWidth,"width"),minHeight:this._getInt(t.minHeight,"height"),maxWidth:this._getInt(t.maxWidth,"width"),maxHeight:this._getInt(t.maxHeight,"height")}),this._setTitleWidth();var i=this._exposeDimensions();"mouse"!=this.target&&!this.target.data("jBox-"+this.id+"-fixed")&&this.target.data("jBox-"+this.id+"-fixed",this.target[0]==jQuery(window)[0]||"fixed"!=this.target.css("position")&&this.target.parents().filter(function(){return"fixed"==jQuery(this).css("position")}).length<=0?"static":"fixed");var s={x:jQuery(window).outerWidth(),y:jQuery(window).outerHeight(),top:t.fixed&&this.target.data("jBox-"+this.id+"-fixed")?0:jQuery(window).scrollTop(),left:t.fixed&&this.target.data("jBox-"+this.id+"-fixed")?0:jQuery(window).scrollLeft()};s.bottom=s.top+s.y,s.right=s.left+s.x;try{var o=this.target.offset()}catch(e){var o={top:0,left:0}}"mouse"!=this.target&&"fixed"==this.target.data("jBox-"+this.id+"-fixed")&&t.fixed&&(o.top=o.top-jQuery(window).scrollTop(),o.left=o.left-jQuery(window).scrollLeft());var n={x:"mouse"==this.target?12:this.target.outerWidth(),y:"mouse"==this.target?20:this.target.outerHeight(),top:"mouse"==this.target&&t.mouseTarget?t.mouseTarget.top:o?o.top:0,left:"mouse"==this.target&&t.mouseTarget?t.mouseTarget.left:o?o.left:0},a=t.outside&&!("center"==t.position.x&&"center"==t.position.y),h={x:s.x-t.adjustDistance.left-t.adjustDistance.right,y:s.y-t.adjustDistance.top-t.adjustDistance.bottom,left:a?n.left-jQuery(window).scrollLeft()-t.adjustDistance.left:0,right:a?s.x-n.left+jQuery(window).scrollLeft()-n.x-t.adjustDistance.right:0,top:a?n.top-jQuery(window).scrollTop()-this.options.adjustDistance.top:0,bottom:a?s.y-n.top+jQuery(window).scrollTop()-n.y-t.adjustDistance.bottom:0},p={x:"x"!=t.outside&&"xy"!=t.outside||"number"==jQuery.type(t.position.x)?null:t.position.x,y:"y"!=t.outside&&"xy"!=t.outside||"number"==jQuery.type(t.position.y)?null:t.position.y},r={x:!1,y:!1};if(p.x&&i.x>h[p.x]&&h[this._getOpp(p.x)]>h[p.x]&&(p.x=this._getOpp(p.x))&&(r.x=!0),p.y&&i.y>h[p.y]&&h[this._getOpp(p.y)]>h[p.y]&&(p.y=this._getOpp(p.y))&&(r.y=!0),t.responsiveWidth||t.responsiveHeight){var l=function(){if(t.responsiveWidth&&i.x>h[p.x||"x"]){var s=h[p.x||"x"]-(this.pointer&&a&&"x"==t.outside?this.pointer.dimensions.x:0)-parseInt(this.container.css("border-left-width"))-parseInt(this.container.css("border-right-width"));this.content.css({width:s>this.options.responsiveMinWidth?s:null,minWidth:sh[p.y]&&h[this._getOpp(p.y)]>h[p.y]&&(p.y=this._getOpp(p.y))&&(r.y=!0);var d=function(){if(t.responsiveHeight&&i.y>h[p.y||"y"]){var s=function(){if(!this.titleContainer)return 0;if("none"==this.wrapper.css("display")){this.wrapper.css("display","block");var t=this.titleContainer.outerHeight();this.wrapper.css("display","none")}else var t=this.titleContainer.outerHeight();return t||0}.bind(this),o=h[p.y||"y"]-(this.pointer&&a&&"y"==t.outside?this.pointer.dimensions.y:0)-s()-parseInt(this.container.css("border-top-width"))-parseInt(this.container.css("border-bottom-width"));this.content.css({height:o>this.options.responsiveMinHeight?o:null}),this._setTitleWidth()}i=this._exposeDimensions()}.bind(this);t.responsiveHeight&&d(),t.responsiveHeight&&!r.x&&p.x&&i.x>h[p.x]&&h[this._getOpp(p.x)]>h[p.x]&&(p.x=this._getOpp(p.x))&&(r.x=!0),t.adjustPosition&&"move"!=t.adjustPosition&&(r.x&&l(),r.y&&d())}var u={},c=function(s){if("number"==jQuery.type(t.position[s]))return void(u[t.attributes[s]]=t.position[s]);var o=t.attributes[s]="x"==s?"left":"top";return u[o]=n[o],"center"==t.position[s]?(u[o]+=Math.ceil((n[s]-i[s])/2),void("mouse"!=this.target&&this.target[0]&&this.target[0]==jQuery(window)[0]&&(u[o]+=.5*(t.adjustDistance[o]-t.adjustDistance[this._getOpp(o)])))):(o!=t.position[s]&&(u[o]+=n[s]-i[s]),void((t.outside==s||"xy"==t.outside)&&(u[o]+=i[s]*(o!=t.position[s]?1:-1))))}.bind(this);if(c("x"),c("y"),this.pointer&&"target"==t.pointTo&&"number"!=jQuery.type(t.position.x)&&"number"!=jQuery.type(t.position.y)){var g=0;switch(this.pointer.align){case"center":"center"!=t.position[this._getOpp(t.outside)]&&(g+=i[this._getOpp(t.outside)]/2);break;default:switch(t.position[this._getOpp(t.outside)]){case"center":g+=(i[this._getOpp(t.outside)]/2-this.pointer.dimensions[this._getOpp(t.outside)]/2)*(this.pointer.align==this._getTL(this.pointer.align)?1:-1);break;default:g+=this.pointer.align!=t.position[this._getOpp(t.outside)]?this.dimensions[this._getOpp(t.outside)]*(-1!==jQuery.inArray(this.pointer.align,["top","left"])?1:-1)+this.pointer.dimensions[this._getOpp(t.outside)]/2*(-1!==jQuery.inArray(this.pointer.align,["top","left"])?-1:1):this.pointer.dimensions[this._getOpp(t.outside)]/2*(-1!==jQuery.inArray(this.pointer.align,["top","left"])?1:-1)}}g*=t.position[this._getOpp(t.outside)]==this.pointer.alignAttribute?-1:1,g+=this.pointer.offset*(this.pointer.align==this._getOpp(this._getTL(this.pointer.align))?1:-1),u[this._getTL(this._getOpp(this.pointer.xy))]+=g}if(u[t.attributes.x]+=t.offset.x,u[t.attributes.y]+=t.offset.y,this.wrapper.css(u),t.adjustPosition){this.positionAdjusted&&(this.pointer&&this.wrapper.css("padding",0).css("padding-"+this._getOpp(this.outside),this.pointer.dimensions[this._getXY(this.outside)]).removeClass("jBox-pointerPosition-"+this._getOpp(this.pointer.position)).addClass("jBox-pointerPosition-"+this.pointer.position),this.pointer&&this.pointer.element.attr("class","jBox-pointer jBox-pointer-"+this._getOpp(this.outside)).css(this.pointer.margin),this.positionAdjusted=!1,this.flipped=!1);var y=s.top>u.top-(t.adjustDistance.top||0),f=s.rightu.left-(t.adjustDistance.left||0),j=m?"left":f?"right":null,v=y?"top":x?"bottom":null,b=j||v;if(b){var _=function(s){this.wrapper.css(this._getTL(s),u[this._getTL(s)]+(i[this._getXY(s)]+t.offset[this._getXY(s)]*("top"==s||"left"==s?-2:2)+n[this._getXY(s)])*("top"==s||"left"==s?1:-1)),this.pointer&&this.wrapper.removeClass("jBox-pointerPosition-"+this.pointer.position).addClass("jBox-pointerPosition-"+this._getOpp(this.pointer.position)).css("padding",0).css("padding-"+s,this.pointer.dimensions[this._getXY(s)]),this.pointer&&this.pointer.element.attr("class","jBox-pointer jBox-pointer-"+s),this.positionAdjusted=!0,this.flipped=!0}.bind(this);r.x&&_(this.options.position.x),r.y&&_(this.options.position.y);var B="x"==this._getXY(this.outside)?v:j;if(this.pointer&&"target"==t.pointTo&&"flip"!=t.adjustPosition&&this._getXY(B)==this._getOpp(this._getXY(this.outside))){if("center"==this.pointer.align)var w=i[this._getXY(B)]/2-this.pointer.dimensions[this._getOpp(this.pointer.xy)]/2-parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))*(B!=this._getTL(B)?-1:1);else var w=B==this.pointer.alignAttribute?parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute)):i[this._getXY(B)]-parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))-this.pointer.dimensions[this._getXY(B)];spaceDiff=B==this._getTL(B)?s[this._getTL(B)]-u[this._getTL(B)]+t.adjustDistance[B]:-1*(s[this._getOpp(this._getTL(B))]-u[this._getTL(B)]-t.adjustDistance[B]-i[this._getXY(B)]),B==this._getOpp(this._getTL(B))&&u[this._getTL(B)]-spaceDiff=spaceDiff&&spaceDiff>0&&(this.pointer.element.css("margin-"+this.pointer.alignAttribute,parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))-spaceDiff*(B!=this.pointer.alignAttribute?-1:1)),this.wrapper.css(this._getTL(B),u[this._getTL(B)]+spaceDiff*(B!=this._getTL(B)?-1:1)),this.positionAdjusted=!0)}}}return this._fireEvent("onPosition"),this},jBox.prototype.open=function(t){if(!t&&(t={}),this.isDestroyed)return!1;if(!this.wrapper&&this._create(),!this._styles&&(this._styles=jQuery("").append(this._animationCSS).appendTo(jQuery("head"))),this.timer&&clearTimeout(this.timer),this._blockBodyClick(),this.isDisabled)return this;var i=function(){this.source&&this.options.getTitle&&(this.source.attr(this.options.getTitle)&&this.setTitle(this.source.attr(this.options.getTitle)),!0),this.source&&this.options.getContent&&(this.source.data("jBox-getContent")?this.setContent(this.source.data("jBox-getContent"),!0):this.source.attr(this.options.getContent)?this.setContent(this.source.attr(this.options.getContent),!0):"html"==this.options.getContent?this.setContent(this.source.html(),!0):null),this._fireEvent("onOpen"),(this.options.ajax&&(this.options.ajax.url||this.source&&this.source.attr(this.options.ajax.getURL))&&(!this.ajaxLoaded||this.options.ajax.reload)||t.ajax&&(t.ajax.url||t.ajax.data))&&("strict"==this.options.ajax.reload||!this.source||!this.source.data("jBox-ajax-data")||t.ajax&&(t.ajax.url||t.ajax.data)?this.ajax(t.ajax||null,!0):this.setContent(this.source.data("jBox-ajax-data"))),(!this.positionedOnOpen||this.options.repositionOnOpen)&&this.position(t)&&(this.positionedOnOpen=!0),this.isClosing&&this._abortAnimation(),this.isOpen||(this.isOpen=!0,this.options.autoClose&&(this.options.delayClose=this.options.autoClose)&&this.close(),this._attachEvents(),this.options.blockScroll&&jQuery("body").addClass("jBox-blockScroll-"+this.id),this.options.overlay&&this._showOverlay(),this.options.animation&&!this.isClosing&&this._animate("open"),this.options.audio&&this.options.audio.open&&this.audio(this.options.audio.open,this.options.volume.open),this.options.fade?this.wrapper.stop().animate({opacity:1},{queue:!1,duration:this.options.fade,start:function(){this.isOpening=!0,this.wrapper.css({display:"block"})}.bind(this),always:function(){this.isOpening=!1,this.positionOnFadeComplete&&this.position()&&(this.positionOnFadeComplete=!1)}.bind(this)}):(this.wrapper.css({display:"block",opacity:1}),this.positionOnFadeComplete&&this.position()&&(this.positionOnFadeComplete=!1)))}.bind(this);return!this.options.delayOpen||this.isOpen||this.isClosing||t.ignoreDelay?i():this.timer=setTimeout(i,this.options.delayOpen),this},jBox.prototype.close=function(t){if(t||(t={}),this.isDestroyed)return!1;if(this.timer&&clearTimeout(this.timer),this._blockBodyClick(),this.isDisabled)return this;var i=function(){this._fireEvent("onClose"),this.isOpen&&(this.isOpen=!1,this._detachEvents(),this.options.blockScroll&&jQuery("body").removeClass("jBox-blockScroll-"+this.id),this.options.overlay&&this._hideOverlay(),this.options.animation&&!this.isOpening&&this._animate("close"),this.options.audio&&this.options.audio.close&&this.audio(this.options.audio.close,this.options.volume.close),this.options.fade?this.wrapper.stop().animate({opacity:0},{queue:!1,duration:this.options.fade,start:function(){this.isClosing=!0
+}.bind(this),complete:function(){this.wrapper.css({display:"none"}),this.options.onCloseComplete&&this.options.onCloseComplete.bind(this)(),this.options._onCloseComplete&&this.options._onCloseComplete.bind(this)()}.bind(this),always:function(){this.isClosing=!1}.bind(this)}):(this.wrapper.css({display:"none",opacity:0}),this.options._onCloseComplete&&this.options._onCloseComplete.bind(this)()))}.bind(this);return t.ignoreDelay?i():this.timer=setTimeout(i,Math.max(this.options.delayClose,10)),this},jBox.prototype.toggle=function(t){return this[this.isOpen?"close":"open"](t),this},jBox.prototype.disable=function(){return this.isDisabled=!0,this},jBox.prototype.enable=function(){return this.isDisabled=!1,this},jBox.prototype.hide=function(){return this.disable(),this.wrapper&&this.wrapper.css({display:"none"}),this},jBox.prototype.show=function(){return this.enable(),this.wrapper&&this.wrapper.css({display:"block"}),this},jBox.prototype.ajax=function(t,i){t||(t={}),jQuery.each([["getData","data"],["getURL","url"]],function(i,s){this.options.ajax[s[0]]&&!t[s[1]]&&this.source&&void 0!=this.source.attr(this.options.ajax[s[0]])&&(t[s[1]]=this.source.attr(this.options.ajax[s[0]])||"")}.bind(this));var s=jQuery.extend(!0,{},this.options.ajax);this.ajaxRequest&&this.ajaxRequest.abort();var o=t.beforeSend||s.beforeSend||function(){},e=t.complete||s.complete||function(){},n=t.success||s.success||function(){},a=t.error||s.error||function(){},h=jQuery.extend(!0,s,t);return h.beforeSend=function(){this.wrapper.addClass("jBox-loading"),h.spinner&&(this.spinnerDelay=setTimeout(function(){this.wrapper.addClass("jBox-loading-spinner"),h.spinnerReposition&&(i?this.positionOnFadeComplete=!0:this.position()),this.spinner=jQuery(h.spinner!==!0?h.spinner:'').appendTo(this.container),this.titleContainer&&"absolute"==this.spinner.css("position")&&this.spinner.css({transform:"translateY("+.5*this.titleContainer.outerHeight()+"px)"})}.bind(this),""==this.content.html()?0:h.spinnerDelay||0)),o.bind(this)()}.bind(this),h.complete=function(t){this.spinnerDelay&&clearTimeout(this.spinnerDelay),this.wrapper.removeClass("jBox-loading jBox-loading-spinner jBox-loading-spinner-delay"),this.spinner&&this.spinner.length&&this.spinner.remove()&&h.spinnerReposition&&(i?this.positionOnFadeComplete=!0:this.position()),this.ajaxLoaded=!0,e.bind(this)(t)}.bind(this),h.success=function(t){h.setContent&&this.setContent(t,!0)&&(i?this.positionOnFadeComplete=!0:this.position()),h.setContent&&this.source&&this.source.data("jBox-ajax-data",t),n.bind(this)(t)}.bind(this),h.error=function(t){a.bind(this)(t)}.bind(this),this.ajaxRequest=jQuery.ajax(h),this},jBox.prototype.audio=function(t,i){if(!t)return this;if(!jBox._audio&&(jBox._audio={}),!jBox._audio[t]){var s=jQuery("");jQuery("",{src:t+".mp3"}).appendTo(s),jQuery("",{src:t+".ogg"}).appendTo(s),jBox._audio[t]=s[0]}jBox._audio[t].volume=Math.min((void 0!=i?i:100)/100,1);try{jBox._audio[t].pause(),jBox._audio[t].currentTime=0}catch(o){}return jBox._audio[t].play(),this},jBox.prototype.destroy=function(){return this.detach().close({ignoreDelay:!0}),this.wrapper&&this.wrapper.remove(),this.overlay&&this.overlay.remove(),this._styles&&this._styles.remove(),this.isDestroyed=!0,this},jBox._getUniqueID=function(){var t=1;return function(){return t++}}(),jBox._pluginOptions={},jQuery.fn.jBox=function(t,i){return!t&&(t={}),!i&&(i={}),new jBox(t,jQuery.extend(i,{attach:this}))};
\ No newline at end of file
diff --git a/Source/themes/TooltipSmall.css b/Source/themes/TooltipSmall.css
new file mode 100644
index 0000000..7f7f66c
--- /dev/null
+++ b/Source/themes/TooltipSmall.css
@@ -0,0 +1,52 @@
+
+/* jBox theme: TooltipSmall */
+
+.jBox-TooltipSmall {
+ pointer-events: none;
+}
+
+.jBox-TooltipSmall .jBox-content {
+ padding: 0 10px;
+ line-height: 28px;
+}
+
+.jBox-TooltipSmall .jBox-container {
+ border-radius: 2px;
+}
+
+.jBox-TooltipSmall .jBox-pointer-top,
+.jBox-TooltipSmall .jBox-pointer-bottom {
+ width: 22px;
+ height: 8px;
+}
+
+.jBox-TooltipSmall .jBox-pointer-right,
+.jBox-TooltipSmall .jBox-pointer-left {
+ width: 8px;
+ height: 22px;
+}
+
+.jBox-TooltipSmall .jBox-pointer:after {
+ width: 20px;
+ height: 20px;
+}
+
+.jBox-TooltipSmall .jBox-pointer-top:after {
+ left: 1px;
+ top: 6px;
+}
+
+.jBox-TooltipSmall .jBox-pointer-bottom:after {
+ left: 1px;
+ bottom: 6px;
+}
+
+.jBox-TooltipSmall .jBox-pointer-right:after {
+ top: 1px;
+ right: 6px;
+}
+
+.jBox-TooltipSmall .jBox-pointer-left:after {
+ top: 1px;
+ left: 6px;
+}
\ No newline at end of file
diff --git a/Source/themes/TooltipSmallGray.css b/Source/themes/TooltipSmallGray.css
new file mode 100644
index 0000000..9303606
--- /dev/null
+++ b/Source/themes/TooltipSmallGray.css
@@ -0,0 +1,56 @@
+
+/* jBox theme: TooltipSmall */
+
+.jBox-TooltipSmallGray {
+ pointer-events: none;
+}
+
+.jBox-TooltipSmallGray .jBox-content {
+ padding: 0 10px;
+}
+
+.jBox-TooltipSmallGray .jBox-container {
+ font-size: 13px;
+ line-height: 24px;
+ border-radius: 12px;
+ background-image: linear-gradient(to bottom, #fafafa, #f2f2f2);
+}
+
+.jBox-TooltipSmallGray .jBox-pointer-top,
+.jBox-TooltipSmallGray .jBox-pointer-bottom {
+ width: 22px;
+ height: 8px;
+}
+
+.jBox-TooltipSmallGray .jBox-pointer-right,
+.jBox-TooltipSmallGray .jBox-pointer-left {
+ width: 8px;
+ height: 22px;
+}
+
+.jBox-TooltipSmallGray .jBox-pointer:after {
+ width: 20px;
+ height: 20px;
+}
+
+.jBox-TooltipSmallGray .jBox-pointer-top:after {
+ background: #fafafa;
+ left: 1px;
+ top: 6px;
+}
+
+.jBox-TooltipSmallGray .jBox-pointer-bottom:after {
+ background: #f2f2f2;
+ left: 1px;
+ bottom: 6px;
+}
+
+.jBox-TooltipSmallGray .jBox-pointer-right:after {
+ top: 1px;
+ right: 6px;
+}
+
+.jBox-TooltipSmallGray .jBox-pointer-left:after {
+ top: 1px;
+ left: 6px;
+}
\ No newline at end of file