var g_isDebug = false;			// ENABLE OR DISABLE EVERYTING
var enableLogTime = true;		// old variable. check where it is used and delete it.
var g_maxShiftNumber = 1000;
var g_shift_number = 0;
var dialog = null;
var debugdyn = true;
var debug = g_isDebug;			// variable which must be used in developper's codes
var g_debugTemp = false;

function opendebug()
{ 
// for modification the source cf. testtree.php and debugDomLib.js. 
// and use http://www.sean.co.uk/a/webdesign/javascript_include_file_creator.shtm to create the string
// change root_dir inside the code by '+root_dir+'

	//dialog = window.open("debugger.html","debug"+Math.floor(Math.random()*1000),"height=800,width=500,resizable=yes");
	dialog = window.open("debugger.html","debug","height=1020,width=1020,resizable=yes");
	//if (window.focus) {dialog.focus();}
	dialog.document.open(); // to be sure the page is enable now
	var ret  = "";
	var inc_syndicate_js  = "";
	ret += " <html><head><title>Debug Window</title>		\n";
	ret += " <script language=\"Javascript\">		\n";
	
	//
	inc_syndicate_js =
'function E_DomData() {\n	var self = this;		\n}';
// end_var_declaration
ret += inc_syndicate_js;
//ret +="\n\nvar g_disa = false;function ena(){g_disa = false;}function dis(){g_disa = true;}\n\n";	
ret += "\n\nvar g_disa = false;\nfunction ena(){g_disa = false;document.getElementById('msg').innerHTML='';}\nfunction dis(){g_disa = true;document.getElementById('msg').innerHTML='<font color=\"#FF0000\"><b>DEBUGGER DISABLED</b></FONT>';}\n\n";	
	
	inc_syndicate_js =
'function enable_debug() 	{	}\nfunction ENABLE_DEBUG()		{	'
+ '}\nfunction DISABLE_DEBUG()	{	}\n/* redefinition of old fc'
+ 't*/\nfunction LOGDEBUG(val)			{	}\nfunction LOGDEBUG(val,t'
+ 'oto)		{	}\nfunction LOGDEBUGNOSPACE(val)	{	}\n\n\nfunction L'
+ 'DF(val)		{	}\nfunction LDB(val)		{	}\nfunction logtimeS(va'
+ 'l)		{	}\nfunction logtimeE(val)		{	}\nfunction logtime(val'
+ ')		{	}\nfunction LOGDEBUGFORWARD(val)		{	}\nfunction LOGDE'
+ 'BUGBACKWARD(val)		{	}';

// end_var_declaration
ret += inc_syndicate_js;
	
ret += '\n var root_dir="'+root_dir+'";\n ';
	
	
		//domGeneral
	inc_syndicate_js =
'/*******************************************************'
+ '***************************************************\n * 	'
+ '	GENERAL FUNCTIONS TO MOVE AND GET INFO THROW/FROM THE D'
+ 'OM STRUCTURE\n *		Mainly used by functions in editorV2_do'
+ 'mAccess\n *\n *			GENERAL GET\n *		nextSiblingNotText(_node'
+ ')\n *		previousSiblingNotText(_node)\n *		getSpecifParentF'
+ 'romNode(_node,_nodeName,_etype)\n *		nextNelementChildNot'
+ 'Text(_node)\n *		lastElementChildNotText(_node)\n *		lastE'
+ 'lementChildNotText(_node)\n *		nextParentPreviousSiblingN'
+ 'otText(_node)\n *		nextParentNextSiblingNotTextWithTest(_'
+ 'node,testNode)\n *		nextParentNextSiblingNotText(_node)\n '
+ '* 			RECURSIF GET\n *		getPreviousNode = function (_node,'
+ ' _type, _etype, _nodeEnd)\n *		getNextNode = function (_n'
+ 'ode, _type, _etype, _nodeEnd)\n * 			NODE TEST\n *		isNode'
+ 'Type(_node, _type, _etype)\n *		isNodeValEmpty(_node)\n		\n'
+ ' **/\n E_DomData.prototype.nextSiblingNotText = function '
+ '(_node)\n{\n	var self = this;\n	var iloop=0;\n	var next =_no'
+ 'de.nextSibling;\n	while (next) {\n		if ((next.nodeName) &&'
+ ' (next.nodeName!="#text")) return next;\n		next =next.nex'
+ 'tSibling;\n		iloop++;\n		if (iloop>20) break;\n	}\n	return n'
+ 'ull;\n}\n/************************************************'
+ '********************************************************'
+ '***/\nE_DomData.prototype.previousSiblingNotText = functi'
+ 'on (_node)\n{\n	var self = this;\n	var iloop=0;\n	var next ='
+ '_node.previousSibling;\n	while (next) {\n		if ((next.nodeN'
+ 'ame) && (next.nodeName!="#text")) return next;\n		next =n'
+ 'ext.previousSibling;\n		iloop++;\n		if (iloop>20) break;\n	'
+ '}\n	return null;\n}\n/*************************************'
+ '********************************************************'
+ '**************/\nE_DomData.prototype.getSpecifParentFromN'
+ 'ode = function(focusElement,_nodeName,_etype)\n{\n	//ENABL'
+ 'E_DEBUG();LOGDEBUG("getSpecifParentFromNode: focusElemen'
+ 't - "+focusElement+", nodeName - "+_nodeName+", etype - '
+ '"+_etype);DISABLE_DEBUG();\n	//ENABLE_DEBUG();LOGDEBUG("g'
+ 'etSpecifParentFromNode: focusElement.nodeType - "+focusE'
+ 'lement.nodeType);DISABLE_DEBUG();\n	var self = this;\n	LDF'
+ '("getParentNodeFromFocusElement");	\n	//ENABLE_DEBUG();LO'
+ 'GDEBUG("getParentNodeFromFocusElement focusElement.nodeN'
+ 'ame:"+focusElement.nodeName);DISABLE_DEBUG();\n	//DEBUGNO'
+ 'DE(focusElement);\n	// first test if this word is not the'
+ ' limit\n	if ((focusElement.nodeName==_nodeName) && (focus'
+ 'Element.getAttribute("etype")) && (focusElement.getAttri'
+ 'bute("etype")==_etype)) {\n		//ENABLE_DEBUG();LOGDEBUG("g'
+ 'etParentNodeFromFocusElement FOUND"); DEBUGNODE(focusEle'
+ 'ment);DISABLE_DEBUG();\n		LDB("getParentNodeFromFocusElem'
+ 'ent");\n		return focusElement;\n	}\n	if (focusElement.nodeN'
+ 'ame=="BODY") {\n		//ENABLE_DEBUG();LOGDEBUG("BODY FOUND")'
+ ';	DEBUGNODE(lineNode);DISABLE_DEBUG();\n		LDB("getParentN'
+ 'odeFromFocusElement");\n		return focusElement;\n	}\n	var li'
+ 'neNode = focusElement.parentNode;\n	//ENABLE_DEBUG();LOGD'
+ 'EBUG("lineNode: "+lineNode);DISABLE_DEBUG();\n	//ENABLE_D'
+ 'EBUG();LOGDEBUG("getSpecifParentFromNode: LINENODE.nodeT'
+ 'ype - "+lineNode.nodeType);DISABLE_DEBUG();\n	var maxloop'
+ ' = 10;\n	var i=0;\n	//LOGDEBUG("parentNode"); DEBUGNODE(li'
+ 'neNode);\n	while (lineNode) {\n		//ENABLE_DEBUG();LOGDEBUG'
+ '("_________________________lineNode ");DEBUGNODE(lineNod'
+ 'e);DISABLE_DEBUG();\n		if ((lineNode.nodeName==_nodeName)'
+ ' && (lineNode.getAttribute("etype")) && (lineNode.getAtt'
+ 'ribute("etype")==_etype)) {\n			//ENABLE_DEBUG();LOGDEBUG'
+ '("getParentNodeFromFocusElement FOUND");	DEBUGNODE(lineN'
+ 'ode);DISABLE_DEBUG();\n			LDB("getParentNodeFromFocusElem'
+ 'ent");\n			return lineNode;\n		}\n		if (lineNode.nodeName=='
+ '"BODY") {\n			//ENABLE_DEBUG();LOGDEBUG("BODY FOUND");	DE'
+ 'BUGNODE(lineNode);DISABLE_DEBUG();\n			LDB("getParentNode'
+ 'FromFocusElement");\n			return lineNode;\n		}\n		\n		lineNod'
+ 'e = lineNode.parentNode;\n		//ENABLE_DEBUG();LOGDEBUG("pa'
+ 'rentNode"); DEBUGNODE(lineNode);DISABLE_DEBUG();\n		i++;\n'
+ '		if (i>maxloop) {\n			ENABLE_DEBUG();LOGDEBUG("getSpecif'
+ 'ParentFromNode maxloop to parent reach");	DISABLE_DEBUG('
+ ');\n			break;\n		}\n	}\n	//DEBUGNODE(lineNode);\n	ENABLE_DEBU'
+ 'G();LOGDEBUG("NOTHING FOUND");DISABLE_DEBUG();\n	LDB("get'
+ 'ParentNodeFromFocusElement");\n	return null;\n}\n/*********'
+ '********************************************************'
+ '******************************************/\nE_DomData.pr'
+ 'ototype.nextNelementChildNotText = function (_node,_indi'
+ 'ce)\n{	\n	//ENABLE_DEBUG();LOGDEBUG("_node: "+_node);DEBUG'
+ 'NODE(_node);\n	var self = this;\n	//LDF("nextNelementChild'
+ 'NotText");\n\n	if (!_node) {\n		//LOGDEBUG("_node null");		'
+ '			\n		//LDB("nextNelementChildNotText");\n		return null;\n'
+ '	}\n	if (!_node.childNodes) {\n		//LOGDEBUG("_node.childNo'
+ 'des null");					\n		//LDB("nextNelementChildNotText");\n		'
+ 'return null;\n	}\n	//DISABLE_DEBUG();\n	var nbreElementFind'
+ ' = -1;\n	for (var i=0; i<_node.childNodes.length;i++) {\n	'
+ '	var nodeChild = _node.childNodes[i];\n		if ((nodeChild.n'
+ 'odeName) && (nodeChild.nodeName!="#text")) {\n			nbreElem'
+ 'entFind++;\n			if (nbreElementFind==_indice) {					\n				L'
+ 'DB("nextNelementChildNotText");\n				//ENABLE_DEBUG();LOG'
+ 'DEBUG("nextNelementChildNotText:"+ nodeChild );DISABLE_D'
+ 'EBUG();\n				return nodeChild;\n			}\n		}\n	}					\n	//LDB("n'
+ 'extNelementChildNotText");\n	return null;\n}\n/************'
+ '********************************************************'
+ '***************************************/\nE_DomData.proto'
+ 'type.lastElementChildNotText = function (_node)\n{\n	var s'
+ 'elf = this;\n	//LDF("lastElementChildNotText");\n	if (!_no'
+ 'de) {\n		//LOGDEBUG("_node null");					\n		//LDB("lastElem'
+ 'entChildNotText");\n		return null;\n	}\n	if (!_node.childNo'
+ 'des) {\n		//LOGDEBUG("_node.childNodes null");					\n		//L'
+ 'DB("lastElementChildNotText");\n		return null;\n	}\n	for (v'
+ 'ar i=_node.childNodes.length-1; i>-1;i--) {\n		var nodeCh'
+ 'ild = _node.childNodes[i];\n		if ((nodeChild.nodeName) &&'
+ ' (nodeChild.nodeName!="#text")) {	\n			//LDB("lastElement'
+ 'ChildNotText");\n			return nodeChild;\n		}\n	}		\n	//LDB("la'
+ 'stElementChildNotText");\n	return null;\n}\n/**************'
+ '********************************************************'
+ '*************************************/\nvar g_cont =0;\nE_'
+ 'DomData.prototype.getPreviousNode = function (_node, _ty'
+ 'pe, _etype, _nodeEnd)\n{\n	//g_cont++;\n	if (g_cont>100) {\n'
+ '		ENABLE_DEBUG();LOGDEBUG("*****************************'
+ '*****************max recurrence loop reach");	DISABLE_DE'
+ 'BUG();\n		return "END";\n	}\n	var self = this;\n	LDF("getPre'
+ 'viousNode");\n	//LOGDEBUG("********************getPreviou'
+ 'sNode*********************");	LOGDEBUG("_node");DEBUGNOD'
+ 'E(_node);\n	// find next element\n	//LOGDEBUG("find next e'
+ 'lement");	LOGDEBUG("first go down (Test child)");\n	var n'
+ 'extNode = self.lastElementChildNotText(_node);\n	if (!nex'
+ 'tNode) {\n		//LOGDEBUG("second go forward (Test previousS'
+ 'ibling)");\n		nextNode = self.previousSiblingNotText(_nod'
+ 'e);\n		if (!nextNode) {\n			//LOGDEBUG("last go up and go '
+ 'to next Sibling(Test nextSibling)");\n			nextNode = self.'
+ 'nextParentpreviousSiblingNotText(_node);\n			if (!nextNod'
+ 'e) {\n				//LOGDEBUG("probably reach the top as no_parent'
+ '");\n				LDB("getPreviousNode");\n				return null;\n			}\n		'
+ '}\n	}\n	\n	if (self.isNodeType(nextNode,"DIV","SUGDATA")) {'
+ ' //ignore this \n		var n = self.nextSiblingNotText(nextNo'
+ 'de);\n		if (!n) {\n			n = self.nextParentNextSiblingNotTex'
+ 't(nextNode);\n			if (!n) {\n				//LOGDEBUG("SUGDATA probab'
+ 'ly reach the top as no_parent");\n				LDB("getPreviousNod'
+ 'e");\n				return null;\n			}\n		}\n		nextNode = n;\n	}\n	\n	LOG'
+ 'DEBUG("getPreviousNode");DEBUGNODE(nextNode);\n	// test t'
+ 'his node\n	if (nextNode == _nodeEnd) {\n		//LOGDEBUG("END '
+ 'FOUND");\n		LDB("getPreviousNode");\n		return "END";\n	}\n	i'
+ 'f (self.isNodeType(nextNode, _type, _etype)) {\n		//LOGDE'
+ 'BUG("nextNode isNodeType OK");\n		LDB("getPreviousNode");'
+ '\n		return nextNode;\n	}\n	// recurrence on this node\n	//LO'
+ 'GDEBUG("getNextNode to the nextNode");\n	var ret = self.g'
+ 'etNextNode(nextNode,_type, _etype, _nodeEnd);\n	LDB("getP'
+ 'reviousNode");\n	return ret;	\n}\n/************************'
+ '********************************************************'
+ '**************************/\nE_DomData.prototype.getNextN'
+ 'ode = function (_node, _type, _etype, _nodeEnd)\n{\n	//g_c'
+ 'ont++;\n	if (g_cont>100) {\n		ENABLE_DEBUG();		LOGDEBUG("*'
+ '*********************************************max recurre'
+ 'nce loop reach");		DISABLE_DEBUG();\n		return "END";\n	}\n	'
+ 'var self = this;\n	LDF("getNextNode");\n	//ENABLE_DEBUG();'
+ '	LOGDEBUG("********************getNextNode**************'
+ '*******");	LOGDEBUG("_node");DEBUGNODE(_node);	DISABLE_D'
+ 'EBUG();\n	\n	if (!_node) return null;\n\n	// find next eleme'
+ 'nt\n	//LOGDEBUG("find next element");	LOGDEBUG("first go '
+ 'down (Test child)");\n	var nextNode = self.nextNelementCh'
+ 'ildNotText(_node,0);\n	if (!nextNode) {\n		//LOGDEBUG("sec'
+ 'ond go forward (Test nextSibling)");\n		nextNode = self.n'
+ 'extSiblingNotText(_node);\n		if (!nextNode) {\n			//LOGDEB'
+ 'UG("last go up and go to next Sibling(Test nextSibling)"'
+ ');\n			nextNode = self.nextParentNextSiblingNotTextWithTe'
+ 'st(_node,_nodeEnd);\n			//nextNode = self.nextParentNextS'
+ 'iblingNotText(_node);\n			if (!nextNode) {\n				//LOGDEBUG'
+ '("probably reach the top as no_parent");\n				LDB("getNex'
+ 'tNode");\n				return null;\n			}\n		}\n	}\n	// add this test '
+ 'here as well in case of SUGDATA is the nodeEnd\n	if (next'
+ 'Node == _nodeEnd) {\n		//LOGDEBUG("END FOUND");\n		LDB("ge'
+ 'tNextNode");\n		//return "END";\n		return null;\n	}\n	if (se'
+ 'lf.isNodeType(nextNode,"DIV","SUGDATA")) { //ignore this'
+ ' \n		var n = self.nextSiblingNotText(nextNode);\n		if (!n)'
+ ' {\n			n = self.nextParentNextSiblingNotText(nextNode);\n	'
+ '		if (!n) {\n				//LOGDEBUG("SUGDATA probably reach the t'
+ 'op as no_parent");\n				LDB("getNextNode");\n				return nu'
+ 'll;\n			}\n		}\n		nextNode = n;\n	}\n	\n	//ENABLE_DEBUG();LOGD'
+ 'EBUG("nextNode");DEBUGNODE(nextNode);DISABLE_DEBUG();\n	/'
+ '/ test this node\n	if (nextNode == _nodeEnd) {\n		//LOGDEB'
+ 'UG("END FOUND");\n		LDB("getNextNode");\n		return null;\n	}'
+ '\n	if (self.isNodeType(nextNode, _type, _etype)) {\n		//LO'
+ 'GDEBUG("nextNode isNodeType OK");\n		LDB("getNextNode");\n'
+ '		return nextNode;\n	}\n	// recurrence on this node\n	//LOG'
+ 'DEBUG("getNextNode to the nextNode");\n	var ret = self.ge'
+ 'tNextNode(nextNode,_type, _etype, _nodeEnd);\n	LDB("getNe'
+ 'xtNode");\n	return ret;	\n}\n/*****************************'
+ '********************************************************'
+ '*********************/\nE_DomData.prototype.nextParentPre'
+ 'viousSiblingNotText= function (_node)\n{\n	var self = this'
+ ';\n	// go to parent next sibling\n	var maxLopp = 0;\n	var n'
+ 'ode = _node;\n	while (node.parentNode) {\n		var nodeParent'
+ 'NodepreviousSibling = self.previousSiblingNotText(node.p'
+ 'arentNode);\n		if (nodeParentNodepreviousSibling) {\n			re'
+ 'turn nodeParentNodepreviousSibling;\n		}\n		node = node.pa'
+ 'rentNode;\n		maxLopp++;\n		if (maxLopp>10) {\n			ENABLE_DEB'
+ 'UG();LOGDEBUG("max parentNode loop reach");DISABLE_DEBUG'
+ '();\n			return null;\n		}\n	}\n	return null;\n}\n/************'
+ '********************************************************'
+ '**************************************/\nE_DomData.protot'
+ 'ype.nextParentNextSiblingNotTextWithTest= function (_nod'
+ 'e,testNode)\n{\n	var self = this;\n	// go to parent next si'

+ 'bling\n	var maxLopp = 0;\n	var node = _node;\n	while (node.'
+ 'parentNode) {\n		if (node.parentNode==testNode) return no'
+ 'de.parentNode;\n		var nodeParentNodeNextSibling = self.ne'
+ 'xtSiblingNotText(node.parentNode);\n		if (nodeParentNodeN'
+ 'extSibling) {\n			return nodeParentNodeNextSibling;\n		}\n	'
+ '	node = node.parentNode;\n		maxLopp++;\n		if (maxLopp>10) '
+ '{\n			ENABLE_DEBUG();LOGDEBUG("max parentNode loop reach"'
+ ');DISABLE_DEBUG();\n			return null;\n		}\n	}\n	return null;\n'
+ '}\n/*****************************************************'
+ '*****************************************************/\nE'
+ '_DomData.prototype.nextParentNextSiblingNotText= functio'
+ 'n (_node)\n{\n	var self = this;\n	// go to parent next sibl'
+ 'ing\n	var maxLopp = 0;\n	var node = _node;\n	while (node.pa'
+ 'rentNode) {\n		var nodeParentNodeNextSibling = self.nextS'
+ 'iblingNotText(node.parentNode);\n		if (nodeParentNodeNext'
+ 'Sibling) {\n			return nodeParentNodeNextSibling;\n		}\n		no'
+ 'de = node.parentNode;\n		maxLopp++;\n		if (maxLopp>10) {\n	'
+ '		ENABLE_DEBUG();LOGDEBUG("max parentNode loop reach");D'
+ 'ISABLE_DEBUG();\n			return null;\n		}\n	}\n	return null;\n}\n/'
+ '********************************************************'
+ '**************************************************\n * 		'
+ 'isNodeType(_node, _type, _etype)\n * 		return true if _no'
+ 'de type match with _type and optionnaly _etype\n **/\nE_Do'
+ 'mData.prototype.isNodeType = function(_node, _type, _ety'
+ 'pe)\n{\n	if ((_node.nodeName) && (_node.nodeName == _type)'
+ ') {\n		if (!_etype) {\n			//LOGDEBUG("FOUND AS _etype:"+_e'
+ 'type);\n			return true;\n		}\n		else {\n			var nodeType = _n'
+ 'ode.getAttribute("etype");\n			//LOGDEBUG("nodeType:"+nod'
+ 'eType);\n			//LOGDEBUG("_etype:"+_etype);\n			if ((nodeTyp'
+ 'e) && (nodeType==_etype)) {\n				//LOGDEBUG("FOUND type m'
+ 'atch");\n				return true;\n			}\n		}\n	}\n	return false;\n}\n/*'
+ '********************************************************'
+ '*************************************************/\nE_Dom'
+ 'Data.prototype.isNodeValEmpty = function (_node)\n{\n	var '
+ 'self = this;\n	//LOGDEBUG("------_node:");	DEBUGNODE(_nod'
+ 'e);\n	var v0 ="";\n	if (_node.nodeValue) {\n		//LOGDEBUG("_'
+ 'node.nodeValue["+_node.nodeValue+"]");\n		v0 = _node.node'
+ 'Value;\n	}\n	else if (_node.innerHTML) {\n		//LOGDEBUG("_no'
+ 'de.innerHTML["+_node.innerHTML+"]");\n		v0 = _node.innerH'
+ 'TML;\n	}\n	else {\n		ENABLE_DEBUG();LOGDEBUG("no value at a'
+ 'll strange ???");DISABLE_DEBUG();\n		return true;\n	}\n	//L'
+ 'OGDEBUG("v0["+v0+"]");\n	//var v1 = remplace(v0, \'&nbsp\','
+ ' \'\');\n	var v1 = v0;\n	//LOGDEBUG("v1["+v1+"]");\n	v = trim'
+ '(v1);\n	//LOGDEBUG("v["+v+"]");\n	if ((v=="") || (v=="&nbs'
+ 'p")) return true;\n	return false;\n}\n';

// end_var_declaration
ret +=inc_syndicate_js;



inc_syndicate_js =
'/*Should be include directly in debug.js*/\n\nvar g_editor'
+ 'DOM = new E_DomData();\n\nfunction setAttribut (_node,_att'
+ ',_val)\n{\n	var att = document.createAttribute(_att);\n	att'
+ '.nodeValue = _val;;\n	_node.setAttributeNode(att);\n	retur'
+ 'n _node;\n}\nfunction addSpace(_number)\n{\n	var ret = "";\n	'
+ 'for (var i=0;i<_number-1;i++)	{\n			ret += "<font color=\''
+ '#999999\'>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>";\n	}\n	if'
+ ' (_number>0) ret += "<font color=\'#999999\'>|---</font>";'
+ '\n	return ret;\n}\n\nfunction lock(_branchId)\n{\n	//LOGDEBUG('
+ '"lock _branchId:"+_branchId);\n	var img2 = document.getEl'
+ 'ementById("img2_"+_branchId);\n	if (img2) {\n		img2.src = '
+ '"'+root_dir+'images/locklock.jpg";\n		img2.onclick = functio'
+ 'n (){unlock(_branchId);}\n		img2 = setAttribut(img2,"lock'
+ '","true");\n		\n		var parent = g_editorDOM.getSpecifParent'
+ 'FromNode(img2.parentNode, "DIV", "branch");\n		if (parent'
+ ') { \n			//DEBUGNODE(parent);\n			parent = g_editorDOM.get'
+ 'SpecifParentFromNode(parent.parentNode, "DIV", "branch")'
+ ';\n			if (parent) {\n				//DEBUGNODE(parent);\n				if (pare'
+ 'nt.attributes["eName"]) {\n					var name = parent.attribu'
+ 'tes["eName"].nodeValue;\n					lock(name);\n				}\n			}\n		}	'
+ '\n	}\n	\n}\nfunction unlock(_branchId)\n{\n	var img2 = documen'
+ 't.getElementById("img2_"+_branchId);\n	if (img2) {\n		img2'
+ '.src = "'+root_dir+'images/clef.jpg";\n		img2.onclick = func'
+ 'tion (){lock(_branchId);}\n		img2 = setAttribut(img2,"loc'
+ 'k","false");\n	}\n}\n\nfunction expand(_branchId)\n{\n	LOGDEBU'
+ 'G("expand _branchId:"+_branchId);\n	//var branch = docume'
+ 'nt.getElementById(_branchId);\n	var img2 = document.getEl'
+ 'ementById("img2_"+_branchId);\n	LOGDEBUG("img2.attributes'
+ '[\\"lock\\"].nodeValue:"+img2.attributes["lock"].nodeValue'
+ ');\n	if (img2.attributes["lock"].nodeValue=="true") retur'
+ 'n;\n	\n	var img = document.getElementById("img_"+_branchId'
+ ');\n	img.src = "'+root_dir+'images/minus.gif";\n	img.onclick '
+ '= function (){unlock(_branchId);contract(_branchId);}\n	v'
+ 'ar branchData = document.getElementById( "data_"+_branch'
+ 'Id);\n	//branchData.style.visibility = "visible";\n	branch'
+ 'Data.style.display = "";\n	branchData.attributes["eVisibl'
+ 'e"].nodeValue = "true";\n	\n	var depth = branchData.parent'
+ 'Node.attributes["depth"].nodeValue;\n	if (depth>g_expend)'
+ ' g_expend=depth;\n\n}\n/*\nfunction expandComplete(_branchId'
+ ')\n{\n	expand(_branchId);\n}\n*/\n\nfunction setLockAll(_lock)'
+ '\n{\n	var arrayDur = document.getElementsByName("branch");'
+ '\n	//LOGDEBUG("arrayDur.length:"+arrayDur.length);\n	if (a'
+ 'rrayDur) for (var i=0;i<arrayDur.length;i++) {\n		var par'
+ 'entNode = arrayDur[i].parentNode;\n		//LOGDEBUG("parentNo'
+ 'de.attributes[\\"eVisible\\"]:"+parentNode.attributes["eVi'
+ 'sible"]);\n		if (!parentNode.attributes["eVisible"] || pa'
+ 'rentNode.attributes["eVisible"].nodeValue == "true") {\n	'
+ '		var name = arrayDur[i].attributes["eName"].nodeValue;\n'
+ '			if (_lock) lock(name);\n			else unlock(name);\n		\n		}\n	'
+ '}\n}\n\nfunction contract(_branchId)\n{\n	//var branch = docu'
+ 'ment.getElementById(_branchId);\n	\n	var img2 = document.g'
+ 'etElementById("img2_"+_branchId);\n	if (img2.attributes["'
+ 'lock"].nodeValue=="true") return;\n	\n	var img = document.'
+ 'getElementById("img_"+_branchId);\n	img.src = "'+root_dir+'i'
+ 'mages/plus.gif";\n	img.onclick = function (){unlock(_bran'
+ 'chId);expand(_branchId);}\n	var branchData = document.get'
+ 'ElementById( "data_"+_branchId);\n	//branchData.style.vis'
+ 'ibility = "hidden";\n	branchData.style.display = "none";\n'
+ '	branchData.attributes["eVisible"].nodeValue = "false";\n'
+ '	\n}\nvar g_depthMax = 0;\nfunction addBranchAtBranch(_newB'
+ 'ranch,_mainBranchId)\n{\n	var argv= arguments;\n	var argc= '
+ 'arguments.length;\n	var display1=(argc > 2) ? argv[2] : _'
+ 'newBranch;\n	var display2=(argc > 3) ? argv[3] : "";\n	var'
+ ' display3=(argc > 4) ? argv[4] : "";\n	//var _mainBranch '
+ '= document.getElementById(_mainBranchId);\n	\n	setBranchNo'
+ 'tEmpty(_mainBranchId);\n	\n	var _mainBranchData = document'
+ '.getElementById( "data_"+_mainBranchId);\n	var depth = _m'
+ 'ainBranchData.parentNode.attributes["depth"].nodeValue;\n'
+ '	depth++;\n	if (depth>g_depthMax) g_depthMax=depth;\n	\n	va'
+ 'r div = document.createElement("div");\n	div.id = "branch'
+ '";\n	div = setAttribut(div,"name","branch");\n	div = setAt'
+ 'tribut(div,"depth",depth);\n	div = setAttribut(div,"eName'
+ '",_newBranch);\n	div = setAttribut(div,"etype","branch");'
+ '\n	\n	//div = setAttribut(div,"eVisible","false");\n	\n	var '
+ 'spanSpace = document.createElement("span");\n	spanSpace ='
+ ' setAttribut(spanSpace,"etype","space");\n	spanSpace.inne'
+ 'rHTML = addSpace(depth-1);\n	\n	var img = document.createE'
+ 'lement("img");\n	img.src = "'+root_dir+'images/plus.gif"; \n	'
+ 'img.onclick = function (){unlock(_newBranch);expand(_new'
+ 'Branch);}\n	img.id = "img_"+_newBranch;\n	img.style.visibi'
+ 'lity = "hidden";\n	img = setAttribut(img,"etype","img");\n'
+ '	//img.style.display = "none";	\n	var img2 = document.cre'
+ 'ateElement("img");\n	img2.src = "'+root_dir+'images/clef.jpg'
+ '"; \n	img2.onclick = function (){lock(_newBranch);}\n	img2'
+ '.id = "img2_"+_newBranch;\n	img2.style.visibility = "hidd'
+ 'en";\n	img2 = setAttribut(img2,"lock","false");\n	img2 = s'
+ 'etAttribut(img2,"etype","img2");\n	//img.style.display = '
+ '"none";\n	\n	var span1 = document.createElement("span");\n	'
+ 'span1.id = "span1_"+_newBranch;\n	span1 = setAttribut(spa'
+ 'n1,"etype","span1");\n	span1.innerHTML = "&nbsp;<b>"+disp'
+ 'lay1+"</b>";\n	\n	var span2 = document.createElement("span'
+ '");\n	span2 = setAttribut(span2,"etype","span2");\n	span2.'
+ 'id = "span2_"+_newBranch;\n	span2.innerHTML = display2;\n	'
+ '\n	var span3 = document.createElement("span");\n	span3 = s'
+ 'etAttribut(span3,"etype","span3");\n	span3.id = "span3_"+'
+ '_newBranch;\n	span3.innerHTML = display3;\n	\n	var dataChil'
+ 'd = document.createElement("span");\n	dataChild = setAttr'
+ 'ibut(dataChild,"etype","dataChild");\n	dataChild.id = "da'
+ 'ta_"+_newBranch;\n	dataChild.style.display = "none";\n	dat'
+ 'aChild = setAttribut(dataChild,"eVisible","false");\n	\n	d'
+ 'iv.appendChild(spanSpace);\n	div.appendChild(img);\n	div.a'
+ 'ppendChild(span1);\n	div.appendChild(span2);\n	div.appendC'
+ 'hild(span3);\n	div.appendChild(img2);\n	div.appendChild(da'
+ 'taChild);\n	\n	_mainBranchData.appendChild(div);\n}\n\nfuncti'
+ 'on setBranchNotEmpty(_branchId)\n{\n	var img = document.ge'
+ 'tElementById( "img_"+_branchId);\n	if (img) {	img.style.v'
+ 'isibility = "visible";	}\n	var img2 = document.getElement'
+ 'ById( "img2_"+_branchId);\n	if (img2) {	img2.style.visibi'
+ 'lity = "visible";	}\n}\n\nfunction addLeafAtBranch(_leaf,_b'
+ 'ranchId)\n{\n	//var branch = document.getElementById(_bran'
+ 'chId);\n	\n	setBranchNotEmpty(_branchId);\n	\n	var branchDat'
+ 'a = document.getElementById( "data_"+_branchId);\n	var de'
+ 'pth = branchData.parentNode.attributes["depth"].nodeValu'
+ 'e;\n	//LOGDEBUG("depth:"+depth);\n	var span = document.cre'
+ 'ateElement("div");\n	span.innerHTML = addSpace(Number(dep'
+ 'th))+_leaf;\n	branchData.appendChild(span);\n}\n\nfunction e'
+ 'xpandLevel(_level)\n{\n	//LOGDEBUG("expandLevel:"+_level);'
+ '\n	var arrayDur = document.getElementsByName("branch");\n	'
+ 'if (arrayDur) for (var i=0;i<arrayDur.length;i++) {\n		//'
+ 'if (arrayDur[i].attributes["depth"]) {\n			var depth = ar'
+ 'rayDur[i].attributes["depth"].nodeValue;\n			if (Number(d'
+ 'epth)>0 && Number(depth)<=Number(_level))\n				expand(arr'
+ 'ayDur[i].attributes["eName"].nodeValue)\n		//}\n	}\n}\nfunct'
+ 'ion contractLevel(_level)\n{\n	//alert("yo");\n	//LOGDEBUG('
+ '"contractLevel:"+_level);\n	var arrayDur = document.getEl'
+ 'ementsByName("branch");\n	//LOGDEBUG("arrayDur.length:"+a'
+ 'rrayDur.length);\n	if (arrayDur) for (var i=0;i<arrayDur.'
+ 'length;i++) {\n		//LOGDEBUG("arrayDur[i]:"+arrayDur[i]);\n'
+ '		var depth = arrayDur[i].attributes["depth"].nodeValue;'
+ '\n		//LOGDEBUG("depth:"+depth);\n		if (Number(depth)>0 && '
+ 'Number(depth)>=Number(_level))\n			contract(arrayDur[i].a'
+ 'ttributes["eName"].nodeValue)\n	}\n}\n\n\nvar g_expend = 0;\nf'
+ 'unction inc_contract()\n{\n	if (g_expend>0) {\n		g_expend--'
+ ';\n		expandLevel(g_expend);\n		contractLevel(g_expend+1);\n'
+ '	}\n}\nfunction inc_expand() {\n	if (g_expend<g_depthMax){\n'
+ '		g_expend++;\n		expandLevel(g_expend);\n		contractLevel(g'
+ '_expend+1);\n	}\n}\nfunction contractAll()\n{\n	g_expend=0;\n	'
+ 'contractLevel(1);\n}\nfunction expandAll()\n{\n	g_expend=g_d'
+ 'epthMax;\n	expandLevel(g_depthMax);\n}\n\n/*\nfunction testEm'
+ 'ptyBranch()\n{\n	var arrayDur = document.getElementsByName'
+ '("branch");\n	if (arrayDur) for (var i=0;i<arrayDur.lengt'
+ 'h;i++) {\n		var childNodesLength = arrayDur[i].childNodes'
+ '.length;\n		LOGDEBUG("childNodesLength:"+childNodesLength'
+ ');\n		var dataChild = g_editorDOM.nextNelementChildNotTex'
+ 't(arrayDur[i],3);\n		LOGDEBUG("dataChild:"+dataChild);\n		'
+ 'if (dataChild) {			\n			LOGDEBUG("dataChild.childNodes.le'
+ 'ngth:"+dataChild.childNodes.length);\n			if (dataChild.ch'
+ 'ildNodes.length==0) {\n				var name = arrayDur[i].attribu'
+ 'tes["eName"].nodeValue;\n			}\n		}\n	}\n}\n*/\nvar g_currentLe'
+ 'vel = "tronc";\nvar g_indice = 0;\n\n\nfunction clearDebug()'
+ '\n{\n	g_currentLevel = "tronc";\n	g_indice = 0;\n	g_depthMax'
+ ' = 0;\n	var data_tronc = document.getElementById("data_tr'
+ 'onc");\n	data_tronc.innerHTML="";\n var errorDiv = document.getElementById("ErrorDiv");errorDiv.innerHTML="";\n	\n}\n\nfunction getTimeTo'
+ 'String()\n{\n	var maintenant = new Date();\n	var time = mai'
+ 'ntenant.getHours()+":"+maintenant.getMinutes()+":"+maint'
+ 'enant.getSeconds()+":"+maintenant.getMilliseconds();\n	re'
+ 'turn "["+time+"]";\n}\n\nfunction TRC_O(_fct)\n{\n	g_indice++'
+ ';\n	addBranchAtBranch(_fct+g_indice,g_currentLevel,_fct,"'
+ ' "+getTimeToString());\n	g_currentLevel = _fct+g_indice;\n'
+ '	//addLeafAtBranch("START",g_currentLevel);\n}\nfunction T'
+ 'RC_C(_msg)\n{\n	addLeafAtBranch("End "+_msg+getTimeToStrin'
+ 'g(),g_currentLevel);\n	var g_currentLevelNode = document.'
+ 'getElementById("data_"+g_currentLevel);\n	if (g_currentLe'
+ 'velNode.parentNode) {\n		var parent = g_currentLevelNode.'
+ 'parentNode.parentNode.parentNode;\n		//LOGDEBUG("parent:"'
+ '+parent);\n		//DEBUGNODE(parent);\n		if (parent.attributes'
+ '["eName"]) g_currentLevel = parent.attributes["eName"].n'
+ 'odeValue;\n		else g_currentLevel = "tronc";\n	}\n	else g_cu'
+ 'rrentLevel = "tronc";\n}\nfunction TRC(_msg)\n{\n	addLeafAtB'
+ 'ranch(_msg+" "+getTimeToString(),g_currentLevel);\n}\n\nfunction TraceBlockStart('
+ '_fct){ if (g_disa) return; TRC_O(_fct) }\nfunction TraceBlockEnd(_fct){ if (g_disa) return; TRC_C'
+ '(_fct) }\nfunction Trace(_fct){ if (g_disa) return; TRC(_fct) }';

ret +=inc_syndicate_js;
	
inc_syndicate_js =
'function Error(_fct){\n	var errorDiv = document.getElemen'
+ 'tById("ErrorDiv");\n	if (errorDiv == null) return;\n	var i'
+ 'nner = errorDiv.innerHTML;\n	if (inner != "") inner +="<b'
+ 'r>";\n	inner += _fct;\n	errorDiv.innerHTML = inner;\n}';

	ret +=inc_syndicate_js;

	ret += " </script>";
	ret += " </head>";
	ret += " <body>		\n";


	ret += 'Open Blocks\n<input type=\'button\' value=\'All\' onClick=\'expand'
+ 'All();\'>&nbsp;&nbsp;\n<input type=\'button\' value=\'+\' onCl'
+ 'ick=\'inc_expand();\'>&nbsp;&nbsp;\n<input type=\'button\' va'
+ 'lue=\'-\' onClick=\'inc_contract();\'>&nbsp;&nbsp;\n<input ty'
+ 'pe=\'button\' value=\'None\' onClick=\'contractAll()\'>&nbsp;&'
+ 'nbsp;';
	ret += 'Lock Blocks\n<input type=\'button\' value=\'Lock\' onClick=\'setL'
+ 'ockAll(true);\'>&nbsp;&nbsp;\n<input type=\'button\' value=\''
+ 'Unlock\' onClick=\'setLockAll(false);\'>&nbsp;&nbsp;';
	ret += " &nbsp;Clear&nbsp;<input type='button' value='Clear All' onClick='clearDebug();'>		\n";
	ret += " &nbsp;&nbsp;<input type='button' value='Disable Debug' onClick='dis();'>		\n";
	ret += " &nbsp;&nbsp;<input type='button' value='Enable Debug' onClick='ena();'><br>		\n";
	ret += " <br>Remember: All errors are logged in '"+g_errorLogFile+"'\n";
	ret += " <br>		\n";
	ret += " <br>HOW TO USE THE DEBUGGER:		\n";
	ret += " <br>Function Javascript: LDF(_msg), LDB(_msg), LOGDEBUG(_msg), LOGERROR(_msg), DEBUGNODE(_node).		\n";
	ret += " <br>Function PHP: LDF(_msg,_javaLog = true), LDB(_msg,_javaLog = true), LOGDEBUG(_msg,_javaLog = true), <b>PHPLOGERROR(_msg,_javaLog = true)</b>.		\n";
	//ret += " <br><br><b>BECARFULL!!</b> All PHP functions log messages to the file " +g_etitle_tmp_dir+"/logphp.txt' <b>AND</b> add javscript code in the page to display the message in this windows.<b> Sometime it is not a goode idea!!</b> If you want to disable the javscript part and keep only the log to the file you should set the optional parameter _javaLog to false. \n";
	
	ret += " <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div id='msg'></div>";
	
	ret += "  <div name='subt' id='subt' style='overflow:scroll;height:650;width:100%;' align='left'>		\n";
	ret += " <br><b>************ ERROR *********</b>		\n";
	ret += " <div id='ErrorDiv' name='ErrorDiv'></div>		\n";
	ret += " <br><b>************ TRACE *********</b>		\n";
	ret += " <div id='branch' name='branch' eName='tronc' depth='0'><span id='data_tronc'></span></div>		\n";
	ret += " <br><b>************ END ***********</b>		\n";
	ret += " </div>";
	ret += " Clear&nbsp;<input type='button' value='Clear All' onClick='clearDebug();'><br>		\n";
	//ret += "  <input type='button' value='Test' onClick='Trace(\"test\");'>		\n";
	ret += " </body></html>		\n";
	dialog.document.write (ret);
	
   dialog.document.close();  
}
function closeDebug()
{
   if(isValid("dialog"))
   {
      dialog.close();
	  dialog = null;
   }
}
function Mlog(msgText,mode)
{	
	 //try {
		//if (mode != 'error') return;
		if (!g_isDebug) return;
		
		var argv= arguments;
		var argc= arguments.length;
		var overWrite=(argc > 2) ? argv[2] : false;
		
		if (!overWrite && !debugdyn) return;
		
		if (!isValid("dialog")) {
		//if (!dialog) {
			opendebug();
		}
	
		var msgText= remplace(msgText, '<', '_STARTTAG_');
		var msgText= remplace(msgText, '>', '_ENDTAG_');
		var msgText= remplace(msgText, '_STARTTAG_SPAN', '<br>&#139;SPAN');
		var msgText= remplace(msgText, '_STARTTAG_DIV', '<br>&#139;DIV');
		var msgText= remplace(msgText, '_STARTTAG_', '&#139;');
		var msgText= remplace(msgText, '_ENDTAG_', '&#155;');
	
		var msgTextTemp = msgText;
		var msgText = remplace(msgTextTemp, "_BR_", "\n");
		
		if (isValid("dialog")) {
			if (mode == 'open_branch') {
				if (isValid("dialog.TraceBlockStart")) dialog.TraceBlockStart(msgText);
			}
			else if (mode == 'close_branch') {
				if (isValid("dialog.TraceBlockEnd")) dialog.TraceBlockEnd(msgText);
			}
			else if (mode == 'error') {			
				if (isValid("dialog.Trace")) dialog.Trace("<font color='#FF0000'><b>"+msgText+"</b></font>");	
				if (isValid("dialog.Error")) dialog.Error("<font color='#FF0000'><b>"+msgText+"</b></font>");
			}
			else {
				if (isValid("dialog.Trace")) dialog.Trace(msgText);
			}
		}
		else alert("not dialog");
	/*}
	 catch (e) 
	 {
	 	return;
	 }
	return;*/
}

