var gSuggestLinkId;
function submitSuggestDtag()
{
  var cur_form = $( 'suggest_dtag_form' );
  if( !validateDtagSuggestionForm() )
  {
    return;
  }
  var params = marshallParams( cur_form );
  ajaxRequest( 'suggestDisciplineTag.dobbb', params, suggestDtagSuccess );
}
function validateDtagSuggestionForm()
{
  return validateString( 'suggestedDisciplineField', 'Suggested Discipline', 1, 255 );
}
function suggestDtagSuccess()
{
  //using alert since the inline receipt might be hidden behind the add a bookmark page.
  alert( 'Your Discipline suggestion was successfully submitted.' );
  hideSuggestDtagForm();
}
function getSuggestDtagForm( divToHoverOver )
{
  gSuggestLinkId = divToHoverOver;
  var url = 'suggestDisciplineTag.dobbb';
  ajaxUpdate( 'suggest_dtag_form_div', url, '', showSuggestDtagForm, failedToLoadSuggestDtagForm, 'get' );
}
function failedToLoadSuggestDtagForm()
{
  setSessionTimeoutReceipt();
}
function showSuggestDtagForm()
{
  if( isMenuOpen() ) //add bookmark
  {
    showSubBox( 'suggest_dtag_form_div', gSuggestLinkId, 'add_bookmark_form' );
  }
  else //edit bookmark
  {
    showBox( 'suggest_dtag_form_div', gSuggestLinkId, 'true' );
  }
  //hack to avoid the rightpanel overlapping my suggest dtag box.
  var theDiv = $( 'suggest_dtag_form_div' );
  //theDiv.style.zIndex = '5100';
  theDiv.style.width = '350px';
  theDiv.style.maxWidth = '350px';
  //theDiv.style.position = 'absolute';
}
function hideSuggestDtagForm()
{
  if( isSubMenuOpen() ) //add bookmark
  {
    hideSubContextMenu();
  }
  else //edit bookmark
  {
    hideContextMenu();
  }
}
function suggestDtagFormOnClick( e )
{
  if (!e) var e = window.event;
  e.cancelBubble = true;
  if( e.stopPropagation ) e.stopPropagation();
  //crying.
}