function pasteNewComment(event, link){
	Effect.Fade(link);
  comment_container_id = link.up('li').id;
  new_comment_form_markup = $$('ul.comments').first().next().cloneNode(true);
	new Insertion.After(comment_container_id, new_comment_form_markup.inspect() + new_comment_form_markup.innerHTML + "</div>");
  // OPTIMIZE: change the above 1.5 syntax with Element.insert(comment_container_id, { after: new_comment_form_markup });
  new_comment_form = $(comment_container_id).next();
  new_comment_form.addClassName('comment-reply');

	// hiding notice, warning, and validation messages
	notice_message = new_comment_form.down('.notice');
	notice_message ? notice_message.hide() : null;
	
	warning_message = new_comment_form.down('.warning');
	warning_message ? warning_message.hide() : null;
	
	validation_message = new_comment_form.down('.validation');
	validation_message ? validation_message.hide() : null;
	
	// get hold of the parent_id value
	parent_id = link.getAttribute('rev').match(/.*-(\d*)/)[1];
	new_comment_form.down('input#comment_parent_id').value = parent_id;	
}

/* Generates the form when clicking reply to. */
Event.observe(window, 'load', function(){
	$$('.reply-to a').each( function(link) { 
	  Event.observe(link, 'click', pasteNewComment.bindAsEventListener(this, link) );	
	});
});