var initFeaturedVideoPlus;!function(t){"use strict";function a(){t(".has-post-video a>.featured-video-plus,.has-post-video a>.fvp-dynamic,.has-post-video a>.fvp-overlay,.has-post-video a>.wp-video,.has-post-video a>.wp-video-shortcode").unwrap(),t(".has-post-video .post-thumbnail>.post-thumbnail").removeClass("post-thumbnail"),t("a.post-thumbnail:empty").not(".fvp-dynamic, .fvp-overlay").remove()}function e(){fvpdata.fitvids&&t(".featured-video-plus.fvp-responsive").fitVids({customSelector:["iframe","object","embed"]})}function o(){if(fvpdata.width&&!fvpdata.fitvids){t(".fvp-local .wp-video").css({width:fvpdata.width,height:"auto"});var a=t(".fvp-local .wp-video .wp-video-shortcode");a.attr({width:fvpdata.width,height:fvpdata.width/a.attr("width")*a.attr("heigth")})}}function i(a){var e=t(a),o=e.children(".fvp-actionicon");return o.css({height:e.height(),width:e.width(),margin:e.css("margin")}),o}function d(a){var e=t(a.currentTarget).children("img"),o=i(a.currentTarget);o.toggleClass("play"),o.hasClass("play")?e.animate({opacity:fvpdata.opacity}):e.animate({opacity:1})}function n(o){o.preventDefault();var d=t(o.currentTarget),n=parseInt(d.attr("data-id"),10),r=i(o.currentTarget);r.addClass("load "+fvpdata.color),t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:n},function(t){if(t.success){var o=d.parent();d.replaceWith(t.data),o.find(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),e(),a()}r.removeClass("load "+fvpdata.color)})}function r(a){a.preventDefault();var e=t(a.currentTarget),i=parseInt(e.attr("data-id"),10);e.openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:100*fvpdata.opacity,width:"100%",height:"100%"}),s[i]?(t("#DOMWindow").html(s[i]),o(),t(window).trigger("scroll")):t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:i},function(a){a.success&&(s[i]=a.data,t("#DOMWindow").html(a.data),o(),t(window).trigger("scroll"))})}function c(){var i=t(".featured-video-plus, .fvp-overlay, .fvp-dynamic");return!i.is(p)&&(p=i,a(),setTimeout(a,1e3),e(),o(),t(".fvp-overlay, .fvp-dynamic").off("mouseenter").on("mouseenter",d).off("mouseleave").on("mouseleave",d),t(".fvp-dynamic").off("click").on("click",n),void t(".fvp-overlay").off("click").on("click",r))}var p,s={},v=0;initFeaturedVideoPlus=function(){0===v?(c(),v=setTimeout(function(){},100)):(clearTimeout(v),v=setTimeout(c,100))},t(document).ready(function(){window.chrome&&t(".featured-video-plus iframe").each(function(){this.src=this.src}),[fvpdata.playicon,fvpdata.loadicon].forEach(function(a){t("body").append(t("",{src:a,alt:"preload image"}).hide())})})}(jQuery);