/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
* 
* @copyright see www.blueshoes.org
* @author    Samuel Blume <sam at blueshoes dot org>
* @author    Andrej Arn <andrej at blueshoes dot org>
*/function Bs_Tree(instanceName) {this.autoCollapse      = false;this.preloadDown       = -1;this.captionBgColor    = "yellow";this.showPseudoElement = false;this.useCheckboxSystem = false;this.checkboxSystemWalkTree = 3;this.checkboxSystemIfPartlyThenFull = true;this.checkboxSystemImgDir;this.checkboxSystemGuiNochange;this.imageDir = 'images/img/win98/';this.useFolderIcon = true;this.useLeaf = true;this.walkTree = true;this.useAutoSequence = true;this._clearingHouse = new Array;this._instanceName;this._pseudoElement;this._currentActiveElement;this._elementSequence = 0;this._errorArray;this.initByArray = function(arr) {for (var i=0; i<arr.length; i++) {var e = this._createTreeElement(arr[i], 1);if (e == false) {return false;}
this._pseudoElement.addChild(e);}
return true;}
this._createTreeElement = function(arr, level) {var e = new Bs_TreeElement();var status = e.initByArray(arr, this, level);if (!status) {this._addError(e.getLastError());return false;}
this._clearingHouse[e.id] = e;if (arr['children']) {for (var i=0; i<arr['children'].length; i++) {var newE = this._createTreeElement(arr['children'][i], level +1);if (!newE) return false;e.addChild(newE);}
}
return e;}
this.getElement = function(elementId) {if (elementId == 0) return this._pseudoElement;if (typeof(this._clearingHouse[elementId]) == 'object') {return this._clearingHouse[elementId];} else {return false;}
}
this.draw = function() {var content = this._pseudoElement.render();document.writeln(content[0]);eval(content[1]);}
this.drawInto = function(id) {var content = this._pseudoElement.render();var e       = document.getElementById(id);if (e) {e.innerHTML = content[0];eval(content[1]);}
}
this.toHtml = function() {return this._pseudoElement.render();}
this.executeOnElement = function(id, func, params) {if (this._clearingHouse[id]) {if (this._clearingHouse[id][func]) {if (params) {switch (params.length) {case 1:
return this._clearingHouse[id][func](params[0]);break;case 2:
return this._clearingHouse[id][func](params[0], params[1]);break;case 3:
return this._clearingHouse[id][func](params[0], params[1], params[2]);break;case 4:
return this._clearingHouse[id][func](params[0], params[1], params[2], params[3]);break;}
} else {return this._clearingHouse[id][func]();}
}
}
return;}
this.getJavascriptCode = function() {return this._pseudoElement.getJavascriptCode('a', true);}
this.elementToggleOpenClose = function(id) {this._clearingHouse[id].toggleOpenClose();}
this.elementOpen = function(id) {this._clearingHouse[id].open();}
this.elementClose = function(id) {this._clearingHouse[id].close();}
this.elementCheckboxEvent = function(id, value) {this._clearingHouse[id].checkboxEvent(value);}
this._addError = function(str) {if (typeof(this._errorArray) == 'undefined') {this._errorArray = new Array(str);} else {this._errorArray[this._errorArray.length] = str;}
}
this.getLastError = function() {if (typeof(this._errorArray) != 'undefined') {if (this._errorArray.length > 0) {return this._errorArray[this._errorArray.length -1];}
}
return false;}
if (!instanceName) {instanceName = 't';}
this._instanceName = instanceName;var a = new Array;a['id']               = 'pseudoElement001';a['caption']          = "root";a['url']              = "";a['target']           = "";a['isOpen']           = true;this._pseudoElement = this._createTreeElement(a, 0);}
