/*jslint browser: true*//*jshint browser:true *//*global  $, Modernizr, confirm */function setExtraAssetsTop(){if(screenSize==="large"||screenSize==="x-large"){var e=$("#extra-assets"),t=$("#top_assets");e.length>0&&t.length>0&&e.css("margin-top",t.outerHeight()+"px")}}function setNavicon(){if(screenSize==="default"||screenSize==="small"){console.log(settingNavicon);var e=$("nav[role=navigation]"),t=$('<a href="#nav-menu" id="menu-trigger" title="Menu" class="navicon">≡≡</a>');e.hide().before(t);t.click(function(n){t.toggleClass("activated");e.slideToggle();n.preventDefault()})}}function getYOffset(){"use strict";return typeof window.pageYOffset=="number"?window.pageYOffset:document.documentElement.scrollTop}function load_images(){"use strict";$("*[data-deferred-load]").each(function(){$(this).find("img").length===0&&$(this).prepend(function(){var e=$(this).data("deferred-load"),t=document.createElement("img");t.src=e;return t})})}function tabit(){"use strict";$(".tabs").each(function(){var e=$(this),t="",n=0;e.addClass("tabbed");e.sections=e.find("> *").not("ul");e.nav=e.find("> ul");n=e.nav.height();if(e.nav.length===0){e.nav=$(".remote-tabs-nav");n=0}if(!e.nav)return;e.navitems=e.nav.find("li");if(window.location.hash){t=window.location.hash.replace("-view","");if(e.nav){e.navitems.removeClass("active");e.nav.find("a[href="+t+"]").parent().addClass("active")}}else{t=e.nav.find("li.active a").hash;t||(t=e.navitems.eq(0).addClass("active").find("a").get(0).hash)}$(t).addClass("activeTab");e.nav.find("a:not(.no-tab)").click(function(t){t.preventDefault();var r=this.hash,i=$(r).parent().find("> *").not("ul"),s=$(this).parent(),o=s.parent().find("li");window.location.hash=r+"-view";s.addClass("active");$(o).not(s).removeClass("active");$(r).addClass("activeTab");e.css("min-height",$(r).height()+n+"px");i.not(r).removeClass("activeTab")})})}var didScroll=!1,touchable=Modernizr.touch;setExtraAssetsTop();window.getComputedStyle||(window.getComputedStyle=function(e){this.el=e;this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;t==="float"&&(t="styleFloat");n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()}));return e.currentStyle[t]?e.currentStyle[t]:null};return this});var screenSize=window.getComputedStyle(document.body,":after").getPropertyValue("content");$("a.trigger").each(function(){"use strict";var e=this.hash,t=$(this);e.split(">").length>1&&(document.width>1e3?e=e.split(">")[0]+" "+e.split(">")[1]:e=e.split(">")[0]);$(e).hide();t.on("click",function(n){$(e).toggle();t.toggleClass("activated");n.preventDefault()})});$(document).on("change",".url-selector",function(){"use strict";window.location=$(this).val()});load_images();tabit();$(document).on("click",".post-admin a",function(){"use strict";var e=$(this),t=e.data("confirm");if(t){t==="use_title"&&(t=e.attr("title"));return confirm(t)}});$(document).on("click touchend",'a[href*="/vote/"]',function(e){"use strict";e.preventDefault();var t=$(this).parent().find(".votes");$.post(this.href,{csrfmiddlewaretoken:$('input[name|="csrfmiddlewaretoken"]').attr("value")},function(e){var n=e.score.score;n<1&&(n="Noted");t.html(n+" ✓")},"json")});$("#comment-list article.toxic header").each(function(){var e=$(this);e.append('<em class="note toxic-message">This comment has been collapsed</em>');e.click(function(){confirm("Are you sure you want to see this? It could get ugly.")&&$(this).parent().toggleClass("toxic")})});$(".datepicker").pickadate();if($(".slideshow").length>0){$(".slideshow").refineSlide({transition:"cubeH",thumbMargin:0,useArrows:!0,transitionDuration:500});var $slideThumbs=$(".rs-thumb-wrap a");$slideThumbs.css("height",$slideThumbs.eq(0).outerWidth()*.65);if($slideThumbs.outerWidth()<80){var $previewer=$('<span class="rs-thumb-viewer"></span>');$(".rs-thumb-wrap").prepend($previewer);$slideThumbs.hover(function(){var e=$(this);e.find("map-canvas").length>0?$previewer.html("map"):$previewer.html(e.html());$previewer.css("left",this.offsetLeft+this.offsetWidth/2).toggle()})}$(".rs-slider").hammer().on("swipeleft",function(){$(".rs-prev").click()});$(".rs-slider").hammer().on("swiperight",function(){$(".rs-next").click()});$(".fullscreen-toggle").click(function(){$(".rs-wrap").toggleClass("rs-fullscreen");$(".rs-thumb-wrap a").css("height",50)})}setTimeout(setExtraAssetsTop,400);