var _IDStamp=0;function TreeMenuItem(B,C,A){this.caption=B;this.link=C;this.CSSclass=A;this.ID=_IDStamp++;this.ref=null;this.closed=true;this.pxTop=null;this.pxRight=null;this.children=new Array();this.appendItem=function(E){var D=this.children.length;this.children[D]=E;this.children[D].ref=this.ref+"children["+D+"]";this.link=null}}function GetNodeHTML(I,J,K,D,M){var L="";var A="";var G=MenuItem_height;var F=MenuItem_width;var E=MenuItem_valign;if(D>0){A="sub";G=SubmenuItem_height;F=SubmenuItem_width;E=SubmenuItem_valign}var B="";if(D>0){B="<td style='height: "+G+"; vertical-align: "+E+"'><div style='width: "+pxIndent+"px;'>&nbsp;</div></td>";if(ShowBranches){B="<td style='height: "+G+"; vertical-align: "+E+"; background-repeat: repeat-x; background-image: url("+IconsFolder+"/-.gif);'><div style='width: "+pxIndent+"px;'>&nbsp;</div></td>"}}var H="<td style='height: "+G+"; vertical-align: "+E+";'><div style='width: "+IndentBetweenIconAndCaption+"px;'>&nbsp;</div></td>";L+="<table border='0' cellpadding='0' cellspacing='0'>";if(I.children.length==0){L+="<tr>";L+=B;L+="<td style='height: "+G+"; vertical-align: "+E+";'><img src='"+IconsFolder+"/Leaf.gif'></td>";L+=H;L+="<td style='height: "+G+"; vertical-align: "+E+";'>";if(I.link!=null){if(I.link.indexOf("javascript:")!=0){L+="<a style='display: block; width: "+F+";' class='"+I.CSSclass+"' href=\""+I.link+'" onmouseover="Just.DocumentMouseClick();">'+I.caption+"</a>"}else{L+="<a style='cursor: default; display: block; width: "+F+";' class='"+I.CSSclass+"' href='#' onclick=\"Just.StopEventPropagation(event);\" onmouseover=\""+I.link.substr(11)+'">'+I.caption+"</a>"}}else{L+="<div style='width: "+F+";' class='"+I.CSSclass+"'>"+I.caption+"</div>"}L+="</td>";L+="</tr>"}else{if(I.ID==J){I.closed=!I.closed}else{if(K==D){I.closed=true}}L+="<tr>";L+=B;L+="<td style='height: "+G+"; vertical-align: "+E+";'><img src='"+IconsFolder+"/"+(I.closed?"ClosedNode.gif":"OpenedNode.gif")+"'></td>";L+=H;L+="<td style='height: "+G+"; vertical-align: "+E+";'>";L+="<a style='display: block; width: "+F+";' class='"+I.CSSclass+"' href=\"javascript:DrawTreeMenu("+M+", "+I.ID+", "+(AutoCollapseSameDepthMenuItems?D:-1)+')" onmouseover="Just.DocumentMouseClick();">'+I.caption+"</a>";L+="</td>";L+="</tr>";if(!I.closed){for(var C=0;C<I.children.length;C++){L+="<tr>";if(D>0){L+="<td style='height: "+SubmenuItem_height+"; vertical-align: "+SubmenuItem_valign+";'><div style='width: "+pxIndent+"px;'>&nbsp;</div></td>"}if(ShowBranches){if(C!=I.children.length-1){L+="<td style='height: "+SubmenuItem_height+"; vertical-align: "+SubmenuItem_valign+"; background-repeat: repeat-y; background-image: url("+IconsFolder+"/I.gif);'><img src='"+IconsFolder+"/T.gif'></td>"}else{L+="<td style='height: "+SubmenuItem_height+"; vertical-align: "+SubmenuItem_valign+";'><img src='"+IconsFolder+"/L.gif'></td>"}}else{L+="<td style='height: "+SubmenuItem_height+"; vertical-align: "+SubmenuItem_valign+";'><div style='width: "+BranchWidth+";'></div></td>"}if(ShowBranches){L+="<td style='height: "+SubmenuItem_height+"; vertical-align: "+SubmenuItem_valign+"; background-repeat: repeat-x; background-image: url("+IconsFolder+"/-.gif);'><div style='width: "+IndentBetweenIconAndCaption+"px;'>&nbsp;</div></td>"}else{L+="<td style='height: "+SubmenuItem_height+"; vertical-align: "+SubmenuItem_valign+";'><div style='width: "+IndentBetweenIconAndCaption+"px;'>&nbsp;</div></td>"}L+="<td style='height: "+SubmenuItem_height+"; vertical-align: "+SubmenuItem_valign+";'>";L+=GetNodeHTML(I.children[C],J,K,D+1,M);L+="</td>";L+="</tr>"}}}L+="</table>";return L}function ExpandTree(B){B.closed=false;for(var A=0;A<B.children.length;A++){ExpandTree(B.children[A])}}function CollapseTree(B){B.closed=true;for(var A=0;A<B.children.length;A++){CollapseTree(B.children[A])}}function DrawTreeMenu(A,D,C){var B="";if(DrawDepthZero){B+=GetNodeHTML(A,D,C,0,A.ref)}else{for(i=0;i<A.children.length;i++){B+=GetNodeHTML(A.children[i],D,C,0,A.ref)}}document.getElementById("TreeMenu").innerHTML=B}function CreateTreeMenu(A){if(ShowBranches){MenuItem_valign="top";SubmenuItem_valign="top"}LoadImages(["OpenedNode.gif"],IconsFolder+"/");DrawTreeMenu(A,null,null)};