(function(e){"use strict";e.fn.fitvids=function(t){var n={customselector:null,ignore:null};if(!document.getelementbyid("fit-vids-style")){var r=document.head||document.getelementsbytagname("head")[0];var i=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}";var s=document.createelement("div");s.innerhtml='

x

";r.appendchild(s.childnodes[1])}if(t){e.extend(n,t)}return this.each(function(){var t=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];if(n.customselector){t.push(n.customselector)}var r=".fitvidsignore";if(n.ignore){r=r+", "+n.ignore}var i=e(this).find(t.join(","));i=i.not("object object");i=i.not(r);i.each(function(){var t=e(this);if(t.parents(r).length>0){return}if(this.tagname.tolowercase()==="embed"&&t.parent("object").length||t.parent(".fluid-width-video-wrapper").length){return}if(!t.css("height")&&!t.css("width")&&(isnan(t.attr("height"))||isnan(t.attr("width")))){t.attr("height",9);t.attr("width",16)}var n=this.tagname.tolowercase()==="object"||t.attr("height")&&!isnan(parseint(t.attr("height"),10))?parseint(t.attr("height"),10):t.height(),i=!isnan(parseint(t.attr("width"),10))?parseint(t.attr("width"),10):t.width(),s=n/i;if(!t.attr("id")){var o="fitvid"+math.floor(math.random()*999999);t.attr("id",o)}t.wrap('
').parent(".fluid-width-video-wrapper").css("padding-top",s*100+"%");t.removeattr("height").removeattr("width")})})}})(window.jquery||window.zepto)