// OLF FCTS AND REDEFINITON
function enable_debug() 	{	/*ENABLE_DEBUG();*/}
function ENABLE_DEBUG()		{	/*debugdyn=true;*/ }
function DISABLE_DEBUG()	{	/*debugdyn=false;*/ }
function DISABLE_DEBUGV2()	{	if (!g_isDebug) {return;}	if (isValid("dialog.dis")) dialog.dis(); }
function ENABLE_DEBUGV2()	{	if (!g_isDebug) {return;}	if (isValid("dialog.ena")) dialog.ena(); }
/* redefinition of old fct*/
function LOGERROR(val)			{
	try {
		if (!g_isDebug) {return;}
			
		if (isValid("dialog")) {
			var swit = false;
			if (dialog.g_disa) {
				swit = true;
				dialog.ena();
			}
			Mlog(val,'error');
			if (swit) {
				dialog.dis();
			}
		}
	}
	catch (e) 
	{
		return;
	}
}
function LOGOBJECT(msg,obj)		{	if (!g_isDebug) {return;}	Mlog(msg+ObjectFormatter.obj2String(obj),3); }
function LOGDEBUG(val)			{	if (!g_isDebug) {return;}	Mlog(val,3);}
function LOGDEBUG(val,toto)		{	if (!g_isDebug) {return;}	Mlog(val,3);}
function LOGDEBUGNOSPACE(val)	{	if (!g_isDebug) {return;}	Mlog(val,3);}


