<!--

function showBranch(branch){
  var objBranch = document.getElementById(branch).style;
  if(objBranch.display!="none")
    objBranch.display="none";
  else
    objBranch.display="block";
}

function swapFolder(img, toggle_plus, toggle_minus){
  objImg = document.getElementById(img);
  if(objImg){
    indexPlus = objImg.src.indexOf(toggle_plus);
    if(indexPlus > -1){
      srcBase = objImg.src.substring(0,indexPlus);
      objImg.src = srcBase + toggle_minus;
    }
    else{
      indexMinus = objImg.src.indexOf(toggle_minus);
      srcBase = objImg.src.substring(0,indexMinus);
      objImg.src = srcBase + toggle_plus;
    }
  }
}
/**
 * Blank the search form input only if there isn't any ongoing search.
 */
function blankSearchFormInput(previousSearchValue, formElem) {
    if (previousSearchValue == '') {
        formElem.value = '';
    }
}

/**
 * Return whether the search form is empty or not.
 * This script is to be used to avoid to request a search for an empty request,
 * to save the server from useless load.
 */
function checkEmptySearch(formElem) {
    var query = trim(formElem.SearchableText.value);
    if (query != '') {
        formElem.SearchableText.value = query;
        return true;
    }
    formElem.SearchableText.value = query;
    formElem.SearchableText.focus();
    return false;
}

/**
 * Return a copy of the string with leading and trailing characters removed.
 */
function trim(s) {
    if (s) {
        return s.replace(/^\s*|\s*$/g, "");
    }
    return "";
}

//-->