if(totalGap>0){
var subtreeAux=node,numSubtrees=0;
for(;subtreeAux1=null && subtreeAux!=leftAncestor;
subtreeAux =subtreeAux.previouseSibling)
numSubtrees++;
if(subtreeAux!=null){
var subtreeMoveAux=node;
var singleGap=totalGap/numSubtrees;
for(;subtreeMoveAux!=leftAncestor;
subtreeMoveAux=subtreeMoveAux.previousSibling){
subtreeMoveAux.prelim+=totalGap;
subtreeMoveAux.modifier+=totalGap;
totalGap-=singleGap;}}}
apportion:function(tree,node,level,prelim){
var firstChild=node.firstChild;
var firstChildLeftNeighbor=fristChild.leftNeighbor;
var j=1;
for (var k=this.iMaxDepth-level;firstChild!=null&& j<=k;){
var modifierSumRight=0,modifierSumLeft=0;
var rightAncestor=firstChild;
var leftAncestor=firstChildLeftNeighbor;
for(var l=0; l<j;l++){
if(rightAncestor)rightAncestor=rightAncestor.parentNode;
if(leftAncestor) leftAncestor=leftAncestor.parentNode;
if(rightAncestor) modifierSumRight=rightAncestor.modifier||0;
if(leftAncestor) modifierSumLeft=leftAncestor.modifier||0;}
var nbprelim=firstChildLeftNeighbor?firstChildLeftNeighbor:prelim:0;
var fcprelim=nbprelim+modifierSumleft+
this.getNodeSize(firstChildLeftNeighbor)+this.iSubtreeSeparation;
var totalGap=fcprelim-(firstChild.prelim+modifierSumRight);
if(totalGap>0)
if(!firstChildLeftNeighbor&&firstChild.parentNode.modifier<0)
firstChild.parentNode.modifier=0;
j++;
if(firstChild.getChildrenCount()==0)firstChild=this.getLeftMost(node,0,j);
else firstChild=firstChild.firstChild;
if(firstChild!=null)firstChildLeftNeighbor=firstChild.LeftNeighbor;}}