!function(a){a(function(){a("section [href^=#]").click(function(j){j.preventDefault()});window.prettyPrint&&prettyPrint();a(".add-on :checkbox").on("click",function(){var j=a(this),k=j.attr("checked")?"addClass":"removeClass";a(this).parents(".add-on")[k]("active")});if(a(".twipsies a").length){a(window).on("load resize",function(){a(".twipsies a").each(function(){a(this).tooltip({placement:a(this).attr("title"),trigger:"manual"}).tooltip("show")})})}if(a("#grid-system").length){a("#grid-system").tooltip({selector:".show-grid > div",title:function(){return a(this).width()+"px"}})}var i=a(window),b=a(".subnav"),e=a(".subnav").length&&a(".subnav").offset().top-40,g=0;d();i.on("scroll",d);function d(){var j,k=i.scrollTop();if(k>=e&&!g){g=1;b.addClass("subnav-fixed")}else{if(k<=e&&g){g=0;b.removeClass("subnav-fixed")}}}a(".tooltip-demo.well").tooltip({selector:"a[rel=tooltip]"});a(".tooltip-test").tooltip();a(".popover-test").popover();a("a[rel=popover]").popover().click(function(j){j.preventDefault()});a("#fat-btn").click(function(){var j=a(this);j.button("loading");setTimeout(function(){j.button("reset")},3000)});a("#myCarousel").carousel();var c=a("#components.download input"),f=a("#plugins.download input"),h=a("#variables.download input");a("#components.download .toggle-all").on("click",function(j){j.preventDefault();c.attr("checked",!c.is(":checked"))});a("#plugins.download .toggle-all").on("click",function(j){j.preventDefault();f.attr("checked",!f.is(":checked"))});a("#variables.download .toggle-all").on("click",function(j){j.preventDefault();h.val("")});a(".download-btn").on("click",function(){var k=a("#components.download input:checked").map(function(){return this.value}).toArray(),m=a("#plugins.download input:checked").map(function(){return this.value}).toArray(),l={},j=["glyphicons-halflings.png","glyphicons-halflings-white.png"];a("#variables.download input").each(function(){a(this).val()&&(l[a(this).prev().text()]=a(this).val())});a.ajax({type:"POST",url:"http://bootstrap.herokuapp.com",dataType:"jsonpi",params:{js:m,css:k,vars:l,img:j}})})});a.ajaxTransport("jsonpi",function(d,e,c){var b=d.url;return{send:function(g,j){var f="jQuery_iframe_"+jQuery.now(),h,i;h=a("<iframe>").attr("name",f).appendTo("head");i=a("<form>").attr("method",d.type).attr("action",b).attr("target",f);a.each(d.params,function(m,l){a("<input>").attr("type","hidden").attr("name",m).attr("value",typeof l=="string"?l:JSON.stringify(l)).appendTo(i)});i.appendTo("body").submit()}}})}(window.jQuery);