function _vcRowGetAllElementsWithAttribute(t){for(var e=[],i=document.getElementsByTagName("*"),a=0,o=i.length;a<o;a++)i[a].getAttribute(t)&&e.push(i[a]);return e}function _vcRowOnPlayerReady(t){var e=t.target;e.playVideo(),e.isMute&&e.mute(),e.forceHD&&e.setPlaybackQuality("hd720");var i=e.getCurrentTime(),a=+new Date/1e3,o=0,r=!0;e.loopInterval=setInterval(function(){"undefined"!=typeof e.loopTimeout&&clearTimeout(e.loopTimeout),i===e.getCurrentTime()?o=i+(+new Date/1e3-a):(o=e.getCurrentTime(),a=+new Date/1e3),i=e.getCurrentTime(),o+(r?.45:.21)>=e.getDuration()&&(e.pauseVideo(),e.seekTo(0),e.playVideo(),r=!1)},150)}function _vcRowOnPlayerStateChange(t){t.data===YT.PlayerState.ENDED&&("undefined"!=typeof t.target.loopTimeout&&clearTimeout(t.target.loopTimeout),t.target.seekTo(0)),t.data===YT.PlayerState.PLAYING&&jQuery(t.target.getIframe()).parent().css("visibility","visible")}function resizeVideo(t){var e=t.parent();if(null===e.find("iframe").width())return void setTimeout(function(){resizeVideo(t)},500);var i=t;i.css({width:"auto",height:"auto",left:"auto",top:"auto"}),i.css("position","absolute");var a,o,r=(e.find("iframe").width(),e.find("iframe").height(),e.width()),n=e.height(),d="16:9";"undefined"!=typeof t.attr("data-video-aspect-ratio")&&t.attr("data-video-aspect-ratio").indexOf(":")!==-1&&(d=t.attr("data-video-aspect-ratio").split(":"),d[0]=parseFloat(d[0]),d[1]=parseFloat(d[1])),o=n,a=d[0]/d[1]*n,a<r&&(o=d[1]/d[0]*r,a=r),marginLeft=-(a-r)/2,marginTop=-(o-n)/2,e.find("iframe").css({width:a,height:o,marginLeft:marginLeft,marginTop:marginTop}).attr("width",a).attr("height",o)}function onYouTubeIframeAPIReady(){for(var t=_vcRowGetAllElementsWithAttribute("data-youtube-video-id"),e=0;e<t.length;e++){for(var i=t[e].getAttribute("data-youtube-video-id"),a="",o=0;o<t[e].childNodes.length;o++)if(/div/i.test(t[e].childNodes[o].tagName)){a=t[e].childNodes[o].getAttribute("id");break}if(""!==a){var r=t[e].getAttribute("data-mute"),n=t[e].getAttribute("data-loop"),d=new YT.Player(a,{height:"auto",width:"auto",videoId:i,playerVars:{autohide:1,autoplay:1,fs:0,showinfo:0,loop:n,modestBranding:1,start:0,controls:0,rel:0,disablekb:1,iv_load_policy:3,wmode:"transparent"},events:{onReady:_vcRowOnPlayerReady,onStateChange:_vcRowOnPlayerStateChange}});d.isMute="true"===r,d.forceHD="true"===t[e].getAttribute("data-force-hd"),navigator.userAgent.match(/Trident\/7\./)&&setTimeout(function(){jQuery("#"+a).css("visibility","visible")},500)}}}if(document.querySelector("[data-youtube-video-id]")){var tag=document.createElement("script");tag.setAttribute("src","https://www.youtube.com/iframe_api"),document.body.appendChild(tag)}jQuery(document).ready(function(t){if(!t("body").hasClass("vc_editor")){if(navigator.userAgent.match(/(Mobi|Android)/))return void t(".gambit_video_inner").attr("style","display: none !important");t(".gambit_video_row").each(function(){var e=t(document.gambitFindElementParentRow(t(this)[0]));e.addClass("gambit_has_video_bg");var i=t("<div></div>").addClass("gambit_video_inner").css("opacity",Math.abs(parseFloat(t(this).attr("data-opacity"))/100));e.css("position","relative"),t(this).children().prependTo(i),i.prependTo(e),i[0].style.zIndex=t(this)[0].style.zIndex}),t("[data-youtube-video-id], [data-vimeo-video-id]").each(function(){var e=t(this);setTimeout(function(){resizeVideo(e)},100)}),t(window).resize(function(){t("[data-youtube-video-id], [data-vimeo-video-id]").each(function(){var e=t(this);setTimeout(function(){resizeVideo(e)},2)})}),t("[data-vimeo-video-id]").each(function(){var e=$f(t(this).find("iframe")[0]),i=t(this),a="true"===t(this).attr("data-mute")||"mute"===t(this).attr("data-mute");e.addEvent("ready",function(t){e=$f(t),a===!0&&e.api("setVolume",0),e.addEvent("playProgress",function(t,e){i.css("visibility","visible")})})})}});