$(function(){
    // Find all the "reply to" links and bind to the click event
    $('.comment-container a.button').click(function() {
      var button = $(this);
      var url_array = $(this)    // The anchor object
        .attr('href')    // Fetch the value of the href attribute
        .split("/");    // Divide into chunks, using / as the divider

      var id = url_array[4];    // We want the fourth chunk

      // Change the value of weever-parent-id
      $('#weever-parent-id').val(id);
      
      // Now we'll move the form
      $('form#comment_form')
        .insertAfter(button);
      return false;
    });
  });