/*global jQuery *//*jshint browser:true *//*!* FitVids 1.1** Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com* Credit to Thierry Koblentz -http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/* Released under the WTFPL license - http://sam.zoy.org/wtfpl/**/(function(a){"use strict";a.fn.fitVids=function(b){var c={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var d=document.head||document.getElementsByTagName("head")[0];var e=".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 f=document.createElement("div");f.innerHTML='<p>x</p><style id="fit-vids-style">'+e+"</style>";d.appendChild(f.childNodes[1])}if(b)a.extend(c,b);return this.each(function(){var b=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];if(c.customSelector)b.push(c.customSelector);var d=".fitvidsignore";if(c.ignore)d=d+", "+c.ignore;var e=a(this).find(b.join(","));e=e.not("object object");e=e.not(d);e.each(function(){var b=a(this);if(b.parents(d).length>0)return;if(this.tagName.toLowerCase()==="embed"&&b.parent("object").length||b.parent(".fluid-width-video-wrapper").length)return;if(!b.css("height")&&!b.css("width")&&(isNaN(b.attr("height"))||isNaN(b.attr("width")))){b.attr("height",9);b.attr("width",16)}var c=this.tagName.toLowerCase()==="object"||b.attr("height")&&!isNaN(parseInt(b.attr("height"),10))?parseInt(b.attr("height"),10):b.height(),e=!isNaN(parseInt(b.attr("width"),10))?parseInt(b.attr("width"),10):b.width(),f=c/e;if(!b.attr("id")){var g="fitvid"+Math.floor(Math.random()*999999);b.attr("id",g)}b.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",f*100+"%");b.removeAttr("height").removeAttr("width")})})}})(window.jQuery||window.Zepto);$(document).ready(function(){})