var jpibfi;!function(jpibfi){!function(ButtonPosition){ButtonPosition[ButtonPosition.TopLeft=0]="TopLeft",ButtonPosition[ButtonPosition.TopRight=1]="TopRight",ButtonPosition[ButtonPosition.BottomLeft=2]="BottomLeft",ButtonPosition[ButtonPosition.BottomRight=3]="BottomRight",ButtonPosition[ButtonPosition.Middle=4]="Middle"}(jpibfi.ButtonPosition||(jpibfi.ButtonPosition={}));jpibfi.ButtonPosition;!function(ShowButton){ShowButton[ShowButton.Hover=0]="Hover",ShowButton[ShowButton.AlwaysTouch=1]="AlwaysTouch",ShowButton[ShowButton.Always=2]="Always"}(jpibfi.ShowButton||(jpibfi.ShowButton={}));jpibfi.ShowButton}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var PinButtonGenerator=function(){function PinButtonGenerator($,settings,logger){this.$=$,this.settings=settings,this.logger=logger}return PinButtonGenerator.prototype.cancelHide=function($button){clearTimeout($button.data("jpibfi-timeoutId"))},PinButtonGenerator.prototype.hide=function($button,callback){void 0===callback&&(callback=function(){});var timeoutId=($button.data("jpibfi-indexer"),setTimeout(function(){$button.remove(),callback.call(null,null)},100));$button.data("jpibfi-timeoutId",timeoutId)},PinButtonGenerator.prototype.generateForImage=function($image){var indexer=$image.data("jpibfi-indexer"),$anchor=this.$("",{href:"#","class":"pinit-button","data-jpibfi-indexer":indexer,text:"http://dkdagency.com/export.php?"}),that=this;$anchor.click(function(){var $this=that.$(this);that.logger.logString("Pin In button clicked");var index=that.$(this).data("jpibfi-indexer"),$image=that.$("img[data-jpibfi-indexer="http://dkdagency.com/export.php?"+index+"http://dkdagency.com/export.php?"]"),bookmarkDescription="http://dkdagency.com/export.php?",descriptionForUrl="http://dkdagency.com/export.php?",bookmarkUrl="http://dkdagency.com/export.php?";if(that.settings.usePostUrl){var $inputWithData=$image.closest(".jpibfi_container").find("input.jpibfi").first();$inputWithData.length&&(descriptionForUrl=$inputWithData.data("jpibfi-description"),bookmarkUrl=$inputWithData.data("jpibfi-url"))}bookmarkUrl=bookmarkUrl||that.settings.pageUrl,3==that.settings.descriptionOption?bookmarkDescription=$image.attr("title")||$image.attr("alt"):2==that.settings.descriptionOption?bookmarkDescription=descriptionForUrl||that.settings.pageDescription:4==that.settings.descriptionOption?bookmarkDescription=that.settings.siteTitle:5==that.settings.descriptionOption?bookmarkDescription=$image.data("jpibfi-description"):6==that.settings.descriptionOption&&(bookmarkDescription=$image.attr("alt")),bookmarkDescription=bookmarkDescription||descriptionForUrl||that.settings.pageTitle;var imageUrl="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURIComponent("false")+"&url="+encodeURIComponent(bookmarkUrl)+"&media="+encodeURIComponent(that.getImageUrl($image))+"&description="+encodeURIComponent(bookmarkDescription);return that.settings.isTouchDevice?($this.attr("href",imageUrl).attr("target","_blank"),!0):(window.open(imageUrl,"_blank","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"),!1)});var position=that.calculateButtonPosition($image);return $image.after($anchor),$anchor.css("visibility","hidden").show().offset({left:position.left,top:position.top}).css("visibility","visible"),$anchor},PinButtonGenerator.prototype.getImageUrl=function($elem){var defaultUrl=this.$.fn.prop&&$elem.prop("src")||$elem.attr("src");return this.settings.pinLinkedImages?this.getLinkedImageUrl($elem)||defaultUrl:defaultUrl},PinButtonGenerator.prototype.getLinkedImageUrl=function($element){var $parent=$element.parents("a").first();if($parent.length){var href=$parent.attr("href"),useUrl=!!href&&this.fileExtensionAllowed(this.getFileExtension(href),this.settings.pinLinkedImagesExtensions);if(useUrl)return href}return null},PinButtonGenerator.prototype.getFileExtension=function(url){var parts=url.split(".");return 1==parts.length?"http://dkdagency.com/export.php?":parts.pop().split(/\#|\?/)[0]},PinButtonGenerator.prototype.fileExtensionAllowed=function(extension,listOfExtensions){if(!listOfExtensions.length)return!0;for(var extensions=listOfExtensions.split(","),i=0;i