Moved auto height JS to main loop templates