
function initCitationSearchbox(selector) {
  var citationText = "Paste or enter a citation";
  var textbox = $(selector + ' input#citation-searchbox');
	$(textbox).val(citationText);
	
	$(selector + ' form').submit(function() {
	  if ($(textbox).val().match(citationText)) {
	    $(textbox).val("");
	  }
	});
	
  $(textbox).click(function() {
    if ($(this).val().match(citationText)) {
      $(this).val("");
      $(this).removeClass("greyed");
    }
  });
  
  $(textbox).blur(function() {
    if (!$(this).val()) {
      $(this).val(citationText);
      $(this).addClass("greyed");
    }
  });
  
  $("#tabsearch-citation-help").toggle(function() {
    $("#citation-search-help-more").show();
    $("#tabsearch-citation-help").text($(this).text().replace(/Show/, 'Hide'));
   }, function() {
     $("#citation-search-help-more").hide();
     $("#tabsearch-citation-help").text($(this).text().replace(/Hide/, 'Show'));
   });
}