showTopicCheck = function() {
  $('topic_label').update('Paste in the full URL of the topic you\'ll merge this topic into:');
  $('selected_topic_result').hide();
  $('topic').show();
  $('topic_example').show();
  $('change_authoritative_topic_id').setValue(null);
}

showTopicSearch = function() {
  $('search_label').update('Search for the topic you\'ll merge this topic into:');
  $('selected_result').hide();
  $('search').show();
  $('change_authoritative_topic_id').setValue(null);
}

showInlineTopic = function(link, title, details, topic_url, user_name, emotion) {
  $('inline_topic').down('a.title').update(title).setAttribute('href', topic_url);
  $('inline_topic').down('.details').update(details);
  $('inline_topic').down('.name').update('Created by '+user_name);
  $('inline_topic').dockTo(link, {target_point: 'bl', offset_type: 'positionedOffset'})
  $('inline_topic').autoHide();
}

document.observe("dom:loaded", function() {
  var query_field = $('raw_query');

  if (query_field) {
    query_field.observe("focus", function(){
      $$('.search_results').invoke("show");
    });
  }
});