typeof Wistia=="undefined"&&(Wistia={}),typeof Wistia.VideoEmbed=="undefined"&&(Wistia.VideoEmbed=function(a,b,c,d){var e,f=function(){try{var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(a)return!0}catch(b){if(navigator.mimeTypes["application/x-shockwave-flash"]!=undefined)return!0}return!1}();if(!(navigator.userAgent&&(e=navigator.userAgent.match(/(msie) ([\w.]+)/i))&&e[2]<9)){if(navigator.userAgent.match(/Android/i)!==null)return Wistia.ExternalVideoEmbed(a,b,c,d);if(f)return;return Wistia.Html5VideoEmbed(a,b,c,d)}},Wistia.Html5VideoEmbed=function(a,b,c,d){var e=document.createElement("video");e.id=a+"_html5",e.width=e.style.width=b,e.height=e.style.height=c,e.preload="none",d.autoLoad&&(e.preload="auto"),d.autoPlay&&(e.autoplay=!0),e.controls="controls",e.poster=d.stillUrl;var f=document.createElement("source");f.src=d.videoUrl.replace(/\.bin$/,"")+"/file.mp4",f.type="video/mp4",e.appendChild(f);var g=document.getElementById(a),h=g.parentNode;h.replaceChild(e,g);return Wistia.VideoTracker(e,d)},Wistia.ExternalVideoEmbed=function(a,b,c,d){var e=document.createElement("div"),f=document.createElement("img"),g=document.createElement("a"),h=d.stillUrl.replace(/\.bin$/,".jpg?image_play_button=1");f.src=h,f.width=f.style.width=b,f.height=f.style.height=c,g.href=d.videoUrl,g.appendChild(f),e.id=a+"_android",e.width=e.style.width=b,e.height=e.style.height=c,e.appendChild(g);var i=document.getElementById(a),j=i.parentNode;j.replaceChild(e,i)}),typeof Wistia.VideoTracker=="undefined"&&(Wistia.VideoTracker=function(a,b){var c=function(){k&&e("update");if(m.length!=0){var a=q+m.join(",")+r;d(Wistia.Base64.encode(a)),m=[]}},d=function(a){var b=window.XDomainRequest?new window.XDomainRequest:new window.XMLHttpRequest;b.open("POST",l+"?data="+a,!0),b.send()},e=function(b){var d=parseInt(a.currentTime*10)/10,e=(new Date).getTime()-u;m.push("{key:'"+b+"',value:"+d+",timeDelta:"+e+"}"),(b=="initialized"||b=="end")&&c()},f=function(){k=!0,s=a.currentTime,t=(new Date).getTime(),e("play")},g=function(){k&&h()&&(e("seek"),e("play")),s=a.currentTime,t=(new Date).getTime()},h=function(){if(s==null||t==null)return!1;var b=(new Date).getTime()-t-(a.currentTime-s)*1e3;return Math.abs(b)>5e3},i=function(){var a=document.cookie.split("; ");for(var b=0;b<a.length;b++){var c=a[b].split("=");if(c[0]=="__distillery")return c[1]}},j=function(){var a=(new Date).getTime().toString()+"-"+Math.random(),b=new Date;b.setTime(b.getTime()+31536e6),document.cookie="__distillery="+a+"; "+"expires="+b.toGMTString()+"; "+"path=/";return a},k=!1,l=b.distilleryUrl,m=[],n=(b.transmitInterval||10)*1e3,o=i()||j(),p=(new Date).getTime().toString()+"e"+Math.random(),q="{account_key:'"+b.accountKey+"',"+"session_id:'"+o+"',"+"media_id:'"+b.mediaId+"',"+"event_key:'"+p+"',"+"media_duration:"+parseFloat(b.mediaDuration)+","+"referrer:'"+window.location.href+"',"+"event_details:[",r="]}",s=null,t=null,u=(new Date).getTime();a.addEventListener("pause",function(){k=!1,e("pause")},!1),a.addEventListener("play",function(){f()},!1),a.addEventListener("timeupdate",function(){g()},!1),a.addEventListener("ended",function(){e("end"),a.pause()},!1),setTimeout(function(){setInterval(c,n),c()},Math.random()*n+1e3),e("initialized");return{video:a,visitorId:o,eventId:p}}),typeof Wistia.Base64=="undefined"&&(Wistia.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b="",c,d,e,f,g,h,i,j=0;a=Wistia.Base64._utf8_encode(a);while(j<a.length)c=a.charCodeAt(j++),d=a.charCodeAt(j++),e=a.charCodeAt(j++),f=c>>2,g=(c&3)<<4|d>>4,h=(d&15)<<2|e>>6,i=e&63,isNaN(d)?h=i=64:isNaN(e)&&(i=64),b=b+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h)+this._keyStr.charAt(i);return b},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");var b="";for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);d<128?b+=String.fromCharCode(d):d>127&&d<2048?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(d&63|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(d&63|128))}return b}})
