
function GetChildKeywordSelect(keyword_id, return_results_html_element_id, child_num)
{
  new Ajax.Request('/tcrdb/AJAX_handlers/fetch_child_keyword_drop.asp?kw_id=' + keyword_id + '&c=' + child_num, {
    method: 'get',
    onLoading: function(){
      $(return_results_html_element_id).innerHTML="<img src=\"/images/loading.gif\">&nbsp;Loading...';"
    },
    onSuccess: function(transport){
      $(return_results_html_element_id).innerHTML=transport.responseText;
      }
    });
}

function load_branch_for(parent_keyword_id, cbn, boolExclude)
{
  var the_src = $('plus_minus_' + parent_keyword_id).src;
  
  if (the_src.indexOf('minus.gif')!=-1)
  {
    $('children_of_' + parent_keyword_id).style.display = 'none';
    $('plus_minus_' + parent_keyword_id).src="/images/plus.gif";
  }
  else
  {
    if ($('fetched_' + parent_keyword_id).value==1)
    {
      $('children_of_' + parent_keyword_id).style.display = 'block';
      $('plus_minus_' + parent_keyword_id).src="/images/minus.gif";
    }
    else
    {
      $('fetched_' + parent_keyword_id).value = 1;
      if (boolExclude==true)
      {
        var str = '&ex=1';
      }
      else
      {
        var str = '&ex=0';
      }
      new Ajax.Request('/tcrdb/AJAX_handlers/fetch_child_keyword_branch.asp?kw_id=' + parent_keyword_id + '&cbn=' + cbn + str, {
        method: 'get',
        onLoading: function(){
          $('plus_minus_' + parent_keyword_id).src="/images/loading_tiny.gif";
        },
        onSuccess: function(transport){
          $('plus_minus_' + parent_keyword_id).src="/images/minus.gif";
          $('children_of_' + parent_keyword_id).innerHTML=transport.responseText;
          }
        });
    }
  }
}