function LDF(val)		{		if (!g_isDebug) {return;}Mlog(val,'open_branch',true);}
function LDB(val)		{		if (!g_isDebug) {return;}Mlog(val,'close_branch',true);}
function logtimeS(val)		{		if (!g_isDebug) {return;}Mlog(val,'open_branch');}
function logtimeE(val)		{		if (!g_isDebug) {return;}Mlog(val,'close_branch');}
function logtime(val)		{		if (!g_isDebug) {return;}Mlog(val,3);}
function LOGDEBUGFORWARD(val)		{		if (!g_isDebug) {return;}Mlog(val,'open_branch');}
function LOGDEBUGBACKWARD(val)		{		if (!g_isDebug) {return;}Mlog(val,'close_branch');}

function DEBUGFCTPARAM(fct)
{
	if (!g_isDebug) {return;}
		var argv= fct.arguments;
		var argc= fct.arguments.length;
		for (var i=0;i<argc;i++){
			Mlog("argv["+i+"]:"+ argv[i],3);
		}
}
/*TOOLS*/
function mySlice(_string)
{
	var d = _string;
	if (d.length>20) {
		d = d.slice(0,20);
		d += "....";
	}
	return d;
}

function nodeToStringMin (_node)
{
	if (!_node) {LOGERROR("nodeToStringMin node: NULL");	return;	}
	if (!g_isDebug) {return;}
	var ret = "";
	
	if (_node.nodeName) ret += _node.nodeName;
	if (_node.nodeType) ret += "("+_node.nodeType+")";
	if (_node.id) ret += " Id[ "+_node.id+"]";
	if ((_node.attributes) && (_node.attributes["etype"]))  ret += " etype["+_node.attributes["etype"].nodeValue+"]";
	if (_node.data) ret+=" data["+mySlice(_node.data)+"]";
	if (_node.nodeValue) ret+=" nodeValue["+mySlice(_node.nodeValue)+"]";
	return ret+" ";
}
function stackToPrint(_node)
{
	if (!_node) {LOGERROR("stackToPrint node: NULL");	return;	}
	if (!g_isDebug) {return;}
	var ret = "";
	while (_node.firstChild) {
		ret += nodeToStringMin(_node.firstChild);
		_node = _node.firstChild;
		ret += "|| ";
	}
	return ret;
}
function DEBUGNODE (_node)
{

	if (!_node) {LOGDEBUGNOSPACE("node: NULL");	return;	}
	//LOGDEBUGNOSPACE("+++++++++++++++node:"+_node);
	if (!g_isDebug) return;
	if (!debugdyn)  return;
	
	LDF("Node: "+_node.nodeName);	
	var ret = "";
	if (_node.nodeType) ret += "Type["+_node.nodeType+"] ";
	if (_node.nodeName) ret += "Name["+_node.nodeName+"] ";
	if (_node.id) ret += "Id["+_node.id+"] ";
	if (_node.value) ret += "value["+_node.value+"] ";
	if (_node.attributes) {
		if (_node.attributes["Tid"]) ret += "etype["+_node.attributes["Tid"].nodeValue+"] ";
		if (_node.attributes["etype"]) ret += "etype["+_node.attributes["etype"].nodeValue+"] ";
		if (_node.attributes["estyle"]) ret += "estyle["+_node.attributes["estyle"].nodeValue+"] ";
		if (_node.attributes["st"]) ret += "st["+_node.attributes["st"].nodeValue+"] ";
		if (_node.attributes["et"]) ret += "et["+_node.attributes["et"].nodeValue+"] ";
		if (_node.attributes["eid"]) ret += "eid["+_node.attributes["eid"].nodeValue+"] ";
		if (_node.attributes["spkid"]) ret += "spkid["+_node.attributes["spkid"].nodeValue+"] ";	
	}
	if (ret!= "") LOGDEBUGNOSPACE("node: "+ret)
	
	if (_node.data) LOGDEBUGNOSPACE("data: "+mySlice(_node.data));
	if (_node.nodeValue) LOGDEBUGNOSPACE("nodeValue: "+mySlice(_node.nodeValue));
	//if (_node.innerHTML) LOGDEBUGNOSPACE("innerHTML: "+_node.innerHTML);
	
	if (_node.length) LOGDEBUGNOSPACE("ddlength: "+_node.length);
	if (_node.childNodes) {
		LOGDEBUGNOSPACE("CHILD["+_node.childNodes.length+"]:");
		ret = "";
		for (var i = 0; i < _node.childNodes.length; ++i) {
			var nodeC = _node.childNodes[i]; 
			ret += " ["+i+"]";
			ret += nodeToStringMin(nodeC);
			if (_node.childNodes.length<11) {
				LOGDEBUGNOSPACE(ret);
				ret = "";
			}
		}
		if (ret != "") LOGDEBUGNOSPACE(ret);
	}
	if (_node.parentNode) {
		var ret = nodeToStringMin(_node.parentNode);
		LOGDEBUGNOSPACE("PARENT:"+ret);
	}
	var ret = stackToPrint(_node);
	if (ret != "") LOGDEBUGNOSPACE("STACK["+ret+"]");
	//LOGDEBUGNOSPACE("---------------------");
	LDB("Node: "+_node.nodeName);

}

