(function($) {

/* ------------------ Back To Top ------------------- */
jQuery(document).ready(function($){

  jQuery('#under-footer-back-to-top a').click(function(){
    jQuery('html, body').animate({scrollTop:0}, 300); 
    return false; 
  });

}); 

/* -------------------- Isotope --------------------- */
function layoutPhotoWall(container_name) {
  $(container_name).imagesLoaded(function() {
    
    var $container = $(container_name);
    $container.isotope({
      // options...
      resizable: false, // disable normal resizing
      // set columnWidth to a percentage of container width
      masonry: { columnWidth: $container.width() / 12 },
      itemSelector : '.item'
    });

    // update columnWidth on window resize
    $(window).smartresize(function(){
      $container.isotope({
        // update columnWidth to a percentage of container width
        masonry: { columnWidth: $container.width() / 12 }
      });
    });
  });  
}

jQuery(document).ready(function(){
  layoutPhotoWall('#wall');
  layoutPhotoWall('.extra-wall'); /* Sigh */
});


/* -------------------- Width Functions --------------------- */

jQuery(document).ready(function($){
  
  widthFunctions();

});

$(window).bind("resize", widthFunctions);

function widthFunctions(e) {
  var winHeight = $(window).height();
  var winWidth = $(window).width();

  if (winWidth < 980 && winWidth > 767) {
    
    if($("#wall").width()) {
      
      if($("#wall.item").hasClass("span3")) {

        $("#wall.item").removeClass("span3");
        $("#wall.item").addClass("span4");

      }
      
    }
    
    if($(".lr-page").hasClass("span4 offset4")) {

      
      $(".lr-page").removeClass("span4 offset4");
      $(".lr-page").addClass("span6 offset3");
      
      $("#page-title").removeClass("span4 offset4");
      $("#page-title").addClass("span6 offset3");
    }
            
  } else {
    
    if($("#wall").width()) {
      
      if($(".item").hasClass("span4")) {

        $("#wall.item").removeClass("span4");
        $("#wall.item").addClass("span3");

      }
      
    }
    
    if($(".lr-page").hasClass("span6 offset3")) {
      
      $(".lr-page").removeClass("span6 offset3");
      $(".lr-page").addClass("span4 offset4");
      
      $("#page-title").removeClass("span6 offset3");
      $("#page-title").addClass("span4 offset4");
    }
      
  }
  
}

/* -------------------- Misc Functions --------------------- */

$(function () {

  $('#related-entities-toggle').click(function(){
    $('.extra-related-entity').slideToggle();
    $('#related-entities-toggle').hide();
  });

});

})(jQuery);
@@ -1410,39 +1410,32 @@
 ll%22).width()) %7B%0A
-      %0A
       if($(%22#wal
@@ -1460,25 +1460,24 @@
 %22span3%22)) %7B%0A
-%0A
         $(%22#
@@ -1557,299 +1557,21 @@
 %22);%0A
-%0A
       %7D
-%0A      %0A    %7D%0A    %0A    if($(%22.lr-page%22).hasClass(%22span4 offset4%22)) %7B%0A%0A      %0A      $(%22.lr-page%22).removeClass(%22span4 offset4%22);%0A      $(%22.lr-page%22).addClass(%22span6 offset3%22);%0A      %0A      $(%22#page-title%22).removeClass(%22span4 offset4%22);%0A      $(%22#page-title%22).addClass(%22span6 offset3%22);
+      
 %0A   
@@ -1627,31 +1627,24 @@
 .width()) %7B%0A
-      %0A
       if($(%22
@@ -1672,17 +1672,16 @@
 n4%22)) %7B%0A
-%0A
         
@@ -1761,17 +1761,16 @@
 pan3%22);%0A
-%0A
       %7D%0A
@@ -1777,298 +1777,10 @@
     
-  %0A    %7D%0A    %0A    if($(%22.lr-page%22).hasClass(%22span6 offset3%22)) %7B%0A      %0A      $(%22.lr-page%22).removeClass(%22span6 offset3%22);%0A      $(%22.lr-page%22).addClass(%22span4 offset4%22);%0A      %0A      $(%22#page-title%22).removeClass(%22span6 offset3%22);%0A      $(%22#page-title%22).addClass(%22span4 offset4%22);%0A    %7D%0A      
+%7D%0A
 %0A  %7D

Remove unused JS code from template, related to resize handling