+/**
+ * $advanced_tree and is a boolean var which is default set to default
+ * SM behaviour.
+ * Setting $advanced tree to true causes SM to display a experimental
+ * mailbox-tree with dhtml behaviour.
+ * It only works on browsers which supports css and javascript. The used
+ * javascript is experimental and doesn't support all browsers.
+ * It has been tested on IE6 an Konquerer 3.0.0-2.
+ * It is now tested and working on: (please test and update this list)
+ * Windows: IE 5.5 SP2, IE 6 SP1, Gecko based (Mozilla, Firebird) and Opera7
+ * XWindow: ?
+ * Mac: ?
+ * In the function ListAdvancedBoxes there is another var $use_folder_images.
+ * setting this to true is only usefull if the images exists in ../images.
+ *
+ * Feel free to experiment with the code and report bugs and enhancements
+ **/
+
+/* set this to true if you want to see a nicer mailboxtree */
+if (empty($advanced_tree)) {
+ $advanced_tree=false;
+}
+
+if ($advanced_tree) {
+$xtra .= '<script language="Javascript" type="text/javascript">'."\n".
+'<!--'."\n".
+' function preload() {'."\n".
+' if (document.images) {'."\n".
+' var treeImages = new Array;'."\n".
+' var arguments = preload.arguments;'."\n".
+' for (var i = 0; i<arguments.length; i++) {'."\n".
+' treeImages[i] = new Image();'."\n".
+' treeImages[i].src = arguments[i];'."\n".
+' }'."\n".
+' }'."\n".
+' }'."\n".
+'var vTreeImg;'."\n".
+'var vTreeDiv;'."\n".
+'var vTreeSrc;'."\n".
+' function fTreeTimeout() {'."\n".
+' if (vTreeDiv.readyState == "complete")'."\n".
+' vTreeImg.src = vTreeSrc;'."\n".
+' else'."\n".
+' setTimeout("fTreeTimeout()", 100);'."\n".
+' }'."\n".
+' function hidechilds(img) {'."\n".
+' id = img.id + ".0000";'."\n".
+' form_id = "mbx[" + img.id +"F]";'."\n".
+' if (document.all) { //IE, Opera7'."\n".
+' div = document.all[id];'."\n".
+' if (div) {'."\n".
+' if (div.style.display == "none") {'."\n".
+' vTreeSrc = "../images/minus.png";'."\n".
+' style = "block";'."\n".
+' value = 0;'."\n".
+' }'."\n".
+' else {'."\n".
+' vTreeSrc = "../images/plus.png";'."\n".
+' style = "none";'."\n".
+' value = 1;'."\n".
+' }'."\n".
+' vTreeImg = img;'."\n".
+' vTreeDiv = div;'."\n".
+' if (typeof vTreeDiv.readyState != "undefined") //IE'."\n".
+' setTimeout("fTreeTimeout()",100);'."\n".
+' else //Non IE'."\n".
+' vTreeImg.src = vTreeSrc;'."\n".
+' div.style.display = style;'."\n".
+' document.all[form_id].value = value;'."\n".
+' }'."\n".
+' }'."\n".
+' else if (document.getElementById) { //Gecko'."\n".
+' div = document.getElementById(id);'."\n".
+' if (div) {'."\n".
+' if (div.style.display == "none") {'."\n".
+' src = "../images/minus.png";'."\n".
+' style = "block";'."\n".
+' value = 0;'."\n".
+' }'."\n".
+' else {'."\n".
+' src = "../images/plus.png";'."\n".
+' style = "none";'."\n".
+' value = 1;'."\n".
+' }'."\n".
+' div.style.display = style;'."\n".
+' img.src = src;'."\n".
+' document.getElementById(form_id).value = value;'."\n".
+' }'."\n".
+' }'."\n".
+' }'."\n".
+' function buttonover(el,on) {'."\n".
+' if (!on) {'."\n".
+"// el.style.borderColor=\"$color[9]\";}\n".
+" el.style.background=\"$color[0]\";}\n".
+' else {'."\n".
+" el.style.background=\"$color[9]\";}\n".
+' }'."\n".
+' function buttonclick(el,on) {'."\n".
+' if (!on) {'."\n".
+' el.style.border="groove";}'."\n".
+' else {'."\n".
+' el.style.border="ridge";}'."\n".
+' }'."\n".
+' function hideframe(hide) {'."\n".
+' left_size = "' . $left_size . '";'."\n".
+' if (document.all) {'."\n".
+' masterf = window.parent.document.all["fs1"];'."\n".
+' leftf = window.parent.document.all["left"];'."\n".
+' leftcontent = document.all["leftframe"];'."\n".
+' leftbutton = document.all["showf"];'."\n".
+' } else if (document.getElementById) {'."\n".
+' masterf = window.parent.document.getElementById("fs1");'."\n".
+' leftf = window.parent.document.getElementById("left");'."\n".
+' leftcontent = document.getElementById("leftframe");'."\n".
+' leftbutton = document.getElementById("showf");'."\n".
+' } else {'."\n".
+' return false;'."\n".
+' }'."\n".
+' if(hide) {'."\n".
+' new_col = calc_col("20");'."\n".
+' masterf.cols = new_col;'."\n".
+' document.body.scrollLeft=0;'."\n".
+' document.body.style.overflow="hidden";'."\n".
+' leftcontent.style.display = "none";'."\n".
+' leftbutton.style.display="block";'."\n".
+' } else {'."\n".
+' masterf.cols = calc_col(left_size);'."\n".
+' document.body.style.overflow="";'."\n".
+' leftbutton.style.display="none";'."\n".
+' leftcontent.style.display="block";'."\n".
+' }'."\n".
+' }'."\n".
+' function calc_col(c_w) {'."\n";
+
+ if ($location_of_bar == 'right') {
+ $xtra .= ' right=true;';
+ } else {
+ $xtra .= ' right=false;';
+ }
+ $xtra .= "\n";
+
+$xtra .= 'if (right) {'."\n".
+" new_col = '*,'+c_w;"."\n".
+' } else {'."\n".
+" new_col = c_w+',*';"."\n".
+' }'."\n".
+' return new_col;'."\n".
+' }'."\n".
+' function resizeframe(direction) {'."\n".
+' if (document.all) {'."\n".
+' masterf = window.parent.document.all["fs1"];'."\n".
+' } else if (document.getElementById) {'."\n".
+' window.parent.document.getElementById("fs1");'."\n".
+' } else {'."\n".
+' return false;'."\n".
+' }'."\n";
+
+ if ($location_of_bar == 'right') {
+ $xtra .= ' colPat=/^\*,(\d+)$/;';
+ } else {
+ $xtra .= ' colPat=/^(\d+),.*$/;';
+ }
+ $xtra .= "\n";
+
+$xtra .= 'old_col = masterf.cols;'."\n".
+' colPat.exec(old_col);'."\n".
+' if (direction) {'."\n".
+' new_col_width = parseInt(RegExp.$1) + 25;'."\n".
+' } else {'."\n".
+' if (parseInt(RegExp.$1) > 35) {'."\n".
+' new_col_width = parseInt(RegExp.$1) - 25;'."\n".
+' }'."\n".
+' }'."\n".
+' masterf.cols = calc_col(new_col_width);'."\n".
+' }'."\n".
+'//-->'."\n".
+'</script>'."\n";
+
+/* style definitions */
+
+$xtra .= '<style type="text/css">'."\n".
+'<!--'."\n".
+' body {'."\n".
+' margin: 0px 0px 0px 0px;'."\n".
+' padding: 5px 5px 5px 5px;'."\n".
+' }'."\n".
+' .button {'."\n".
+' border:outset;'."\n".
+" border-color: $color[9];\n".
+" background:$color[0];\n".
+" color:$color[6];\n".
+' width:99%;'."\n".
+' heigth:99%;'."\n".
+' }'."\n".
+' .mbx_par {'."\n".
+' font-size:1.0em;'."\n".
+' margin-left:4px;'."\n".
+' margin-right:0px;'."\n".
+' }'."\n".
+' a.mbx_link {'."\n".
+' text-decoration: none;'."\n".
+" background-color: $color[0];\n".
+' display: inline;'."\n".
+' }'."\n".
+' a:hover.mbx_link {'."\n".
+" background-color: $color[9];\n".
+' }'."\n".
+' a.mbx_link img {'."\n".
+' border-style: none;'."\n".
+' }'."\n".
+' .mbx_sub {'."\n".
+' padding-left:5px;'."\n".
+' padding-right:0px;'."\n".
+' margin-left:4px;'."\n".
+' margin-right:0px;'."\n".
+' font-size:0.9em;'."\n".
+' }'."\n".
+' .par_area {'."\n".
+' margin-top:0px;'."\n".
+' margin-left:4px;'."\n".
+' margin-right:0px;'."\n".
+' padding-left:10px;'."\n".
+' padding-bottom:5px;'."\n".
+' border-left: solid;'."\n".
+' border-left-width:0.1em;'."\n".
+" border-left-color:$color[9];\n".
+' border-bottom: solid;'."\n".
+' border-bottom-width:0.1em;'."\n".
+" border-bottom-color:$color[9];\n".
+' display: block;'."\n".
+' }'."\n".
+' .mailboxes {'."\n".
+' padding-bottom:3px;'."\n".
+' margin-right:4px;'."\n".
+' padding-right:4px;'."\n".
+' margin-left:4px;'."\n".
+' padding-left:4px;'."\n".
+' border: groove;'."\n".
+' border-width:0.1em;'."\n".
+" border-color:$color[9];\n".
+" background: $color[0];\n".
+' }'."\n".
+'-->'."\n".
+'</style>'."\n";
+}