const char *WebCfgDVCA_js=
   "\n"
   "//OpenSCADA system module UI.WebCfgD file: VCA.js\n"
   "/***************************************************************************\n"
   " *   Copyright (C) 2008-2026 by Roman Savochenko, <roman@oscada.org>       *\n"
   " *                                                                         *\n"
   " *   This program is free software; you can redistribute it and/or modify  *\n"
   " *   it under the terms of the GNU General Public License as published by  *\n"
   " *   the Free Software Foundation; version 2 of the License.               *\n"
   " *                                                                         *\n"
   " *   This program is distributed in the hope that it will be useful,       *\n"
   " *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *\n"
   " *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\n"
   " *   GNU General Public License for more details.                          *\n"
   " *                                                                         *\n"
   " *   You should have received a copy of the GNU General Public License     *\n"
   " *   along with this program; if not, write to the                         *\n"
   " *   Free Software Foundation, Inc.,                                       *\n"
   " *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\n"
   " ***************************************************************************/\n"
   "\n"
   "//Global parameters init\n"
   "var MOD_ID = 'WebCfgD';	//Module identifier\n"
   "var stTmID = null;	//Status line timer identifier\n"
   "var pgRefrTmID = null;	//Periodic current page update timer identifier\n"
   "var pgRefrTmPer = 5000;	//Time of the periodic update\n"
   "var pgRefrTmDef = 200;	//Time of the typical refresh after\n"
   "var pgRefrTmMax = 10000;//Maximum ordered time of refreshing after some change\n"
   "var dlgWin = null;	//Opened window dialog\n"
   "var selPath = '';	//Selected node path\n"
   "var lastSelPath = '';	//Last selected path from which to select tree nodes holding Shift\n"
   "var queSZ = 20;		//Previous and next arrays queue size\n"
   "var ndPrev = new Array();//Previous nodes array\n"
   "var ndNext = new Array();//Next nodes array\n"
   "var pgInfo = document.createElement('info');	//Curent page XML tree\n"
   "var root = document.createElement('oscada_cntr');//Root page's node\n"
   "var SEC_XT = 0x01;	//Extended\n"
   "var SEC_WR = 0x02;	//Write access\n"
   "var SEC_RD = 0x04;	//Read access\n"
   "var copyBuf = '0';	//Copy node address buffer\n"
   "var genReqs = null;	//Generic request object\n"
   "var limTblItmCnt = 300;	//Limit of the table item content\n"
   "var limShowOp = 10;	//Limit for items shown in the group operation dialogue\n"
   "var Er_NoError = 0;	//Error code of no error\n"
   "var Er_Core_CntrWarning = 1; //Error code of warning the Control Interface\n"
   "var snthHglObj = null;	//Syntax highlight object to update\n"
   "var snthHglTmID = null;	//Syntax highlight timer to update\n"
   "\n"
   "//Browser type detect\n"
   "var isNN = navigator.appName.indexOf('Netscape') != -1;\n"
   "var isIE = navigator.appName.indexOf('Microsoft') != -1;\n"
   "var isOpera = navigator.appName.indexOf('Opera') != -1;\n"
   "var isKonq = navigator.userAgent.indexOf('Konqueror') != -1;\n"
   "var isChrome = navigator.userAgent.indexOf('Chrome') != -1;\n"
   "var gPrms = window.location.search || '';\n"
   "\n"
   "/***************************************************\n"
   " * strEncode - String encoding.                    *\n"
   " ***************************************************/\n"
   "function strEncode( vl, tp )\n"
   "{\n"
   "    //if(!tp || tp == \"html\") return vl.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/\"/g,'&quot;');\n"
   "    //return vl;\n"
   "    var encRez = '';\n"
   "    if(!tp || tp == \"html\")\n"
   "	for(var iEnc = 0; iEnc < vl.length; iEnc++)\n"
   "	    switch(vl.charAt(iEnc)) {\n"
   "		case '&': encRez += '&amp;'; break;\n"
   "		case '>': encRez += '&gt;'; break;\n"
   "		case '<': encRez += '&lt;'; break;\n"
   "		case '\"': encRez += '&quot;'; break;\n"
   "		default:  encRez += vl.charAt(iEnc);\n"
   "	    }\n"
   "    return encRez;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * pathLev - Path parsing function.                *\n"
   " ***************************************************/\n"
   "pathLev.off = 0;\n"
   "function pathLev( path, level, scan )\n"
   "{\n"
   "    var an_dir = scan ? pathLev.off : 0;\n"
   "    var t_lev = 0;\n"
   "    var t_dir;\n"
   "    while(an_dir < path.length && path.charAt(an_dir) == '/') an_dir++;\n"
   "    if(an_dir >= path.length) return '';\n"
   "    while(true) {\n"
   "	t_dir = path.indexOf('/',an_dir);\n"
   "	if(t_dir < 0) { pathLev.off = path.length; return (t_lev==level) ? path.substr(an_dir) : ''; }\n"
   "	if(t_lev == level) { pathLev.off = t_dir; return path.substr(an_dir,t_dir-an_dir); }\n"
   "	an_dir = t_dir;\n"
   "	t_lev++;\n"
   "	while(an_dir < path.length && path.charAt(an_dir) == '/') an_dir++;\n"
   "    }\n"
   "}\n"
   "\n"
   "/*****************************************************\n"
   " * nodeTextByTagId - Get DOM node by tag name and id *\n"
   " *****************************************************/\n"
   "function nodeTextByTagId( node, tag, avl )\n"
   "{\n"
   "    for(var i = 0; i < node.childNodes.length; i++)\n"
   "	if(node.childNodes[i].nodeName == tag && node.childNodes[i].getAttribute('id') == avl)\n"
   "	    return node.childNodes[i].textContent;\n"
   "    return null;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * i2s - integer to string                         *\n"
   " ***************************************************/\n"
   "function i2s( vl, base, len )\n"
   "{\n"
   "    rez = vl.toString(base);\n"
   "    if(len) while(rez.length < len) rez = \"0\"+rez;\n"
   "    return rez;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * posGetX - Get absolute position                 *\n"
   " ***************************************************/\n"
   "function posGetX( obj, noWScrl )\n"
   "{\n"
   "    var posX = 0;\n"
   "    //Calc offset on blocks\n"
   "    for(var cObj = obj; cObj != null; cObj = cObj.offsetParent) posX += cObj.offsetLeft;\n"
   "    //Calc block's scroll\n"
   "    if(!isOpera)\n"
   "	for(var cObj = obj ; (cObj && cObj.nodeName != 'BODY'); cObj = cObj.parentNode)\n"
   "	    posX -= (cObj.scrollLeft?cObj.scrollLeft:0);\n"
   "\n"
   "    return posX + (!noWScrl?-window.pageXOffset:0) + (isNN?5:0);\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * posGetY - Get absolute position                 *\n"
   " ***************************************************/\n"
   "function posGetY( obj, noWScrl )\n"
   "{\n"
   "    var posY = 0;\n"
   "    //Calc offset on blocks\n"
   "    for(var cObj = obj; cObj != null; cObj = cObj.offsetParent) posY += cObj.offsetTop;\n"
   "    //Calc block's scroll\n"
   "    if(!isOpera)\n"
   "	for(var cObj = obj ; (cObj && cObj.nodeName != 'BODY'); cObj = cObj.parentNode)\n"
   "	    posY -= (cObj.scrollTop?cObj.scrollTop:0);\n"
   "\n"
   "    return posY + (!noWScrl?-window.pageYOffset:0) + (isNN?5:0);\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * getXmlHttp - Check and return XMLHttpRequest for*\n"
   " *  various browsers.                              *\n"
   " ***************************************************/\n"
   "function getXmlHttp( )\n"
   "{\n"
   "    if(window.XMLHttpRequest) return new XMLHttpRequest();\n"
   "    else if(window.ActiveXObject) {\n"
   "	try { return new ActiveXObject('Msxml2.XMLHTTP'); }\n"
   "	catch(e) { return new ActiveXObject('Microsoft.XMLHTTP'); }\n"
   "    }\n"
   "    return null;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * crDoc - Create new XML document object for      *\n"
   " *  various browsers.                              *\n"
   " ***************************************************/\n"
   "function crDoc( )\n"
   "{\n"
   "    var doc;\n"
   "    if(document.implementation && document.implementation.createDocument)\n"
   "	doc = document.implementation.createDocument(\"\", \"\", null);\n"
   "    else if(window.ActiveXObject) {\n"
   "	for(var i = 0; i < MSXML.length; i++)\n"
   "	    try { doc = new ActiveXObject(MSXML[i]); } catch (e) { }\n"
   "	if(!doc) { alert(\"Cannot create XMLDocument object\"); return false; }\n"
   "    }\n"
   "\n"
   "    return doc;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * realRound - Real numbers round                  *\n"
   " ***************************************************/\n"
   "function realRound( val, dig, toInt )\n"
   "{\n"
   "    rez = Math.floor(val*Math.pow(10,dig?dig:0)+0.5)/Math.pow(10,dig?dig:0);\n"
   "    if(toInt) return Math.floor(rez+0.5);\n"
   "    return rez;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * getFont( fStr ) - Parse font                    *\n"
   " ***************************************************/\n"
   "function getFont( fStr, defSz, defFnt )\n"
   "{\n"
   "    var rez = '';\n"
   "    if(fStr) {\n"
   "	var compStl = getComputedStyle(document.body, null);\n"
   "	if(!defSz)  defSz = compStl.getPropertyValue('font-size');\n"
   "	if(!defFnt) defFnt = compStl.getPropertyValue('font-family');\n"
   "\n"
   "	var allFnt = fStr.split(' ');\n"
   "	if(allFnt.length >= 4 && parseInt(allFnt[3])) rez += (rez.length?' ':'') + 'italic';\n"
   "	if(allFnt.length >= 3 && parseInt(allFnt[2])) rez += (rez.length?' ':'') + 'bold';\n"
   "	rez += (rez.length?' ':'') + ((allFnt.length >= 2) ? allFnt[1]+'px' : defSz);\n"
   "	if(allFnt.length >= 1) rez += (rez.length?' ':'') + ((allFnt.length >= 1) ? \"'\"+allFnt[0].replace(/_/g,' ')+\"'\" : defFnt);\n"
   "	/*if(allFnt.length >= 5 && parseInt(allFnt[4])) rez += 'text-decoration: underline; ';\n"
   "	else if(allFnt.length >= 6 && parseInt(allFnt[5])) rez += 'text-decoration: line-through; ';*/\n"
   "    }\n"
   "\n"
   "    return rez;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * servGet - XML get request to server             *\n"
   " ***************************************************/\n"
   "function servGet( adr, prm )\n"
   "{\n"
   "    if(genReqs) {\n"
   "	var rCom = prm.slice(4);\n"
   "	if(genReqs.childNodes[0].getAttribute('fillMode') == '1') {\n"
   "	    var tEl = genReqs.createElement(rCom);\n"
   "	    tEl.setAttribute('path',adr);\n"
   "	    genReqs.childNodes[0].appendChild(tEl);\n"
   "	    return null;\n"
   "	}\n"
   "	else {\n"
   "	    var sNd = null;\n"
   "	    var c_pos = genReqs.childNodes[0].getAttribute(\"curPos\");\n"
   "	    if(!c_pos) c_pos = 0;\n"
   "	    for( ; c_pos < genReqs.childNodes[0].childNodes.length && !sNd; c_pos++) {\n"
   "		var wNd = genReqs.childNodes[0].childNodes[c_pos];\n"
   "		if(wNd.getAttribute('path') == adr && wNd.tagName == rCom) sNd = wNd;\n"
   "	    }\n"
   "	    if(!sNd && c_pos)\n"
   "		for(c_pos = 0; c_pos < genReqs.childNodes[0].childNodes.length && !sNd; c_pos++)\n"
   "	    {\n"
   "		var wNd = genReqs.childNodes[0].childNodes[c_pos];\n"
   "		if(wNd.getAttribute('path') == adr && wNd.tagName == rCom) sNd = wNd;\n"
   "	    }\n"
   "\n"
   "	    if(sNd) {\n"
   "		genReqs.childNodes[0].setAttribute('curPos',c_pos+1);\n"
   "		return sNd;\n"
   "	    }\n"
   "	    adr = genReqs.childNodes[0].getAttribute('path')+'/'+adr;\n"
   "	}\n"
   "    }\n"
   "\n"
   "    var req = getXmlHttp();\n"
   "    req.open('GET', encodeURI('/'+MOD_ID+adr+(gPrms.length?gPrms+'&':'?')+prm),false);\n"
   "    //console.log(\"TEST 10: \"+encodeURI('/'+MOD_ID+adr+'?'+prm));\n"
   "//    req.setRequestHeader('Content-Type','text/xml; charset=utf-8');\n"
   "    try {\n"
   "	req.send(null);\n"
   "	if(req.status == 200 && req.responseXML.childNodes.length)\n"
   "	return req.responseXML.childNodes[0];\n"
   "    } catch(e) { window.location = '/'; }\n"
   "\n"
   "    return null;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * servSet - XML set request to server             *\n"
   " ***************************************************/\n"
   "function servSet( adr, prm, body, waitRez )\n"
   "{\n"
   "    var req = getXmlHttp();\n"
   "    req.open('POST',encodeURI('/'+MOD_ID+adr+(gPrms.length?gPrms+'&':'?')+prm),!waitRez);\n"
   "    try {\n"
   "	req.send(body);\n"
   "	if(waitRez && req.status == 200 && req.responseXML.childNodes.length) {\n"
   "	    //Sending the request to other selected nodes after confirmation\n"
   "	    var treeRootSelIts = document.getElementById('treeRoot').getElementsByClassName('select');\n"
   "	    if((body.indexOf('<set') == 0 || body.indexOf('<load') == 0 || body.indexOf('<save') == 0) && treeRootSelIts.length > 1) {\n"
   "		var adrp = \"\"; var adrEl; var tVl;\n"
   "		pathLev.off = 0;\n"
   "		while((tVl=pathLev(adr,0,true)).length) { if(adrEl != null) adrp += ('/'+adrEl); adrEl = tVl; }\n"
   "\n"
   "		var selNds_lim = \"\";\n"
   "		var selNds = new Array();\n"
   "		for(var iIt = 0; iIt < treeRootSelIts.length; iIt++)\n"
   "		    if((tVl=treeRootSelIts[iIt].getAttribute('id')) != adrp) {\n"
   "			selNds.push(tVl);\n"
   "			if(selNds.length < limShowOp) selNds_lim += (selNds_lim.length?\"\\n\":\"\") + tVl;\n"
   "		    }\n"
   "		if(selNds.length > limShowOp)\n"
   "		    selNds_lim += (\"###... and yet %1 nodes###\").replace('%1',selNds.length-limShowOp);\n"
   "		if(confirm((\"###Send the command to other selected nodes: %1 ?###\").replace('%1',selNds_lim)))\n"
   "		    for(var iIt = 0; iIt < selNds.length; iIt++) {\n"
   "			setStatus((\"###Sending the same command to %1 ...###\").replace('%1',selNds[iIt]), 1000);\n"
   "			var reqExt = getXmlHttp();\n"
   "			reqExt.open('POST', encodeURI('/'+MOD_ID+selNds[iIt]+\"/\"+adrEl+(gPrms.length?gPrms+'&':'?')+prm), true);\n"
   "			reqExt.send(body);\n"
   "		    }\n"
   "	    }\n"
   "\n"
   "	    return req.responseXML.childNodes[0];\n"
   "	}\n"
   "    } catch(e) { window.location='/'; }\n"
   "\n"
   "    return null;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * servReq - XML generic request to server         *\n"
   " *  body - XML document body                       *\n"
   " ***************************************************/\n"
   "function servReq( body )\n"
   "{\n"
   "    var req = getXmlHttp();\n"
   "    req.open('POST',encodeURI('/'+MOD_ID+'/'+(gPrms.length?gPrms+'&':'?')+'com=req'),false);\n"
   "    req.setRequestHeader(\"Content-Type\", \"application/xml;charset=UTF-8\");\n"
   "    try {\n"
   "	req.send(body);\n"
   "	if(req.status == 200) return req.responseXML;\n"
   "    } catch(e) { window.location='/'; }\n"
   "\n"
   "    return null;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * setStatus - Setup status message.               *\n"
   " ***************************************************/\n"
   "function setStatus( mess, tm )\n"
   "{\n"
   "    document.getElementById('status').innerText = mess ? mess : '###Ready###';\n"
   "    if(!mess) return;\n"
   "    if(stTmID) clearTimeout(stTmID);\n"
   "    if(!tm || tm > 0) stTmID = setTimeout('setStatus(null)', tm?tm:1000);\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * alertCntr - Control Interface specific alert.   *\n"
   " ***************************************************/\n"
   "function alertCntr( reqO )\n"
   "{\n"
   "    if(reqO) alert(reqO.getAttribute(\"mtxt\") ? reqO.getAttribute(\"mtxt\") : reqO.textContent);\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * expand - Expand/roll select subtree.            *\n"
   " ***************************************************/\n"
   "function expand( el, val, upTree )\n"
   "{\n"
   "    if(!val) {\n"
   "	for(var i = 0; i < el.childNodes.length; i++)\n"
   "	    if(el.childNodes[i].nodeName == 'UL')\n"
   "	    { el.removeChild(el.childNodes[i]); break; }\n"
   "    }\n"
   "    else {\n"
   "	var cUL = null;\n"
   "	for(var i = 0; i < el.childNodes.length; i++)\n"
   "	    if(el.childNodes[i].nodeName == 'UL')\n"
   "	    { cUL = el.childNodes[i]; break; }\n"
   "	if(!cUL) {\n"
   "	    cUL = document.createElement('ul');\n"
   "	    if(el.parentNode.lastChild != el) cUL.style.backgroundImage = 'url(img_treeLine)';\n"
   "	    el.appendChild(cUL);\n"
   "	}\n"
   "	if(el.grps.length > 1) {\n"
   "	    //Add and update present\n"
   "	    for(var iG = 0; iG < el.grps.length; iG++) {\n"
   "		var liN = null;\n"
   "		// Search present item\n"
   "		if(upTree)\n"
   "		    for(var iIt = 0; iIt < cUL.childNodes.length; iIt++)\n"
   "			if(cUL.childNodes[iIt].grps[0].getAttribute('id') == el.grps[iG].getAttribute('id'))\n"
   "			{ liN = cUL.childNodes[iIt]; break; }\n"
   "		if(!liN) {\n"
   "		    liN = document.createElement('li');\n"
   "		    if(iG >= cUL.childNodes.length) cUL.appendChild(liN);\n"
   "		    else cUL.insertBefore(liN, cUL.childNodes[iG]);\n"
   "		    liN.isExpand = false;\n"
   "		}\n"
   "		liN.setAttribute('id', el.getAttribute('id'));\n"
   "		// Set group\n"
   "		liN.grps = new Array(); liN.grps.push(el.grps[iG]);\n"
   "		// Init links\n"
   "		var isUsable = parseInt(liN.grps[0].getAttribute('chPresent'));\n"
   "		var treeIco = '/'+MOD_ID+'/img_tree'+(isUsable?(liN.isExpand?'Minus':'Plus'):'')+'Up'+((iG!=(el.grps.length-1))?'Down':'');\n"
   "		var liCont = isUsable?\"<a class='pm' onclick='expand(this.parentNode,!this.parentNode.isExpand); return false;'>\":\"\";\n"
   "		liCont += \"<img src='\"+treeIco+\"'/></a>\";\n"
   "		liCont += \"<span style='font-style: italic;'>\"+strEncode(el.grps[iG].getAttribute('dscr'))+\":</span>\";\n"
   "		// Next node for update\n"
   "		if(upTree && liN.isExpand) {\n"
   "		    var liNUL = null;\n"
   "		    for(var i = 0; i < liN.childNodes.length; i++)\n"
   "			if(liN.childNodes[i].nodeName == 'UL') { liNUL = liN.childNodes[i]; break; }\n"
   "		    liN.innerHTML = liCont;\n"
   "		    if(liNUL) liN.appendChild(liNUL);\n"
   "		    expand(liN,val,upTree);\n"
   "		}\n"
   "		else liN.innerHTML = liCont;\n"
   "	    }\n"
   "	    //Delete no present\n"
   "	    if(upTree)\n"
   "		for(var iIt = 0; iIt < cUL.childNodes.length; iIt++) {\n"
   "		    var iG;\n"
   "		    for(iG = 0; iG < el.grps.length; iG++)\n"
   "			if(cUL.childNodes[iIt].grps[0].getAttribute('id') == el.grps[iG].getAttribute('id'))\n"
   "			    break;\n"
   "		    if(iG >= el.grps.length) { cUL.removeChild(cUL.childNodes[iIt]); iIt--; }\n"
   "		}\n"
   "	}\n"
   "	else {\n"
   "	    var grpId = el.grps[0].getAttribute('id');\n"
   "	    var hostN = servGet(el.getAttribute('id'),'com=chlds&grp='+grpId);\n"
   "	    if(hostN && parseInt(hostN.getAttribute('rez')) == 0) {\n"
   "		//Add and update present\n"
   "		for(var iE = 0; iE < hostN.childNodes.length; iE++) {\n"
   "		    var tmpNdId = el.getAttribute('id')+'/'+\n"
   "			(grpId+(hostN.childNodes[iE].getAttribute('id')?hostN.childNodes[iE].getAttribute('id'):hostN.childNodes[iE].textContent));\n"
   "		    var liN = null;\n"
   "		    // Find item\n"
   "		    if(upTree)\n"
   "		    for(var iIt = 0; iIt < cUL.childNodes.length; iIt++)\n"
   "			if(cUL.childNodes[iIt].getAttribute('id') == tmpNdId)\n"
   "			{ liN = cUL.childNodes[iIt]; break; }\n"
   "		    if(!liN) {\n"
   "			liN = document.createElement('li');\n"
   "			if(iE >= cUL.childNodes.length) cUL.appendChild(liN);\n"
   "			else cUL.insertBefore(liN, cUL.childNodes[iE]);\n"
   "			liN.isExpand = false;\n"
   "		    }\n"
   "		    liN.setAttribute('id',tmpNdId);\n"
   "		    // Load groups\n"
   "		    liN.grps = new Array();\n"
   "		    for(var iGrp = 0; iGrp < hostN.childNodes[iE].childNodes.length; iGrp++)\n"
   "		    if(hostN.childNodes[iE].childNodes[iGrp].nodeName == 'grp')\n"
   "			liN.grps.push(hostN.childNodes[iE].childNodes[iGrp]);\n"
   "		    // Init links\n"
   "		    var isUsable = (liN.grps.length>1)||(liN.grps.length&&parseInt(liN.grps[0].getAttribute('chPresent')));\n"
   "		    var treeIco = '/'+MOD_ID+'/img_tree'+(isUsable?(liN.isExpand?'Minus':'Plus'):'')+'Up'+((iE!=(hostN.childNodes.length-1))?'Down':'');\n"
   "		    var liCont = isUsable?\"<a class='pm' onclick='expand(this.parentNode,!this.parentNode.isExpand); return false;'>\":\"\";\n"
   "		    liCont += \"<img src='\"+treeIco+\"'/></a>\";\n"
   "		    if(parseInt(hostN.childNodes[iE].getAttribute('icoSize')))\n"
   "			liCont += \"<span><img src='/\"+MOD_ID+liN.getAttribute('id')+\"?com=ico&size=16'/></span>\"; \n"
   "		    //liCont += \"<span><img height='16px' src='/\"+MOD_ID+liN.getAttribute('id')+\"?com=ico'/></span>\";\n"
   "		    liCont += \"<span><a onclick='selectPage(this.parentNode.parentNode.getAttribute(\\\"id\\\"),this.parentNode.parentNode); return false;' \"+\n"
   "			\"onmouseover='setStatus(this.parentNode.parentNode.getAttribute(\\\"id\\\"),10000);' href='#'>\"+strEncode(hostN.childNodes[iE].textContent)+\"</a></span>\";\n"
   "		    // Next node for update\n"
   "		    if(upTree && liN.isExpand) {\n"
   "			var liNUL = null;\n"
   "			for(var iEu = 0; iEu < liN.childNodes.length; iEu++)\n"
   "			    if(liN.childNodes[iEu].nodeName == 'UL') { liNUL = liN.childNodes[iEu]; break; }\n"
   "			liN.innerHTML = liCont;\n"
   "			if(liNUL) liN.appendChild(liNUL);\n"
   "			expand(liN, val, upTree);\n"
   "		    } else liN.innerHTML = liCont;\n"
   "		}\n"
   "		//Delete no present\n"
   "		if(upTree)\n"
   "		    for(var iIt = 0; iIt < cUL.childNodes.length; iIt++) {\n"
   "			var iE;\n"
   "			for(iE = 0; iE < hostN.childNodes.length; iE++) {\n"
   "			    var grpId = el.grps[0].getAttribute('id');\n"
   "			    var tmpNdId = el.getAttribute('id')+'/'+(grpId+(hostN.childNodes[iE].getAttribute('id')?hostN.childNodes[iE].getAttribute('id'):hostN.childNodes[iE].textContent));\n"
   "			    if(cUL.childNodes[iIt].getAttribute('id') == tmpNdId) break;\n"
   "			}\n"
   "			if(iE >= hostN.childNodes.length) { cUL.removeChild(cUL.childNodes[iIt]); iIt--; }\n"
   "		    }\n"
   "	    }\n"
   "	}\n"
   "    }\n"
   "\n"
   "    if(el.isExpand != val) {\n"
   "	//Change tree icon\n"
   "	el.childNodes[0].childNodes[0].src = val ? el.childNodes[0].childNodes[0].src.replace('Plus','Minus') :\n"
   "						   el.childNodes[0].childNodes[0].src.replace('Minus','Plus');\n"
   "	el.isExpand = val;\n"
   "    }\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * selectPage - Select node by user.               *\n"
   " ***************************************************/\n"
   "function selectPage( path, treeIt )\n"
   "{\n"
   "    if(!path) return;\n"
   "\n"
   "    //Group selection extra nodes\n"
   "    if(treeIt != null) {\n"
   "	// Deselecting all extra items without hold Control or Shift\n"
   "	if(!window.event.ctrlKey && !window.event.shiftKey) {\n"
   "	    var treeRootSelIts = document.getElementById('treeRoot').getElementsByClassName('select');\n"
   "	    for(var iIt = 0; iIt < treeRootSelIts.length; iIt++)\n"
   "		if(treeRootSelIts[iIt].getAttribute('id') != selPath && treeRootSelIts[iIt].className.length)\n"
   "		{ treeRootSelIts[iIt].className = \"\"; iIt--; }\n"
   "	    lastSelPath = path;\n"
   "	}\n"
   "	// Toggling the clicked item with hold Control\n"
   "	else if(window.event.ctrlKey && path != selPath) {\n"
   "	    lastSelPath = path;\n"
   "	    treeIt.className = !treeIt.className.length ? \"select\" : \"\";\n"
   "	    return;\n"
   "	}\n"
   "	// Group selecting with hold Shift\n"
   "	else if(window.event.shiftKey) {\n"
   "	    var lastSelPathN, pathN;\n"
   "	    if(lastSelPath.length && lastSelPath != path &&\n"
   "		    lastSelPath.slice(0,lastSelPath.lastIndexOf(\"/\")) == path.slice(0,path.lastIndexOf(\"/\")) &&\n"
   "		    (lastSelPathN=document.getElementById(lastSelPath)) && (pathN=document.getElementById(path)))\n"
   "	    {\n"
   "		var isDescend = false;\n"
   "		// Try descending\n"
   "		for(iIt = lastSelPathN; iIt && !isDescend; iIt = iIt.nextSibling)\n"
   "		    isDescend = (iIt == pathN);\n"
   "		for(iIt = lastSelPathN; iIt; iIt = isDescend?iIt.nextSibling:iIt.previousSibling)\n"
   "		{ iIt.className = \"select\"; if(iIt == pathN) break; }\n"
   "	    }\n"
   "\n"
   "	    lastSelPath = path;\n"
   "	    return;\n"
   "	}\n"
   "    }\n"
   "\n"
   "    //Prev and next\n"
   "    if(selPath.length) ndPrev.push(selPath);\n"
   "    while(ndPrev.length >= queSZ) ndPrev.shift();\n"
   "    ndNext = new Array();\n"
   "\n"
   "    //Page display\n"
   "    pageDisplay(path);\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * pageDisplay - Display selected page.            *\n"
   " ***************************************************/\n"
   "function pageDisplay( path, isComplete )\n"
   "{\n"
   "    if(!path) return;\n"
   "\n"
   "    //Chek Up\n"
   "    actEnable('actUp', path.lastIndexOf('/') != -1 && path.lastIndexOf('/') != 0);\n"
   "\n"
   "    //Check Prev and Next\n"
   "    actEnable('actPrevious', ndPrev.length);\n"
   "    actEnable('actNext', ndNext.length);\n"
   "\n"
   "    if(path != pgInfo.getAttribute('path') || isComplete) {\n"
   "	// Stop refresh\n"
   "	pageCyclRefrStop();\n"
   "\n"
   "	if(selPath.length && document.getElementById(selPath)) document.getElementById(selPath).className = '';\n"
   "	selPath = path;\n"
   "	document.getElementById('selPath').innerText = selPath;\n"
   "\n"
   "	pgInfo = servGet(selPath, 'com=info');\n"
   "	if(parseInt(pgInfo.getAttribute('rez')) != Er_NoError) { alertCntr(pgInfo); return; }\n"
   "	pgInfo.setAttribute('path', selPath);\n"
   "	root = pgInfo.childNodes[0];\n"
   "    }\n"
   "    else {\n"
   "	// Check the new node structure and the old node\n"
   "	var iTree = servGet(selPath,'com=info');\n"
   "	if(parseInt(iTree.getAttribute('rez')) != Er_NoError) { alertCntr(iTree); return; }\n"
   "	if(chkStruct(root,iTree.childNodes[0]))\n"
   "	{ pgInfo = iTree; pgInfo.setAttribute('path',selPath); root = pgInfo.childNodes[0]; }\n"
   "    }\n"
   "    if(selPath.length && document.getElementById(selPath)) document.getElementById(selPath).className = 'select';\n"
   "\n"
   "    actEnable('actManual', root.getAttribute(\"doc\"));\n"
   "    if(root.getAttribute(\"doc\"))\n"
   "	actManual.setAttribute(\"href\", servGet(\"/doc/\"+root.getAttribute(\"doc\").split(\"|\")[1].replace(\"/\",\"%2f\")).textContent);\n"
   "\n"
   "    //Complex request form and it result use\n"
   "    genReqs = crDoc();\n"
   "    genReqs.appendChild(genReqs.createElement('CntrReqs'));\n"
   "    genReqs.childNodes[0].setAttribute('path', selPath);\n"
   "    genReqs.childNodes[0].setAttribute('fillMode', '1');\n"
   "    for(var genReqPrc = 0; genReqPrc < 2; genReqPrc++) {\n"
   "	selectChildRecArea(root, '/', null);\n"
   "\n"
   "	//Load and Save checking to allow\n"
   "	var reqModif = servGet('/%2fobj', 'com=modify');\n"
   "	actEnable('actLoad', reqModif?parseInt(reqModif.textContent):0);\n"
   "	actEnable('actSave', reqModif?parseInt(reqModif.textContent):0);\n"
   "\n"
   "	//Send for the prepared generic request\n"
   "	if(genReqPrc == 0) {\n"
   "	    genReqs.childNodes[0].setAttribute('fillMode', '0');\n"
   "	    genReqs = servReq(genReqs);\n"
   "	}\n"
   "    }\n"
   "    genReqs = null;\n"
   "\n"
   "    //The add and the delete access allow check\n"
   "    actEnable('actAddIt', false);\n"
   "    for(var iCh = 0; iCh < root.childNodes.length; iCh++)\n"
   "	if(root.childNodes[iCh].getAttribute('id') == 'br') {\n"
   "	    for(var iG = 0; iG < root.childNodes[iCh].childNodes.length; iG++)\n"
   "		if(parseInt(root.childNodes[iCh].childNodes[iG].getAttribute('acs'))&SEC_WR)\n"
   "		{ actEnable('actAddIt',true); break; }\n"
   "	break;\n"
   "    }\n"
   "    actEnable('actDelIt',parseInt(root.getAttribute('acs'))&SEC_WR)\n"
   "\n"
   "    //Edit tools update\n"
   "    editToolUpdate();\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * editToolUpdate - Edit action state update.      *\n"
   " ***************************************************/\n"
   "function editToolUpdate( )\n"
   "{\n"
   "    rootAccess = root.getAttribute('acs') ? parseInt(root.getAttribute('acs')) : 0;\n"
   "    actEnable('actCut', (selPath.length && (rootAccess&SEC_WR)));\n"
   "    actEnable('actCopy', (rootAccess>>3)?((rootAccess>>3)&SEC_WR):selPath.length);\n"
   "    actEnable('actPaste', false);\n"
   "\n"
   "    //Src and destination elements calc\n"
   "    if(copyBuf.length <= 1 /*|| copyBuf.substr(1) == selPath || pathLev(copyBuf.substr(1),0) != pathLev(selPath,0)*/) return;\n"
   "    var sElp; var sEl; var tEl;\n"
   "    pathLev.off = 0;\n"
   "    while((tEl=pathLev(copyBuf.substr(1),0,true)).length) { sElp += ('/'+sEl); sEl = tEl; }\n"
   "\n"
   "    for(var iCh = 0; iCh < root.childNodes.length; iCh++)\n"
   "	if(root.childNodes[iCh].getAttribute('id') == 'br') {\n"
   "	    for(var iG = 0; iG < root.childNodes[iCh].childNodes.length; iG++)\n"
   "		if(parseInt(root.childNodes[iCh].childNodes[iG].getAttribute('acs'))&SEC_WR)\n"
   "		{ actEnable('actPaste',true); break; }\n"
   "	    break;\n"
   "	}\n"
   "    if(rootAccess&SEC_WR) actEnable('actPaste',true);\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * selectChildRecArea - Make page content          *\n"
   " ***************************************************/\n"
   "function selectChildRecArea( node, aPath, cBlk )\n"
   "{\n"
   "    var iArea = 0;\n"
   "    //View title name\n"
   "    if(aPath == \"/\") {\n"
   "	// Set node icon\n"
   "	if(nodeTextByTagId(node,'img','ico') != null) {\n"
   "	    document.getElementById('pgIco').src = '/'+MOD_ID+selPath+'?com=ico&size=32';\n"
   "	    document.getElementById('pgIco').style.visibility = 'visible';\n"
   "	}\n"
   "	else document.getElementById('pgIco').style.visibility = 'hidden';\n"
   "	// Set title\n"
   "	document.getElementById('pgTitle').innerText = node.getAttribute('dscr');\n"
   "	// Delete tabs of deleted areas\n"
   "	var activeTab = null;\n"
   "	var tabs = document.getElementById('pgTabs');\n"
   "	for(var iTbs = 0; iTbs < tabs.childNodes.length; iTbs++) {\n"
   "	    var iCf;\n"
   "	    for(iCf = 0; iCf < node.childNodes.length; iCf++)\n"
   "		if(node.childNodes[iCf].nodeName.toLowerCase() == 'area' &&\n"
   "			tabs.childNodes[iTbs].innerText == node.childNodes[iCf].getAttribute('dscr'))\n"
   "		    break;\n"
   "	    if(iCf >= node.childNodes.length) {\n"
   "		tabs.removeChild(tabs.childNodes[iTbs]);\n"
   "		iTbs--;\n"
   "	    }\n"
   "	    else if(tabs.childNodes[iTbs].className == 'active') activeTab = tabs.childNodes[iTbs];\n"
   "	}\n"
   "	// Add new tabs\n"
   "	for(var iCf = 0; iCf < node.childNodes.length; iCf++) {\n"
   "	    if(node.childNodes[iCf].nodeName.toLowerCase() != 'area') continue;\n"
   "	    var iTbs;\n"
   "	    for(iTbs = 0; iTbs < tabs.childNodes.length; iTbs++)\n"
   "		if(tabs.childNodes[iTbs].innerText == node.childNodes[iCf].getAttribute('dscr'))\n"
   "		    break;\n"
   "	    if(iTbs >= tabs.childNodes.length) {\n"
   "		var itab = document.createElement('span');\n"
   "		itab.innerText = node.childNodes[iCf].getAttribute('dscr');\n"
   "		itab.onclick = function( ) { tabSelect(this); return false; }\n"
   "		if(iArea >= tabs.childNodes.length) tabs.appendChild(itab);\n"
   "		else tabs.insertBefore(itab,tabs.childNodes[iArea]);\n"
   "		node.childNodes[iCf].setAttribute('qview','0');\n"
   "	    }\n"
   "	    iArea++;\n"
   "	}\n"
   "	if(!activeTab && tabs.childNodes.length) { activeTab = tabs.childNodes[0]; activeTab.className = 'active'; }\n"
   "	// Preparing of the active tab\n"
   "	for(var iCf = 0; iCf < node.childNodes.length; iCf++)\n"
   "	    if(node.childNodes[iCf].nodeName.toLowerCase() == 'area' &&\n"
   "		    activeTab.innerText == node.childNodes[iCf].getAttribute('dscr'))\n"
   "	    {\n"
   "		var refresh = parseInt(node.childNodes[iCf].getAttribute('qview'));\n"
   "		var cPg = document.getElementById('pgCont');\n"
   "		if(!refresh) {\n"
   "		    while(cPg.childNodes.length) cPg.removeChild(cPg.childNodes[0]);\n"
   "		    selectChildRecArea(node.childNodes[iCf],aPath+node.childNodes[iCf].getAttribute('id')+'/',cPg);\n"
   "		    //  Mark last drawed tabs\n"
   "		    node.childNodes[iCf].setAttribute('qview','1');\n"
   "		}\n"
   "		else selectChildRecArea(node.childNodes[iCf],aPath+node.childNodes[iCf].getAttribute('id')+'/',null);\n"
   "\n"
   "		toFitPgEls();\n"
   "	    }\n"
   "	return;\n"
   "    }\n"
   "    else for(var iCf = 0; iCf < node.childNodes.length; iCf++) {\n"
   "	var t_s = node.childNodes[iCf];\n"
   "\n"
   "	// Check access to node\n"
   "	var wr = parseInt(t_s.getAttribute('acs'))&SEC_WR;\n"
   "\n"
   "	// View areas\n"
   "	if(t_s.nodeName.toLowerCase() == 'area') {\n"
   "	    var cntBlk = cBlk;\n"
   "	    if(cntBlk) {\n"
   "		var cntBlk = document.createElement('fieldset');\n"
   "		cntBlk.className = 'elem';\n"
   "		cntBlk.appendChild(document.createElement('legend'));\n"
   "		cntBlk.childNodes[0].appendChild(document.createTextNode(t_s.getAttribute('dscr')));\n"
   "		cBlk.appendChild(cntBlk);\n"
   "	    }\n"
   "	    selectChildRecArea(t_s,aPath+t_s.getAttribute('id')+'/',cntBlk);\n"
   "	}\n"
   "	// View list elements\n"
   "	else if(t_s.nodeName.toLowerCase() == 'list') {\n"
   "	    var brPath = (aPath+t_s.getAttribute('id')).replace(/%/g,'%25').replace(/\\//g,'%2f');\n"
   "	    var lab = null; var val = null;\n"
   "\n"
   "	    if(cBlk) {\n"
   "		var dBlk = document.createElement('div'); dBlk.className = 'elem';\n"
   "		lab = document.createElement('span'); lab.className = 'label';\n"
   "		dBlk.appendChild(lab);\n"
   "		dBlk.appendChild(document.createElement('br'));\n"
   "		val = document.createElement('select'); val.className = 'list';\n"
   "		val.size = 3;//10;\n"
   "		val.srcNode = t_s;\n"
   "		val.itPath = selPath+'/'+brPath;\n"
   "		val.onmouseover = function() { setStatus(this.itPath,10000); }\n"
   "		val.onclick = function(e) {\n"
   "		    e = e ? e : window.event;\n"
   "		    var popUpMenu = getPopup();\n"
   "		    var optEl = '';\n"
   "		    selOK = (this.selectedIndex >= 0 && this.options[this.selectedIndex].label);\n"
   "		    if(this.srcNode.getAttribute('tp') == 'br' && selOK)\n"
   "			optEl += \"<option posId='go'>###Go###</option><option disabled='true'>------------</option>\";\n"
   "		    if((parseInt(this.srcNode.getAttribute('acs'))&SEC_WR) && this.srcNode.getAttribute('s_com')) {\n"
   "			if(this.srcNode.getAttribute('s_com').search('add') != -1)\n"
   "			    optEl += \"<option posId='add'>###Add###</option>\";\n"
   "			if(this.srcNode.getAttribute('s_com').search('ins') != -1 && selOK)\n"
   "			    optEl += \"<option posId='ins'>###Insert###</option>\";\n"
   "			if(this.srcNode.getAttribute('s_com').search('edit') != -1 && selOK)\n"
   "			    optEl += \"<option posId='edit'>###Edit###</option>\";\n"
   "			if(this.srcNode.getAttribute('s_com').search('del') != -1 && selOK)\n"
   "			    optEl += \"<option posId='del'>###Delete###</option>\";\n"
   "			if(this.srcNode.getAttribute('s_com').search('move') != -1 && selOK)\n"
   "			    optEl += \"<option disabled='true'>------------</option><option posId='up'>###Item up###</option><option posId='down'>###Item down###</option>\";\n"
   "		    }\n"
   "		    popUpMenu.childNodes[0].innerHTML = optEl;\n"
   "		    if(popUpMenu.childNodes[0].childNodes.length) {\n"
   "			popUpMenu.srcNode = this.srcNode;\n"
   "			popUpMenu.itPath = this.itPath;\n"
   "			if(this.selectedIndex >= 0) {\n"
   "			    popUpMenu.lsId = this.options[this.selectedIndex].lsId;\n"
   "			    popUpMenu.lsText = this.options[this.selectedIndex].value;\n"
   "			    if(!popUpMenu.lsId) popUpMenu.lsId = popUpMenu.lsText;\n"
   "			}\n"
   "			popUpMenu.childNodes[0].size = Math.max(3,popUpMenu.childNodes[0].childNodes.length);\n"
   "			popUpMenu.style.cssText = 'visibility: visible; left: '+(e.clientX+window.pageXOffset)+'px; top: '+(e.clientY+window.pageYOffset)+'px;';\n"
   "			popUpMenu.childNodes[0].focus();\n"
   "			popUpMenu.childNodes[0].selectedIndex = -1;\n"
   "			popUpMenu.childNodes[0].onclick = function() {\n"
   "			    this.parentNode.style.cssText = 'visibility: hidden; left: -200px; top: -200px;';\n"
   "			    if(this.selectedIndex < 0 || !this.options[this.selectedIndex].getAttribute('posId')) return;\n"
   "			    var idm = parseInt(this.parentNode.srcNode.getAttribute('idm'));\n"
   "			    var posId = this.options[this.selectedIndex].getAttribute('posId');\n"
   "			    if(posId == 'go')\n"
   "				selectPage(selPath+'/'+(this.parentNode.srcNode.getAttribute('br_pref')+this.parentNode.lsId).replace(/%/g,'%25').replace(/\\//g,'%2f'));\n"
   "			    else if(posId == 'add' || posId == 'ins' || posId == 'edit') {\n"
   "				dlgWin = ReqIdNameDlg('/'+MOD_ID+'/ico');\n"
   "				dlgWin.document.getElementById('wDlgHeader').innerText = '###Setting item name###';\n"
   "				var idSz = parseInt(this.parentNode.srcNode.getAttribute('idSz'));\n"
   "				dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].maxLength = ((idSz > 0) ? idSz : 1000);\n"
   "				dlgWin.document.getElementById('wDlgType').style.display = 'none';\n"
   "				dlgWin.document.getElementById('wDlgName').style.display = idm ? '' : 'none';\n"
   "				dlgWin.document.getElementById('wDlgName').childNodes[1].childNodes[0].maxLength = ((idm > 1) ? idm : 1000);\n"
   "				var actOkFld = dlgWin.document.getElementById('wDlgActOk');\n"
   "				actOkFld.itPath = this.parentNode.itPath;\n"
   "				actOkFld.srcNode = this.parentNode.srcNode;\n"
   "				actOkFld.selectedIndex = this.selectedIndex;\n"
   "				actOkFld.lsId = this.parentNode.lsId;\n"
   "				actOkFld.lsText = this.parentNode.lsText;\n"
   "				if(posId == 'add') {\n"
   "				    dlgWin.document.getElementById('wDlgTitle').childNodes[1].innerText = '###Adding an element.###';\n"
   "				    actOkFld.onclick = function() {\n"
   "					var idm = dlgWin.document.getElementById('wDlgName').style.display!='none';\n"
   "					var inpId = dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].value;\n"
   "					var inpName = idm ? dlgWin.document.getElementById('wDlgName').childNodes[1].childNodes[0].value : inpId;\n"
   "					var rez = servSet(this.itPath,'com=com',\"<add \"+(idm?(\"id='\"+inpId+\"'\"):\"\")+\">\"+inpName+\"</add>\",true);\n"
   "					if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "					if(this.srcNode.getAttribute('tp') == 'br') treeUpdate();\n"
   "					pageRefresh();\n"
   "					document.body.dlgWin.close();\n"
   "					return false;\n"
   "				    }\n"
   "				}\n"
   "				else if(posId == 'ins') {\n"
   "				    dlgWin.document.getElementById('wDlgTitle').childNodes[1].innerText = '###Inserting an element.###';\n"
   "				    actOkFld.onclick = function() {\n"
   "					var idm = dlgWin.document.getElementById('wDlgName').style.display!='none';\n"
   "					var inpId = dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].value;\n"
   "					var inpName = idm ? dlgWin.document.getElementById('wDlgName').childNodes[1].childNodes[0].value : inpId;\n"
   "					var com = \"<ins \"+(idm?(\"id='\"+inpId+\"' \"):\"\")+\" pos='\"+this.selectedIndex+\"' p_id='\"+this.lsId+\"'>\"+inpName+\"</ins>\";\n"
   "					var rez = servSet(this.itPath,'com=com',com,true);\n"
   "					if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "					if(this.srcNode.getAttribute('tp') == 'br') treeUpdate();\n"
   "					pageRefresh();\n"
   "					document.body.dlgWin.close();\n"
   "					return false;\n"
   "				    }\n"
   "				}\n"
   "				else if(posId == 'edit') {\n"
   "				    dlgWin.document.getElementById('wDlgTitle').childNodes[1].innerText = '###Renaming the element.###';\n"
   "				    dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].value = idm ? this.parentNode.lsId : this.parentNode.lsText;\n"
   "				    if(idm) dlgWin.document.getElementById('wDlgName').childNodes[1].childNodes[0].value = this.parentNode.lsText;\n"
   "				    actOkFld.onclick = function() {\n"
   "					var idm = dlgWin.document.getElementById('wDlgName').style.display!='none';\n"
   "					var inpId = dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].value;\n"
   "					var inpName = idm ? dlgWin.document.getElementById('wDlgName').childNodes[1].childNodes[0].value : inpId;\n"
   "					var com = \"<edit \"+(idm?(\"id='\"+inpId+\"' \"):\"\")+\" pos='\"+this.selectedIndex+\"' p_id='\"+this.lsId+\"'>\"+inpName+\"</edit>\";\n"
   "					var rez = servSet(this.itPath,'com=com',com,true);\n"
   "					if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "					if(this.srcNode.getAttribute('tp') == 'br') treeUpdate();\n"
   "					pageRefresh();\n"
   "					document.body.dlgWin.close();\n"
   "					return false;\n"
   "				    }\n"
   "				}\n"
   "			    }\n"
   "			    else if(posId == 'up' || posId == 'down') {\n"
   "				var c_new = (posId == 'down') ? c_new = this.selectedIndex+1 : this.selectedIndex-1;\n"
   "				var rez = servSet(this.parentNode.itPath,'com=com',\"<move pos='\"+this.selectedIndex+\"' to='\"+c_new+\"'/>\",true);\n"
   "				if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "				pageRefresh();\n"
   "			    }\n"
   "			    else if(posId == 'del') {\n"
   "				var com = idm ? (\"<del pos='\"+this.selectedIndex+\"' id='\"+this.parentNode.lsId+\"'/>\") :\n"
   "						(\"<del pos='\"+this.selectedIndex+\"'>\"+this.parentNode.lsText+\"</del>\");\n"
   "				var rez = servSet(this.parentNode.itPath,'com=com',com,true);\n"
   "				if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "				if(this.parentNode.srcNode.getAttribute('tp') == 'br') treeUpdate();\n"
   "				pageRefresh();\n"
   "			    }\n"
   "			    return false;\n"
   "			}\n"
   "		    }\n"
   "		    return false;\n"
   "		}\n"
   "		dBlk.appendChild(val);\n"
   "		cBlk.appendChild(dBlk);\n"
   "\n"
   "		t_s.addr_lab = lab; t_s.addr_val = val;\n"
   "	    }\n"
   "	    else { lab = t_s.addr_lab; val = t_s.addr_val; }\n"
   "	    //  Fill list\n"
   "	    lab.innerText = t_s.getAttribute('dscr') + ': ';\n"
   "	    val.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "\n"
   "	    while(val.childNodes.length) val.removeChild(val.childNodes[0]);\n"
   "	    var dataReq = servGet(brPath,'com=get');\n"
   "	    if(!dataReq) continue;\n"
   "	    if((rezCod=parseInt(dataReq.getAttribute('rez'))) != Er_NoError) {\n"
   "		alertCntr(dataReq);\n"
   "		if(rezCod != Er_Core_CntrWarning) continue;\n"
   "	    }\n"
   "	    for(var iEl = 0; iEl < dataReq.childNodes.length; iEl++)\n"
   "		if(dataReq.childNodes[iEl].nodeName.toLowerCase() == 'el') {\n"
   "		    var opt = document.createElement('option');\n"
   "		    opt.lsId = dataReq.childNodes[iEl].getAttribute('id');\n"
   "		    opt.innerText = dataReq.childNodes[iEl].textContent;\n"
   "		    val.appendChild(opt);\n"
   "		}\n"
   "	    while(val.childNodes.length < 3) {\n"
   "		var opt = document.createElement('option');\n"
   "		//opt.disabled = true;\n"
   "		val.appendChild(opt);\n"
   "	    }\n"
   "	    val.size = 3; //Math.min(10,Math.max(4,val.childNodes.length));\n"
   "	}\n"
   "	// View images\n"
   "	else if(t_s.nodeName.toLowerCase() == \"img\") {\n"
   "	    var brPath = (aPath+t_s.getAttribute('id')).replace(/%/g,'%25').replace(/\\//g,'%2f').replace(/%/g,'%25');\n"
   "	    var lab = null; var val = null;\n"
   "\n"
   "	    if(cBlk) {\n"
   "		var dBlk = document.createElement('div'); dBlk.className = 'elem';\n"
   "		lab = document.createElement('span'); lab.className = 'label';\n"
   "		dBlk.appendChild(lab);\n"
   "		if(!t_s.getAttribute(\"v_sz\") || parseInt(t_s.getAttribute(\"v_sz\")) > 70)\n"
   "		    dBlk.appendChild(document.createElement('br'));\n"
   "		val = document.createElement('img'); val.className = 'picture';\n"
   "		if(t_s.getAttribute('h_sz')) val.style.width = t_s.getAttribute('h_sz')+'px';\n"
   "		if(t_s.getAttribute(\"v_sz\")) val.style.height = t_s.getAttribute(\"v_sz\")+'px';\n"
   "		val.itPath = selPath+'/'+brPath;\n"
   "		val.onmouseover = function( ) { setStatus(this.itPath,10000); }\n"
   "		if(wr) {\n"
   "		    val.style.cursor = 'pointer';\n"
   "		    val.onclick = function( ) {\n"
   "			dlgWin = ReqIdNameDlg('/'+MOD_ID+'/img_save','###Selecting an image file for download to the picture field.###','/'+MOD_ID+this.itPath+'?com=img',true);\n"
   "			dlgWin.document.getElementById('wDlgHeader').innerText = '###Setting an image###';\n"
   "			dlgWin.document.getElementById('wDlgType').style.display = 'none';\n"
   "			dlgWin.document.getElementById('wDlgId').style.display = 'none';\n"
   "			dlgWin.document.getElementById('wDlgName').style.display = '';\n"
   "			dlgWin.document.getElementById('wDlgActOk').type = 'submit';\n"
   "			if(!isKonq) dlgWin.document.getElementById('wDlgFormBlk').onsubmit = function( )\n"
   "			{ setTimeout('document.body.dlgWin.close(); pageRefresh();',pgRefrTmDef); }\n"
   "			else dlgWin.document.getElementById('wDlgActCancel').onclick = function( )\n"
   "			{ setTimeout('document.body.dlgWin.close(); pageRefresh();',pgRefrTmDef); }\n"
   "			return false;\n"
   "		    }\n"
   "		}\n"
   "		dBlk.appendChild(val);\n"
   "		cBlk.appendChild(dBlk);\n"
   "\n"
   "		t_s.addr_lab = lab; t_s.addr_val = val;\n"
   "	    }\n"
   "	    else { lab = t_s.addr_lab; val = t_s.addr_val; }\n"
   "	    //  Set image\n"
   "	    if(lab) lab.innerText = t_s.getAttribute('dscr') + ':';\n"
   "	    if(val) {\n"
   "		val.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "		val.src = '/'+MOD_ID+selPath+'/'+brPath+'?com=img&rnd='+Math.floor(Math.random()*1000);\n"
   "	    }\n"
   "	}\n"
   "	else if(t_s.nodeName.toLowerCase() == 'table') {\n"
   "	    var brPath = (aPath+t_s.getAttribute('id')).replace(/%/g,'%25').replace(/\\//g,'%2f');\n"
   "	    var lab = null; var table = null;\n"
   "	    if(cBlk) {\n"
   "		var dBlk = document.createElement('div'); dBlk.className = 'elem';\n"
   "		lab = document.createElement('span'); lab.className = 'label';\n"
   "		dBlk.appendChild(lab);\n"
   "		dBlk.appendChild(document.createElement('div')); dBlk.childNodes[1].className = 'table';\n"
   "		dBlk.childNodes[1].style.width = (document.getElementById('pgCont').clientWidth-40)+'px';\n"
   "		table = document.createElement('table'); table.className = 'elem'; table.cellPadding = 2; table.cellSpacing = 0;\n"
   "		table.itPath = selPath+'/'+brPath;\n"
   "		table.onmouseover = function() { setStatus(this.itPath,10000); }\n"
   "		if(wr) {\n"
   "		    table.srcNode = t_s;\n"
   "		    table.comSet = function(row, col, val) {\n"
   "			var com = \"<set col='\"+this.srcNode.childNodes[col].getAttribute('id')+\"' \";\n"
   "			if(!this.srcNode.getAttribute('key')) com += \"row='\" + row + \"' \";\n"
   "			else {\n"
   "			    var keys = this.srcNode.getAttribute('key').split(',');\n"
   "			    for(var iOff = 0; iOff < keys.length; iOff++)\n"
   "				for(var iEl = 0; iEl < this.srcNode.childNodes.length; iEl++)\n"
   "				    if(this.srcNode.childNodes[iEl].getAttribute('id') == keys[iOff])\n"
   "				    { com += \"key_\"+keys[iOff]+\"='\"+this.srcNode.childNodes[iEl].childNodes[row].textContent+\"' \"; break; }\n"
   "			}\n"
   "			com += \">\"+strEncode(val)+\"</set>\";\n"
   "\n"
   "			var rez = servSet(this.itPath, 'com=com', com, true);\n"
   "			if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "			else this.srcNode.childNodes[col].childNodes[row].innerText = val;\n"
   "			if(!parseInt(rez.getAttribute('noReload'))) pageRefresh(pgRefrTmDef);\n"
   "			else this.setElements(true);\n"
   "		    }\n"
   "		}\n"
   "		dBlk.childNodes[1].appendChild(table);\n"
   "		cBlk.appendChild(dBlk);\n"
   "\n"
   "		table.setElements = function( saveCh ) {\n"
   "		    for(var iCol = 0; iCol < this.srcNode.childNodes.length; iCol++) {\n"
   "			var prcCol = this.srcNode.childNodes[iCol];\n"
   "			this.childNodes[0].childNodes[iCol+1].innerText = prcCol.getAttribute('dscr');\n"
   "\n"
   "			for(var iRow = 0; iRow < prcCol.childNodes.length; iRow++) {\n"
   "			    var tblCell = this.childNodes[iRow+1].childNodes[iCol+1];\n"
   "\n"
   "			    //   The list processingLoad selected list\n"
   "			    var ind_ls = new Array(); var val_ls = new Array();\n"
   "			    var isSel = false; var isLocSel = false;\n"
   "			    if((isLocSel=(prcCol.childNodes[iRow].getAttribute('dest') == 'select' || prcCol.childNodes[iRow].getAttribute('dest') == 'sel_ed')) ||\n"
   "				prcCol.getAttribute('dest') == 'select' || prcCol.getAttribute('dest') == 'sel_ed')\n"
   "			    {\n"
   "				isSel = true;\n"
   "				var selO = isLocSel ? prcCol.childNodes[iRow] : prcCol;\n"
   "				if(isLocSel || !prcCol.val_ls) {\n"
   "				    if(!selO.getAttribute('select')) {\n"
   "					if(selO.getAttribute('sel_id')) ind_ls = selO.getAttribute('sel_id').split(';');\n"
   "					val_ls = selO.getAttribute('sel_list').split(';');\n"
   "				    }\n"
   "				    else {\n"
   "					var xLst = servGet((genReqs?'':selPath+'/')+selO.getAttribute('select').replace(/%/g,'%25').replace(/\\//g,'%2f'),'com=get');\n"
   "					for(var iEl = 0; xLst && iEl < xLst.childNodes.length; iEl++) {\n"
   "					    if(xLst.childNodes[iEl].nodeName.toLowerCase() != 'el') continue;\n"
   "					    if(xLst.childNodes[iEl].getAttribute('id'))\n"
   "						ind_ls.push(xLst.childNodes[iEl].getAttribute('id'));\n"
   "					    val_ls.push(xLst.childNodes[iEl].textContent);\n"
   "					}\n"
   "				    }\n"
   "				    if(!prcCol.val_ls) prcCol.val_ls = val_ls, prcCol.ind_ls = ind_ls;\n"
   "				}\n"
   "				if(!isLocSel) val_ls = prcCol.val_ls, ind_ls = prcCol.ind_ls;\n"
   "				else selO.val_ls = val_ls, selO.ind_ls = ind_ls;\n"
   "			    }\n"
   "\n"
   "			    //   The item data\n"
   "			    if(tblCell.isEnter && tblCell.childNodes.length && saveCh)\n"
   "				prcCol.childNodes[iRow].textContent = tblCell.childNodes[0].value;\n"
   "			    var cval = prcCol.childNodes[iRow].textContent;\n"
   "			    tblCell.isEdited = false; tblCell.cRow = iRow; tblCell.cCol = iCol;\n"
   "			    if(tblCell.isEnter) while(tblCell.childNodes.length) tblCell.removeChild(tblCell.lastChild);\n"
   "			    tblCell.isEnter = this.isEnter = false;\n"
   "			    tblCell.className = \"\";\n"
   "			    if(prcCol.getAttribute('tp') == 'bool') {\n"
   "				//tblCell.innerText = parseInt(cval) ? 'On' : 'Off';\n"
   "				//tblCell.style.fontWeight = parseInt(cval)?'bold':'normal';\n"
   "				tblCell.innerHTML = parseInt(cval) ? \"<img src='/\"+MOD_ID+\"/img_button_ok'/> \" : '';\n"
   "			    }\n"
   "			    else if(isSel) {\n"
   "				tblCell.innerText = cval;\n"
   "				for(var iEl = 0; iEl < val_ls.length; iEl++)\n"
   "				    if((ind_ls.length && ind_ls[iEl] == cval) || (!ind_ls.length && val_ls[iEl] == cval))\n"
   "					tblCell.innerText = val_ls[iEl];\n"
   "			    }\n"
   "			    else if(prcCol.getAttribute('tp') == 'time') {\n"
   "				var dt = new Date(parseInt(cval)*1000);\n"
   "				tblCell.innerText = i2s(dt.getDate(),10,2)+'.'+i2s(dt.getMonth()+1,10,2)+'.'+i2s(dt.getFullYear(),10,4)+\n"
   "				    ' '+i2s(dt.getHours(),10,2)+':'+i2s(dt.getMinutes(),10,2)+':'+i2s(dt.getSeconds(),10,2);\n"
   "			    }\n"
   "			    else {\n"
   "				if(prcCol.getAttribute('tp') == 'hex') cval = '0x'+parseInt(cval).toString(16);\n"
   "				else if(prcCol.getAttribute('tp') == 'oct') cval = '0'+parseInt(cval).toString(8);\n"
   "				if(cval.length <= limTblItmCnt) tblCell.innerText = cval;\n"
   "				else tblCell.innerText = cval.slice(0,limTblItmCnt) + \"...\";\n"
   "			    }\n"
   "			}\n"
   "		    }\n"
   "		    return false;\n"
   "		}\n"
   "\n"
   "		t_s.addr_lab = lab; t_s.addr_tbl = table;\n"
   "	    }\n"
   "	    else { table = t_s.addr_tbl; lab = t_s.addr_lab; }\n"
   "\n"
   "	    //  Fill the table\n"
   "	    if(lab) lab.innerText = t_s.getAttribute('dscr') + ':';\n"
   "	    if(table) {\n"
   "		table.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "\n"
   "		var dataReq = servGet(brPath,'com=get');\n"
   "		if(dataReq && (rezCod=parseInt(dataReq.getAttribute('rez'))) != Er_NoError) {\n"
   "		    alertCntr(dataReq);\n"
   "		    if(rezCod != Er_Core_CntrWarning) continue;\n"
   "		}\n"
   "\n"
   "		//   Copy values to the info tree\n"
   "		for(var iCl = 0; dataReq && iCl < dataReq.childNodes.length; iCl++) {\n"
   "		    var iCli;\n"
   "		    for(iCli = 0; iCli < t_s.childNodes.length; iCli++)\n"
   "			if(dataReq.childNodes[iCl].getAttribute('id') == t_s.childNodes[iCli].getAttribute('id')) break;\n"
   "		    if(iCli == t_s.childNodes.length) {\n"
   "			var el = t_s.ownerDocument.createElement(dataReq.childNodes[iCl].nodeName);\n"
   "			for(var i_a = 0; i_a < dataReq.childNodes[iCl].attributes.length; i_a++)\n"
   "			    el.setAttribute(dataReq.childNodes[iCl].attributes[i_a].name,dataReq.childNodes[iCl].attributes[i_a].value);\n"
   "			t_s.appendChild(el);\n"
   "		    }\n"
   "		    while(t_s.childNodes[iCli].lastChild) t_s.childNodes[iCli].removeChild(t_s.childNodes[iCli].lastChild);\n"
   "		    for(var iRw = 0; iRw < dataReq.childNodes[iCl].childNodes.length; iRw++) {\n"
   "			var el = t_s.ownerDocument.createElement(dataReq.childNodes[iCl].childNodes[iRw].nodeName);\n"
   "			var dO = dataReq.childNodes[iCl].childNodes[iRw];\n"
   "			el.textContent = dO.textContent;\n"
   "			for(iA = 0; iA < dO.attributes.length; iA++)\n"
   "			    el.setAttribute(dO.attributes[iA].name, dO.attributes[iA].value);\n"
   "			t_s.childNodes[iCli].appendChild(el);\n"
   "		    }\n"
   "		}\n"
   "\n"
   "		//   Calc rows and columns\n"
   "		var nCol = t_s.childNodes.length;\n"
   "		var nRow = nCol ? t_s.childNodes[0].childNodes.length : 0;\n"
   "\n"
   "		//   Update table structure\n"
   "		while(table.childNodes.length > (nRow+1)) table.removeChild(table.lastChild);\n"
   "		while(table.childNodes.length < (nRow+1)) table.appendChild(document.createElement('tr'));\n"
   "\n"
   "		for(var iRw = 0; iRw < table.childNodes.length; iRw++) {\n"
   "		    while(table.childNodes[iRw].childNodes.length > (nCol+1))\n"
   "			table.childNodes[iRw].removeChild(table.childNodes[iRw].lastChild);\n"
   "		    while(table.childNodes[iRw].childNodes.length < (nCol+1)) {\n"
   "			if(!table.childNodes[iRw].childNodes.length) {\n"
   "			    var cCell = document.createElement('th');\n"
   "			    if(wr && t_s.getAttribute('s_com')) {\n"
   "				cCell.style.cursor = 'pointer';\n"
   "				cCell.srcNode = t_s;\n"
   "				cCell.onclick = function(e) {\n"
   "				    var rowP = parseInt(this.innerText);\n"
   "				    if(!e) e = window.event;\n"
   "				    var popUpMenu = getPopup();\n"
   "				    var optEl = '';\n"
   "				    var coms = this.srcNode.getAttribute('s_com').split(',');\n"
   "				    for(var iCom = 0; iCom < coms.length; iCom++)\n"
   "					if((tVl=coms[iCom].split(\":\"))[0] == 'add')\n"
   "					    optEl += \"<option posId='add'>\"+((tVl.length>1)?tVl[1]:\"###Add row###\")+\"</option>\";\n"
   "					else if(tVl[0] == 'ins') {\n"
   "					    if(!rowP) continue;\n"
   "					    optEl += \"<option posId='ins'>\"+((tVl.length>1)?tVl[1]:\"###Insert row###\")+\"</option>\";\n"
   "					}\n"
   "					else if(tVl[0] == 'del') {\n"
   "					    if(!rowP) continue;\n"
   "					    optEl += \"<option posId='del'>\"+((tVl.length>1)?tVl[1]:\"###Delete row###\")+\"</option>\";\n"
   "					}\n"
   "					else if(tVl[0] == 'move') {\n"
   "					    if(!rowP) continue;\n"
   "					    optEl += \"<option posId='up'>###Up row###</option><option posId='down'>###Down row###</option>\";\n"
   "					}\n"
   "					//    User commands\n"
   "					else optEl += \"<option posId='\"+tVl[0]+\"'>\"+((tVl.length>1)?tVl[1]:tVl[0])+\"</option>\";\n"
   "				    popUpMenu.childNodes[0].innerHTML = optEl;\n"
   "\n"
   "				    if(popUpMenu.childNodes[0].childNodes.length) {\n"
   "					popUpMenu.childNodes[0].srcNode = this.srcNode;\n"
   "					popUpMenu.childNodes[0].itPath = this.parentNode.parentNode.itPath;\n"
   "					popUpMenu.childNodes[0].rowP = rowP-1;\n"
   "					popUpMenu.childNodes[0].size = Math.max(3,popUpMenu.childNodes[0].childNodes.length);\n"
   "					popUpMenu.style.cssText = 'visibility: visible; left: '+(e.clientX+window.pageXOffset)+'px; top: '+(e.clientY+window.pageYOffset)+'px;';\n"
   "					popUpMenu.childNodes[0].focus();\n"
   "					popUpMenu.childNodes[0].selectedIndex = -1;\n"
   "					popUpMenu.childNodes[0].onclick = function( ) {\n"
   "					    this.parentNode.style.cssText = 'visibility: hidden; left: -200px; top: -200px;';\n"
   "					    if(this.selectedIndex < 0 || !this.options[this.selectedIndex].getAttribute('posId')) return;\n"
   "					    var posId = this.options[this.selectedIndex].getAttribute('posId');\n"
   "					    var com = '';\n"
   "					    if(posId == 'add')		com = \"<add/>\";\n"
   "					    else if(posId == 'ins')	com = \"<ins row='\"+this.rowP+\"'/>\";\n"
   "					    else if(posId == 'up')	com = \"<move row='\"+this.rowP+\"' to='\"+(this.rowP-1)+\"'/>\";\n"
   "					    else if(posId == 'down')	com = \"<move row='\"+this.rowP+\"' to='\"+(this.rowP+1)+\"'/>\";\n"
   "					    else {\n"
   "						var com;\n"
   "						if(posId == 'del') com = \"<del \";\n"
   "						else com = \"<\"+posId+\" \";	//User commands\n"
   "\n"
   "						if(!this.srcNode.getAttribute('key')) com += \"row='\"+this.rowP+\"' \";\n"
   "						else if(this.rowP) {\n"
   "						    var keys = this.srcNode.getAttribute('key').split(',');\n"
   "						    for(var iOff = 0; iOff < keys.length; iOff++)\n"
   "							for(var iEl = 0; iEl < this.srcNode.childNodes.length; iEl++)\n"
   "							    if(this.srcNode.childNodes[iEl].getAttribute('id') == keys[iOff])\n"
   "							    { com += \"key_\"+keys[iOff]+\"='\"+this.srcNode.childNodes[iEl].childNodes[this.rowP].textContent+\"' \"; break; }\n"
   "						}\n"
   "						com += \"/>\";\n"
   "					    }\n"
   "					    if(com.length) {\n"
   "						var rez = servSet(this.itPath,'com=com',com,true);\n"
   "						if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "						if(!parseInt(rez.getAttribute('noReload'))) pageRefresh(pgRefrTmDef);\n"
   "					    }\n"
   "					    return false;\n"
   "					}\n"
   "				    }\n"
   "				    return false;\n"
   "				}\n"
   "			    }\n"
   "			}\n"
   "			else {\n"
   "			    var cCell = document.createElement(iRw?'td':'th');\n"
   "			    var iCol = table.childNodes[iRw].childNodes.length-1;\n"
   "			    if(!iRw) {\n"
   "				if((tVl=t_s.childNodes[iCol].getAttribute('help'))) cCell.title = tVl;\n"
   "			    }\n"
   "			    else {\n"
   "				if((tVl=t_s.childNodes[iCol].childNodes[iRw-1].getAttribute('help'))) cCell.title = tVl;\n"
   "				else if(table.childNodes[0].childNodes[iCol+1].title) cCell.title = table.childNodes[0].childNodes[iCol+1].title;\n"
   "				var colTp = t_s.childNodes[iCol].getAttribute('tp');\n"
   "				var colDst = t_s.childNodes[iCol].childNodes[iRw-1].getAttribute('dest');\n"
   "				if(!colDst) colDst = t_s.childNodes[iCol].getAttribute('dest');\n"
   "				cCell.style.textAlign = (colTp == \"bool\" || colTp == \"dec\" || colTp == \"real\" || colTp == \"time\" || colDst == \"sel_ed\" || colDst == \"select\") ? \"center\" : \"\";\n"
   "			    }\n"
   "			    cCell.onclick = function( ) {\n"
   "				var cTbl = this.parentNode.parentNode;\n"
   "				if(cTbl.isEnter && !this.isEnter) cTbl.setElements();\n"
   "				return true;\n"
   "			    }\n"
   "			    if(iRw && wr && parseInt(t_s.childNodes[iCol].getAttribute('acs'))&SEC_WR)\n"
   "			    cCell.ondblclick = function( ) {\n"
   "				var cTbl = this.parentNode.parentNode;\n"
   "				if(cTbl.isEnter) cTbl.setElements();\n"
   "				this.isEnter = cTbl.isEnter = true;\n"
   "				this.className = \"edit\";\n"
   "				var prcCol = cTbl.srcNode.childNodes[this.cCol];\n"
   "				var cval = prcCol.childNodes[this.cRow].textContent;\n"
   "				var isLocSel = false;\n"
   "\n"
   "				if(prcCol.getAttribute('tp') == 'bool') {\n"
   "				    this.innerHTML = \"<input type='checkbox'/>\";\n"
   "				    this.firstChild.checked = parseInt(cval);\n"
   "				    this.firstChild.onclick = function( ) {\n"
   "					this.parentNode.parentNode.parentNode.comSet(this.parentNode.cRow,this.parentNode.cCol,this.checked?'1':'0');\n"
   "				    }\n"
   "				}\n"
   "				else if((isLocSel=prcCol.childNodes[this.cRow].getAttribute('dest')) || prcCol.getAttribute('dest') == 'select') {\n"
   "				    var selO = isLocSel ? prcCol.childNodes[this.cRow] : prcCol;\n"
   "				    this.innerHTML = \"<select/>\";\n"
   "				    this.firstChild.onchange = function( ) {\n"
   "					if(this.selectedIndex < 0) return;\n"
   "					var selId = this.options[this.selectedIndex].getAttribute('vid');\n"
   "					var selVal = this.options[this.selectedIndex].innerText;\n"
   "					this.parentNode.parentNode.parentNode.comSet(this.parentNode.cRow,this.parentNode.cCol,selId?selId:selVal);\n"
   "					return false;\n"
   "				    }\n"
   "				    var valWCfg = ''; var sel_ok = false;\n"
   "				    for(var iEl = 0; iEl < selO.val_ls.length; iEl++) {\n"
   "					valWCfg += \"<option \"+\n"
   "					    (selO.ind_ls.length ? (\"vid='\"+strEncode(selO.ind_ls[iEl])+\"' \"+((selO.ind_ls[iEl]==cval)?\"selected='true'\":\"\"))\n"
   "								  : ((selO.val_ls[iEl]==cval)?\"selected='true'\":\"\"))+\">\"+strEncode(selO.val_ls[iEl])+\"</option>\";\n"
   "					if((selO.ind_ls.length && selO.ind_ls[iEl] == cval) || (!selO.ind_ls.length && selO.val_ls[iEl] == cval))\n"
   "					    sel_ok = true;\n"
   "				    }\n"
   "				    if(!sel_ok) valWCfg += \"<option selected='true'>\"+strEncode(cval)+\"</option>\";\n"
   "				    this.firstChild.innerHTML = valWCfg;\n"
   "				}\n"
   "				else if(prcCol.getAttribute('tp') == 'time') {\n"
   "				    this.apply = function( ) {\n"
   "					var dt = new Date(0);\n"
   "					dt.setDate(parseInt(this.childNodes[0].value));\n"
   "					dt.setMonth(parseInt(this.childNodes[1].value)-1);\n"
   "					dt.setFullYear(parseInt(this.childNodes[2].value));\n"
   "					dt.setHours(parseInt(this.childNodes[4].value));\n"
   "					dt.setMinutes(parseInt(this.childNodes[5].value));\n"
   "					dt.setSeconds(parseInt(this.childNodes[6].value));\n"
   "					this.parentNode.parentNode.comSet(this.cRow,this.cCol,Math.floor(dt.getTime()/1000));\n"
   "					return false;\n"
   "				    }\n"
   "				    this.innerHTML = \"<input size='2'/><input size='2'/><input size='4'/>&nbsp;<input size='2'/><input size='2'/><input size='2'/>\";\n"
   "				    this.childNodes[0].onkeyup = this.childNodes[1].onkeyup = this.childNodes[2].onkeyup =\n"
   "				    this.childNodes[4].onkeyup = this.childNodes[5].onkeyup = this.childNodes[6].onkeyup = function(e) {\n"
   "					if(!e) e = window.event;\n"
   "					if(e.keyCode == 13) { this.parentNode.apply(); return true; }\n"
   "					if(e.keyCode == 27) {\n"
   "					    var val_w = this.parentNode;\n"
   "					    for(var iCh = 0; iCh < val_w.childNodes.length; iCh++)\n"
   "						if(val_w.childNodes[iCh].defaultValue)\n"
   "						    val_w.childNodes[iCh].value = val_w.childNodes[iCh].defaultValue;\n"
   "					    val_w.removeChild(this.parentNode.childNodes[7]);\n"
   "					    return true;\n"
   "					}\n"
   "					return true;\n"
   "				    }\n"
   "				    var dt = new Date(parseInt(cval)*1000);\n"
   "				    this.childNodes[0].value = this.childNodes[0].defaultValue = dt.getDate();\n"
   "				    this.childNodes[1].value = this.childNodes[1].defaultValue = dt.getMonth()+1;\n"
   "				    this.childNodes[2].value = this.childNodes[2].defaultValue = dt.getFullYear();\n"
   "				    this.childNodes[4].value = this.childNodes[4].defaultValue = dt.getHours();\n"
   "				    this.childNodes[5].value = this.childNodes[5].defaultValue = dt.getMinutes();\n"
   "				    this.childNodes[6].value = this.childNodes[6].defaultValue = dt.getSeconds();\n"
   "				    this.isEdited = false;\n"
   "				}\n"
   "				else {\n"
   "				    if(prcCol.getAttribute('tp') == 'hex') cval = '0x'+parseInt(cval).toString(16);\n"
   "				    else if(prcCol.getAttribute('tp') == 'oct') cval = '0'+parseInt(cval).toString(8);\n"
   "				    this.innerHTML = \"<input/>\";\n"
   "				    var tp = prcCol.getAttribute('tp');\n"
   "				    if(prcCol.getAttribute('dest') == 'sel_ed') {\n"
   "					this.childNodes[0].size = 20;\n"
   "					var cmbImg = document.createElement('img'); cmbImg.src = '/'+MOD_ID+'/img_combar';\n"
   "					cmbImg.onclick = function( ) {\n"
   "					    if(!this.parentNode.val_ls || !this.parentNode.val_ls.length) return false;\n"
   "					    var combMenu = getCombo();\n"
   "					    var optHTML = '';\n"
   "					    for(var iL = 0; iL < this.parentNode.val_ls.length; iL++)\n"
   "						optHTML += '<option>'+this.parentNode.val_ls[iL]+'</option>';\n"
   "					    var edFld = this.parentNode.childNodes[0];\n"
   "					    combMenu.childNodes[0].edFld = edFld;\n"
   "					    combMenu.childNodes[0].innerHTML = optHTML;\n"
   "					    combMenu.childNodes[0].size = Math.max(3,this.parentNode.val_ls.length);\n"
   "					    combMenu.style.cssText = 'visibility: visible; left: '+posGetX(edFld,true)+'px; '+\n"
   "								     'top: '+(posGetY(edFld,true)+edFld.offsetHeight)+'px; '+\n"
   "								     'width: '+edFld.offsetWidth+'px';\n"
   "					    combMenu.childNodes[0].focus();\n"
   "					    combMenu.childNodes[0].onclick = function() {\n"
   "						this.parentNode.style.cssText = 'visibility: hidden; left: -200px; top: -200px;';\n"
   "						if(this.selectedIndex < 0) return;\n"
   "						this.edFld.value = this.options[this.selectedIndex].value;\n"
   "						this.edFld.parentNode.parentNode.parentNode.comSet(this.edFld.parentNode.cRow,this.edFld.parentNode.cCol,this.edFld.value);\n"
   "						return false;\n"
   "					    }\n"
   "					    return false;\n"
   "					}\n"
   "					tblCell.appendChild(cmbImg);\n"
   "				    }\n"
   "				    else if(tp == 'dec' || tp == 'hex' || tp == 'oct' || tp == 'real')\n"
   "				    { this.className += ' number'; this.childNodes[0].size = 10; }\n"
   "				    else this.innerHTML = \"<textarea/>\";\n"
   "				    this.prcCol = prcCol;\n"
   "				    this.apply = function( ) {\n"
   "					var curVal = this.childNodes[0].value;\n"
   "					if(this.prcCol.getAttribute('tp') == 'hex') curVal = parseInt(curVal, 16);\n"
   "					else if(this.prcCol.getAttribute('tp') == 'oct') curVal = parseInt(curVal, 8);\n"
   "					this.parentNode.parentNode.comSet(this.cRow, this.cCol, curVal);\n"
   "					return false;\n"
   "				    }\n"
   "				    this.childNodes[0].onkeydown = function(e) {\n"
   "					if(e.keyCode == 13) {\n"
   "					    e.preventDefault();\n"
   "					    if(this.nodeName == \"TEXTAREA\" && e.ctrlKey) {	//NewLine insertion\n"
   "						var selStart = this.selectionStart;\n"
   "						this.value = this.value.slice(0, selStart) + \"\\n\" + this.value.slice(this.selectionEnd);\n"
   "						this.setSelectionRange(selStart+1, selStart+1);\n"
   "						this.blur(); this.focus();\n"
   "						return true;\n"
   "					    }\n"
   "					    this.parentNode.apply();\n"
   "					}\n"
   "					if(e.keyCode == 27) this.parentNode.parentNode.parentNode.setElements();\n"
   "				    }\n"
   "				    this.firstChild.value = cval;\n"
   "				    this.childNodes[0].focus();\n"
   "				}\n"
   "				//   Prevent for wrong selection\n"
   "				if(window.getSelection) window.getSelection().removeAllRanges();\n"
   "				else if(document.selection) document.selection.empty();\n"
   "				return false;\n"
   "			    }\n"
   "			}\n"
   "			table.childNodes[iRw].appendChild(cCell);\n"
   "		    }\n"
   "		    if(table.childNodes[iRw].childNodes.length)\n"
   "			table.childNodes[iRw].childNodes[0].innerText = iRw ? iRw : '#';\n"
   "		}\n"
   "		table.srcNode = t_s;\n"
   "		table.setElements();\n"
   "		table.parentNode.style.height = \"100px\"; //Math.min(300,Math.max(100,table.clientHeight))+'px';\n"
   "	    }\n"
   "	}\n"
   "	//  View standard fields\n"
   "	else if(t_s.nodeName.toLowerCase() == 'fld') basicFields(t_s, aPath, cBlk, wr);\n"
   "	else if(t_s.nodeName.toLowerCase() == 'comm') {\n"
   "	    var brPath = (aPath+t_s.getAttribute('id')).replace(/%/g,'%25').replace(/\\//g,'%2f');\n"
   "	    var dBlk = null; var button = null;\n"
   "	    if(cBlk) {\n"
   "		if(t_s.childNodes.length) {\n"
   "		    dBlk = document.createElement('fieldset');\n"
   "		    dBlk.appendChild(document.createElement('legend'));\n"
   "		    dBlk.childNodes[0].appendChild(document.createTextNode(t_s.getAttribute('dscr')));\n"
   "		} else dBlk = document.createElement('div');\n"
   "		dBlk.className = 'elem';\n"
   "		button = document.createElement('input'); button.type = 'button';\n"
   "		button.srcNode = t_s;\n"
   "		button.brPath = brPath;\n"
   "		button.onclick = function( ) {\n"
   "		    //Check link\n"
   "		    if(this.srcNode.getAttribute('tp') == 'lnk') {\n"
   "			var dataReq = servGet(selPath+'/'+this.brPath,'com=get');\n"
   "			if(!dataReq) return false;\n"
   "			else if(parseInt(dataReq.getAttribute('rez')) != Er_NoError) { alertCntr(dataReq); return false; }\n"
   "			selectPage('/'+pathLev(selPath,0)+dataReq.textContent);\n"
   "		    }\n"
   "		    else {\n"
   "			var com = \"<set tp='\"+this.srcNode.nodeName.toLowerCase()+\"'>\";\n"
   "			for(var f_com = 0; f_com < this.srcNode.childNodes.length; f_com++)\n"
   "			    com += \"<\"+this.srcNode.childNodes[f_com].nodeName+\" id='\"+this.srcNode.childNodes[f_com].getAttribute('id')+\"'>\"+\n"
   "				this.srcNode.childNodes[f_com].textContent+\"</\"+this.srcNode.childNodes[f_com].nodeName+\">\";\n"
   "			com += '</set>';\n"
   "			var rez = servSet(selPath+'/'+this. brPath, 'com=com', com, true);\n"
   "			if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "			pageRefresh();\n"
   "		    }\n"
   "		    return false;\n"
   "		}\n"
   "		dBlk.appendChild(button);\n"
   "		cBlk.appendChild(dBlk);\n"
   "		t_s.addr_butt = button;\n"
   "	    }\n"
   "	    else button = t_s.addr_butt;\n"
   "\n"
   "	    //  Update or create parameters\n"
   "	    for(var f_com = 0; f_com < t_s.childNodes.length; f_com++)\n"
   "		if(t_s.childNodes[f_com].nodeName.toLowerCase() == 'fld')\n"
   "		    basicFields(t_s.childNodes[f_com], aPath+t_s.getAttribute('id')+'/', dBlk, true, true);\n"
   "\n"
   "	    //  Fill command\n"
   "	    button.value = t_s.getAttribute('dscr');\n"
   "	    button.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "	}\n"
   "    }\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * basicFields - Prepare basic fields view         *\n"
   " ***************************************************/\n"
   "function basicFields( t_s, aPath, cBlk, wr, comm )\n"
   "{\n"
   "    var brPath = (aPath+t_s.getAttribute('id')).replace(/%/g,'%25').replace(/\\//g,'%2f');\n"
   "\n"
   "    var dataReq = document.createElement('get');\n"
   "    if(!comm) {\n"
   "	dataReq = servGet(brPath,'com=get');\n"
   "	if(!dataReq) dataReq = document.createElement('get');\n"
   "	else if((rezCod=parseInt(dataReq.getAttribute('rez'))) != Er_NoError) {\n"
   "	    alertCntr(dataReq);\n"
   "	    if(!dataReq.getAttribute(\"mtxt\")) dataReq.textContent = '';\n"
   "	}\n"
   "    }\n"
   "\n"
   "    //View select fields\n"
   "    if(t_s.getAttribute('dest') == 'select') {\n"
   "	var lab = null; var val_r = null; var val_w = null;\n"
   "	if(cBlk) {\n"
   "	    // View info\n"
   "	    if(!wr) {\n"
   "		val_r = document.createElement('span'); val_r.className = 'const';\n"
   "		val_r.StatusTip = selPath+'/'+brPath; val_r.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "	    }\n"
   "	    // View edit\n"
   "	    else {\n"
   "		val_w = document.createElement('span');	val_w.className = 'line';\n"
   "		val_w.appendChild(document.createElement('select'));\n"
   "		val_w.childNodes[0].itPath = selPath+'/'+brPath;\n"
   "		val_w.childNodes[0].srcNode = t_s;\n"
   "		val_w.childNodes[0].itComm = comm;\n"
   "		val_w.childNodes[0].onchange = function( ) {\n"
   "		    if(this.selectedIndex < 0) return;\n"
   "		    var selId = this.options[this.selectedIndex].getAttribute('vid');\n"
   "		    var selVal = this.options[this.selectedIndex].innerText;\n"
   "		    if(this.itComm) this.srcNode.textContent = selId ? selId : selVal;\n"
   "		    else {\n"
   "			var updTm = pgRefrTmDef;\n"
   "			var rez = servSet(this.itPath, 'com=com', '<set>'+strEncode(selId?selId:selVal)+'</set>', true);\n"
   "			if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "			else if(rez.getAttribute('updTm'))\n"
   "			    updTm = Math.min(pgRefrTmMax,parseFloat(rez.getAttribute('updTm'))*1000);\n"
   "			pageRefresh(updTm);\n"
   "		    }\n"
   "		    return false;\n"
   "		}\n"
   "		val_w.StatusTip = selPath+'/'+brPath; val_w.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "	    }\n"
   "	    // Check use label\n"
   "	    if(t_s.getAttribute('dscr')) {\n"
   "		lab = document.createElement('span'); lab.className = 'label';\n"
   "		cBlk.dBlk = document.createElement('div'); cBlk.dBlk.className = 'elem'; cBlk.dBlk.appendChild(lab);\n"
   "		if(val_w) cBlk.dBlk.appendChild(val_w);\n"
   "		if(val_r) cBlk.dBlk.appendChild(val_r);\n"
   "		cBlk.appendChild(cBlk.dBlk);\n"
   "	    }\n"
   "	    else {\n"
   "		if(val_w) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_w); else { delete val_w; val_w = null; } }\n"
   "		if(val_r) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_r); else { delete val_r; val_r = null; } }\n"
   "	    }\n"
   "	    t_s.addr_lab = lab; t_s.addr_val_r = val_r; t_s.addr_val_w = val_w;\n"
   "	}\n"
   "	else { lab = t_s.addr_lab; val_r = t_s.addr_val_r; val_w = t_s.addr_val_w; }\n"
   "	// Fill combo\n"
   "	if(lab) lab.innerText = t_s.getAttribute('dscr') + ':';\n"
   "	if(val_w || val_r) {\n"
   "	    (val_r||val_w).title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "	    var sel_ok = false, c_el = 0;\n"
   "	    if(!t_s.getAttribute('select')) {\n"
   "		ind_ls = (ind_ls=t_s.getAttribute('sel_id')) ? ind_ls.split(';') : new Array();\n"
   "		val_ls = (val_ls=t_s.getAttribute('sel_list')) ? val_ls.split(';') : new Array();\n"
   "		var valWCfg = '';\n"
   "		for(var ls_i = 0; ls_i < val_ls.length && val_ls[ls_i].length && (!ind_ls.length || ls_i < ind_ls.length); ls_i++) {\n"
   "		    if(val_w) valWCfg += \"<option \"+\n"
   "			(ind_ls.length ? (\"vid='\"+strEncode(ind_ls[ls_i])+\"' \"+((ind_ls[ls_i]==dataReq.textContent)?\"selected='true'\":\"\"))\n"
   "			    : ((val_ls[ls_i]==dataReq.textContent)?\"selected='true'\":\"\")) + \">\" + strEncode(val_ls[ls_i]) + \"</option>\";\n"
   "		    if((ind_ls.length && ind_ls[ls_i] == dataReq.textContent) || (!ind_ls.length && val_ls[ls_i] == dataReq.textContent))\n"
   "		    { sel_ok = true; if(val_r) val_r.innerText = val_ls[ls_i]; }\n"
   "		}\n"
   "	    }\n"
   "	    else {\n"
   "		var xLst = servGet(t_s.getAttribute('select').replace(/%/g,'%25').replace(/\\//g,'%2f'),'com=get');\n"
   "		if(xLst) {\n"
   "		    for(var iEl = 0; iEl < xLst.childNodes.length; iEl++) {\n"
   "			if(xLst.childNodes[iEl].nodeName.toLowerCase() != 'el') continue;\n"
   "			var curElId = xLst.childNodes[iEl].getAttribute('id');\n"
   "			var curElVl = xLst.childNodes[iEl].textContent;\n"
   "			if(val_w) valWCfg += \"<option \" +\n"
   "			    (curElId ? (\"vid='\"+strEncode(curElId)+\"' \"+((curElId==dataReq.textContent)?\"selected='true'\":\"\"))\n"
   "				     : ((curElVl==dataReq.textContent)?\"selected='true'\":\"\")) + \">\" + strEncode(curElVl) + \"</option>\";\n"
   "			if((curElId && curElId == dataReq.textContent) || (!curElId && curElVl == dataReq.textContent))\n"
   "			{ sel_ok = true; if(val_r) val_r.innerText = curElVl; }\n"
   "		    }\n"
   "		}\n"
   "	    }\n"
   "	    //  Insert empty field if none selected\n"
   "	    if(!sel_ok) {\n"
   "		if(val_w) valWCfg += \"<option selected='true'>\" + dataReq.textContent + \"</option>\";\n"
   "		if(val_r) val_r.innerText = dataReq.textContent;\n"
   "	    }\n"
   "	    if(val_w) val_w.childNodes[0].innerHTML = valWCfg;\n"
   "	}\n"
   "    }\n"
   "    else {\n"
   "	//View Boolean fields\n"
   "	if(t_s.getAttribute('tp') == 'bool') {\n"
   "	    var lab = null; var val_r = null; var val_w = null;\n"
   "	    if(cBlk) {\n"
   "		// View info\n"
   "		if(!wr) {\n"
   "		    val_r = document.createElement('span'); val_r.className = 'const';\n"
   "		    val_r.StatusTip = selPath+'/'+brPath; val_r.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "		}\n"
   "		// View edit\n"
   "		else {\n"
   "		    val_w = document.createElement('span'); val_w.className = 'line';\n"
   "		    val_w.appendChild(document.createElement('input'));\n"
   "		    val_w.childNodes[0].type = 'checkbox';\n"
   "		    val_w.childNodes[0].itPath = selPath+'/'+brPath;\n"
   "		    val_w.childNodes[0].srcNode = t_s;\n"
   "		    val_w.childNodes[0].itComm = comm;\n"
   "		    val_w.childNodes[0].onclick = function( ) {\n"
   "			if(this.itComm) this.srcNode.textContent = this.checked ? '1' : '0';\n"
   "			else {\n"
   "			    var updTm = pgRefrTmDef;\n"
   "			    var rez = servSet(this.itPath, 'com=com', '<set>'+(this.checked?'1':'0')+'</set>', true);\n"
   "			    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "			    else if(rez.getAttribute('updTm'))\n"
   "				updTm = Math.min(pgRefrTmMax,parseFloat(rez.getAttribute('updTm'))*1000);\n"
   "			    pageRefresh(updTm);\n"
   "			}\n"
   "			return true;\n"
   "		    }\n"
   "		    val_w.StatusTip = selPath + '/' + brPath; val_w.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "		}\n"
   "		// Check use label\n"
   "		if(t_s.getAttribute('dscr')) {\n"
   "		    lab = document.createElement('span'); lab.className = 'label';\n"
   "		    cBlk.dBlk = document.createElement('div'); cBlk.dBlk.className = 'elem'; cBlk.dBlk.appendChild(lab);\n"
   "		    if(val_w) cBlk.dBlk.appendChild(val_w);\n"
   "		    if(val_r) cBlk.dBlk.appendChild(val_r);\n"
   "		    cBlk.appendChild(cBlk.dBlk);\n"
   "		}\n"
   "		else {\n"
   "		    if(val_w) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_w); else { delete val_w; val_w = null; } }\n"
   "		    if(val_r) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_r); else { delete val_r; val_r = null; } }\n"
   "		}\n"
   "		t_s.addr_lab = lab; t_s.addr_val_r = val_r; t_s.addr_val_w = val_w;\n"
   "	    }\n"
   "	    else { lab = t_s.addr_lab; val_r = t_s.addr_val_r; val_w = t_s.addr_val_w; }\n"
   "	    // Fill CheckBox\n"
   "	    if(lab) lab.innerText = t_s.getAttribute('dscr') + ':';\n"
   "	    if(val_w) {\n"
   "		val_w.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "		val_w.childNodes[0].checked = parseInt(dataReq.textContent);\n"
   "	    }\n"
   "	    if(val_r) {\n"
   "		val_r.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "		val_r.innerText = (dataReq.textContent=='<EVAL>') ? '<EVAL>' : (parseInt(dataReq.textContent)?'###Yes### ':'###No### ');\n"
   "	    }\n"
   "	}\n"
   "	//View edit fields\n"
   "	else if(t_s.getAttribute('tp') == 'str' && (t_s.getAttribute('rows') || t_s.getAttribute('cols'))) {\n"
   "	    var lab = null; var edit = null;\n"
   "	    if(cBlk) {\n"
   "		dBlk = document.createElement('div'); dBlk.className = 'elem';\n"
   "		cBlk.appendChild(dBlk);\n"
   "		lab = document.createElement('span'); lab.className = 'label';\n"
   "		dBlk.appendChild(lab);\n"
   "		dBlk.appendChild(document.createElement('br'));\n"
   "		edit = document.createElement('textarea');\n"
   "\n"
   "		// Preparing extended part for syntax highlight\n"
   "		TA_Cntr = document.createElement('div'); TA_Cntr.className = 'TA_Cntr';\n"
   "		TA_Cntr.innerHTML = '<div class=\"TA_BD\"><div class=\"TA_HGLs\"/></div>';\n"
   "		dBlk.appendChild(TA_Cntr);\n"
   "		dBlk = TA_Cntr;\n"
   "\n"
   "		edit.oninput = function() {	//Delayed or immediate call the highlihgting\n"
   "		    if(this.prcTm && this.prcTm > 100) {	//More 100ms\n"
   "			//Disabling the highlighting\n"
   "			this.parentNode.childNodes[0].childNodes[0].innerHTML = \"\";\n"
   "			this.style.color = \"\";\n"
   "\n"
   "			//Setting update at a timeout\n"
   "			snthHglObj = this;\n"
   "			if(snthHglTmID) clearTimeout(snthHglTmID);\n"
   "			snthHglTmID = setTimeout(snthHglUpd, 3000);\n"
   "		    } else this.applySnthHgl();\n"
   "\n"
   "		    //Increasing height the widget with entering more text\n"
   "		    if(this.isVScroll == false && this.scrollHeight > this.clientHeight &&\n"
   "			    (!this.prevHeight || this.clientHeight > this.prevHeight))\n"
   "		    {\n"
   "			this.prevHeight = this.clientHeight;\n"
   "			toFitPgEls();\n"
   "		    }\n"
   "		}\n"
   "		edit.onscroll = function() {\n"
   "		    this.parentNode.childNodes[0].scrollTop = this.scrollTop;\n"
   "		    this.parentNode.childNodes[0].scrollLeft = this.scrollLeft;\n"
   "		}\n"
   "		TA_Cntr.childNodes[0].onscroll = function() {\n"
   "		    this.parentNode.childNodes[1].scrollTop = this.scrollTop;\n"
   "		    this.parentNode.childNodes[1].scrollLeft = this.scrollLeft;\n"
   "		}\n"
   "		edit.applySnthHgl = function(irl, text, lev) {\n"
   "		    if(irl == null) {\n"
   "			if(this.snthHglRules == null) { this.style.color = ''; return; }	//No highlight\n"
   "			irl = this.snthHglRules;\n"
   "			if((tVl=irl.getAttribute(\"font\"))) {\n"
   "			    var compStl = getComputedStyle(this, null);\n"
   "			    this.style.font = this.parentNode.childNodes[0].childNodes[0].style.font = getFont(tVl, compStl.getPropertyValue('font-size'), compStl.getPropertyValue('font-family'));\n"
   "			}\n"
   "			this.snthHglText = \"\";\n"
   "			this.prcTm = (new Date()).getTime();\n"
   "		    }\n"
   "		    if(text == null) text = this.value;\n"
   "		    if(lev == null)  lev = 0;\n"
   "\n"
   "		    for(var iT = 0; iT < text.length; ) {\n"
   "			var minRule = -1, minPos = -1, minSz = 0, rl, expr;\n"
   "\n"
   "			for(var iCh = 0; iCh < irl.childNodes.length; iCh++) {\n"
   "			    rl =  irl.childNodes[iCh];\n"
   "			    if(rl.nodeName == \"rule\")	expr = new RegExp(rl.getAttribute(\"expr\"),'m');\n"
   "			    else if(rl.nodeName == \"blk\") expr = new RegExp(rl.getAttribute(\"beg\"),'m');\n"
   "			    else continue;\n"
   "\n"
   "			    var mRes = expr.exec(text.slice(iT));\n"
   "			    if(!mRes || !mRes[0].length) continue;\n"
   "\n"
   "			    if(minPos < iT || (iT+mRes.index) < minPos) minPos = iT+mRes.index, minRule = iCh, minSz = mRes[0].length;\n"
   "			}\n"
   "			if(minRule < 0) { this.snthHglText += text.slice(iT).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'); break; }\n"
   "\n"
   "			//Processing the minimal rule\n"
   "			rl = irl.childNodes[minRule];\n"
   "			var hglStl = \"\";\n"
   "			if((tVl=rl.getAttribute(\"color\")) && tVl.length)		hglStl += \"color: \"+tVl+\"; \";\n"
   "			if((tVl=rl.getAttribute(\"font_weight\")) && parseInt(tVl))	hglStl += \"font-weight: bold; \";\n"
   "			if((tVl=rl.getAttribute(\"font_italic\")) && parseInt(tVl))	hglStl += \"font-style: italic; \";\n"
   "\n"
   "			if(iT < minPos)\n"
   "			    this.snthHglText += text.slice(iT,minPos).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');\n"
   "			if(hglStl.length) this.snthHglText += \"<span style='\"+hglStl+\"'>\";\n"
   "\n"
   "			if(rl.nodeName == \"rule\") {\n"
   "			    iT = minPos + minSz;\n"
   "\n"
   "			    if(rl.childNodes.length) this.applySnthHgl(rl, text.slice(minPos,iT), lev+1);\n"
   "			    else this.snthHglText += text.slice(minPos,iT).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');\n"
   "			}\n"
   "			else if(rl.nodeName == \"blk\") {\n"
   "			    expr = new RegExp(rl.getAttribute(\"end\"),'m');\n"
   "			    var mRes = expr.exec(text.slice(minPos));\n"
   "			    var sizeBlk = (mRes && mRes[0].length) ? mRes.index + mRes[0].length : text.length - minPos;\n"
   "			    iT = minPos + sizeBlk;\n"
   "\n"
   "			    if(rl.childNodes.length) this.applySnthHgl(rl, text.slice(minPos,minPos+sizeBlk), lev+1);\n"
   "			    else this.snthHglText += text.slice(minPos,minPos+sizeBlk).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');\n"
   "			}\n"
   "			if(hglStl.length) this.snthHglText += \"</span>\";\n"
   "		    }\n"
   "\n"
   "		    if(lev == 0) {\n"
   "			this.parentNode.childNodes[0].childNodes[0].innerHTML = this.snthHglText+' ';\n"
   "			this.snthHglText = null;\n"
   "			this.style.color = \"transparent\";\n"
   "			this.prcTm = (new Date()).getTime() - this.prcTm;\n"
   "		    }\n"
   "		}\n"
   "		edit.applySize = function() {\n"
   "		    this.parentNode.style.height = this.offsetHeight+'px';\n"
   "		    this.parentNode.childNodes[0].style.height = (this.offsetHeight-getSpareHeight(this.parentNode.childNodes[0]))+'px';\n"
   "		    this.style.width = this.parentNode.childNodes[0].style.width = this.parentNode.clientWidth+'px';\n"
   "		}\n"
   "		edit.setVal = function(val) {\n"
   "		    this.value = this.defaultValue = val;\n"
   "\n"
   "		    //  Try load from value\n"
   "		    if(this.snthHglRules == null && (tVl=val.match(\"<SnthHgl\\\\b.*>.*<\\\\/ *SnthHgl>\",\"gm\")) && tVl.length)\n"
   "			this.snthHglRules = (new DOMParser()).parseFromString(tVl[0],\"text/xml\").children[0];\n"
   "\n"
   "		    this.applySnthHgl();\n"
   "		    this.applySize();\n"
   "\n"
   "		    this.isVScroll = (this.scrollHeight > this.clientHeight);\n"
   "		}\n"
   "\n"
   "		// Preparing common part\n"
   "		dBlk.appendChild(edit);\n"
   "		edit.itPath = selPath+'/'+brPath;\n"
   "		edit.srcNode = t_s;\n"
   "		edit.itComm = comm;\n"
   "		edit.readOnly = !wr;\n"
   "		if(t_s.getAttribute('cols')) edit.setAttribute('cols', parseInt(t_s.getAttribute('cols')));\n"
   "		else edit.setAttribute('wrap', 'off');\n"
   "		edit.setAttribute('rows',parseInt(t_s.getAttribute('rows')) ? parseInt(t_s.getAttribute('rows')):5);\n"
   "		edit.onkeydown = function(e) {	//Inserting the tab symbol\n"
   "		    if(e.keyCode == 9) {\n"
   "			e.preventDefault();\n"
   "			var selStart = this.selectionStart;\n"
   "			this.value = this.value.slice(0, selStart) + \"\\t\" + this.value.slice(this.selectionEnd);\n"
   "			this.setSelectionRange(selStart+1, selStart+1);\n"
   "			this.blur(); this.focus();\n"
   "			this.oninput(e);\n"
   "			return true;\n"
   "		    }\n"
   "		}\n"
   "		edit.onkeyup = function(e) {\n"
   "		    if(this.isChanged && e.keyCode == 13 && e.ctrlKey) { this.parentNode.parentNode.childNodes[3].childNodes[0].onclick(); return true; }\n"
   "		    if(this.isChanged && e.keyCode == 27) { this.parentNode.parentNode.children[3].children[1].onclick(); return true; }\n"
   "\n"
   "		    if(this.itComm) this.srcNode.textContent = this.value;\n"
   "		    else if(!this.isChanged && this.value != this.defaultValue) {\n"
   "			var btBlk = document.createElement('div'); //btBlk.style.textAlign = 'right';\n"
   "			var btApply = document.createElement('input'); btApply.type = 'button'; btApply.value = 'Apply';\n"
   "			btApply.onclick = function( ) {\n"
   "			    var wEl = this.parentNode.parentNode;\n"
   "			    var edit = wEl.childNodes[2].childNodes[1];\n"
   "			    var updTm = pgRefrTmDef;\n"
   "			    var rez = servSet(edit.itPath, 'com=com', '<set>'+strEncode(edit.value,'html')+'</set>', true);\n"
   "			    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "			    else {\n"
   "				edit.defaultValue = edit.value;\n"
   "				if(rez.getAttribute('updTm'))\n"
   "				    updTm = Math.min(pgRefrTmMax,parseFloat(rez.getAttribute('updTm'))*1000);\n"
   "			    }\n"
   "			    pageRefresh(updTm);\n"
   "			    wEl.removeChild(this.parentNode);\n"
   "			    edit.isChanged = false;\n"
   "			    return false;\n"
   "			}\n"
   "			var btCancel = document.createElement('input'); btCancel.type = 'button'; btCancel.value = 'Cancel';\n"
   "			btCancel.onclick = function( ) {\n"
   "			    var wEl = this.parentNode.parentNode;\n"
   "			    var edit = wEl.childNodes[2].childNodes[1];\n"
   "			    edit.setVal(edit.defaultValue);\n"
   "			    wEl.removeChild(this.parentNode);\n"
   "			    edit.isChanged = false;\n"
   "\n"
   "			    edit.prevHeight = null;\n"
   "			    toFitPgEls();\n"
   "\n"
   "			    return false;\n"
   "			}\n"
   "			btBlk.appendChild(btApply); btBlk.appendChild(btCancel); this.parentNode.parentNode.appendChild(btBlk);\n"
   "			this.isChanged = true;\n"
   "		    }\n"
   "		    else if(this.isChanged && this.value == this.defaultValue && this.parentNode.parentNode.childNodes[3])\n"
   "		    { this.parentNode.parentNode.removeChild(this.parentNode.parentNode.childNodes[3]); this.isChanged = false; }\n"
   "		    return true;\n"
   "		}\n"
   "		edit.StatusTip = selPath + '/' + brPath;\n"
   "		edit.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "		edit.onmouseup = function() {\n"
   "		    var rows = this.value.split('\\n');\n"
   "		    for(var iRow = 0, iChar = 0; iRow < rows.length; iRow++)\n"
   "			if((tVl=iChar+rows[iRow].length+1) > this.selectionStart) break;\n"
   "			else iChar = tVl;\n"
   "		    setStatus(\"###Cursor = (%1:%2)###\".replace(\"%1\",iRow+1).replace(\"%2\",this.selectionStart-iChar+1),10000);\n"
   "		}\n"
   "		t_s.addr_lab = lab; t_s.addr_edit = edit;\n"
   "	    }\n"
   "	    else { lab = t_s.addr_lab; edit = t_s.addr_edit; }\n"
   "\n"
   "	    // Filling the value\n"
   "	    if(lab) lab.innerText = t_s.getAttribute('dscr') + ':';\n"
   "	    if(edit && !edit.isChanged) {\n"
   "		edit.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "\n"
   "		if(t_s.getAttribute('SnthHgl') != '1' || !(edit.snthHglRules=servGet(brPath,'com=SnthHgl')) || typeof(edit.snthHglRules) != 'object')\n"
   "		    edit.snthHglRules = null;\n"
   "		edit.setVal(dataReq.textContent);\n"
   "	    }\n"
   "	}\n"
   "	//View Data-Time fields\n"
   "	else if(t_s.getAttribute('tp') == 'time') {\n"
   "	    var lab = null; var val_r = null; var val_w = null;\n"
   "	    if(cBlk) {\n"
   "		// View info\n"
   "		if(!wr) {\n"
   "		    val_r = document.createElement('span'); val_r.className = 'const';\n"
   "		    val_r.StatusTip = selPath+'/'+brPath; val_r.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "		}\n"
   "		// View edit\n"
   "		else {\n"
   "		    val_w = document.createElement('span'); val_w.className = 'line number';\n"
   "		    val_w.itPath = selPath+'/'+brPath;\n"
   "		    val_w.srcNode = t_s;\n"
   "		    val_w.itComm = comm;\n"
   "		    val_w.innerHTML = \"<input type='datetime-local' step='1'/>\";\n"
   "		    val_w.childNodes[0].onkeyup = val_w.childNodes[0].onchange = function(e) {\n"
   "			if(this.parentNode.itComm) {\n"
   "			    var val_w = this.parentNode;\n"
   "			    if(val_w.childNodes[0].value) {\n"
   "				vD = val_w.childNodes[0].value.split(\"T\")[0].split(\"-\");\n"
   "				while(vD.length < 3) vD.push(0);\n"
   "				vT = val_w.childNodes[0].value.split(\"T\")[1].split(\":\");\n"
   "				while(vT.length < 3) vT.push(0);\n"
   "				var dt = new Date(parseInt(vD[0]), parseInt(vD[1])-1, parseInt(vD[2]), parseInt(vT[0]), parseInt(vT[1]), parseInt(vT[2]));\n"
   "				val_w.srcNode.textContent = Math.floor(dt.getTime()/1000);\n"
   "			    }\n"
   "			    return true;\n"
   "			}\n"
   "			e = e ? e : window.event;\n"
   "			if(this.parentNode.isEdited && e.keyCode == 13) { this.parentNode.childNodes[1].onclick(); return true; }\n"
   "			if(this.parentNode.isEdited && e.keyCode == 27) {\n"
   "			    var val_w = this.parentNode;\n"
   "			    if(val_w.childNodes[0].defaultValue) val_w.childNodes[0].value = val_w.childNodes[0].defaultValue;\n"
   "			    val_w.removeChild(this.parentNode.childNodes[1]);\n"
   "			    val_w.isEdited = false;\n"
   "			    return true;\n"
   "			}\n"
   "			if(this.parentNode.isEdited || this.value == this.defaultValue) return true;\n"
   "			var btOk = document.createElement('img'); btOk.src = '/' + MOD_ID + '/img_button_ok';\n"
   "			btOk.onclick = function( ) {\n"
   "			    var val_w = this.parentNode;\n"
   "			    vD = val_w.childNodes[0].value.split(\"T\")[0].split(\"-\");\n"
   "			    while(vD.length < 3) vD.push(0);\n"
   "			    vT = val_w.childNodes[0].value.split(\"T\")[1].split(\":\");\n"
   "			    while(vT.length < 3) vT.push(0);\n"
   "			    var dt = new Date(parseInt(vD[0]), parseInt(vD[1])-1, parseInt(vD[2]), parseInt(vT[0]), parseInt(vT[1]), parseInt(vT[2]));\n"
   "			    var updTm = pgRefrTmDef;\n"
   "			    var rez = servSet(val_w.itPath, 'com=com', '<set>'+Math.floor(dt.getTime()/1000)+'</set>', true);\n"
   "			    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "			    else if(rez.getAttribute('updTm'))\n"
   "				updTm = Math.min(pgRefrTmMax,parseFloat(rez.getAttribute('updTm'))*1000);\n"
   "			    pageRefresh(updTm);\n"
   "			    val_w.removeChild(this);\n"
   "			    val_w.isEdited = false;\n"
   "			    return false;\n"
   "			}\n"
   "			this.parentNode.appendChild(btOk);\n"
   "			this.parentNode.isEdited = true;\n"
   "			return true;\n"
   "		    }\n"
   "		    val_w.StatusTip = selPath+'/'+brPath; val_w.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "		}\n"
   "		// Check for the label using\n"
   "		if(t_s.getAttribute('dscr')) {\n"
   "		    lab = document.createElement('span'); lab.className = 'label';\n"
   "		    cBlk.dBlk = document.createElement('div'); cBlk.dBlk.className = 'elem'; cBlk.dBlk.appendChild(lab);\n"
   "		    if(val_w) cBlk.dBlk.appendChild(val_w);\n"
   "		    if(val_r) cBlk.dBlk.appendChild(val_r);\n"
   "		    cBlk.appendChild(cBlk.dBlk);\n"
   "		}\n"
   "		else {\n"
   "		    if(val_w) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_w); else { delete val_w; val_w = null; } }\n"
   "		    if(val_r) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_r); else { delete val_r; val_r = null; } }\n"
   "		}\n"
   "		t_s.addr_lab = lab; t_s.addr_val_r = val_r; t_s.addr_val_w = val_w;\n"
   "	    }\n"
   "	    else { lab = t_s.addr_lab; val_r = t_s.addr_val_r; val_w = t_s.addr_val_w; }\n"
   "	    // Fill data\n"
   "	    if(lab) lab.innerText = t_s.getAttribute('dscr') + ':';\n"
   "	    if(val_w && !val_w.isEdited) {\n"
   "		val_w.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "		var dt_time_t = parseInt(dataReq.textContent);\n"
   "		var dt = new Date(dt_time_t?(dt_time_t*1000):0);\n"
   "		val_w.childNodes[0].value = val_w.childNodes[0].defaultValue =\n"
   "		    i2s(dt.getFullYear(),10,4)+\"-\"+i2s(dt.getMonth()+1,10,2)+\"-\"+i2s(dt.getDate(),10,2)+\n"
   "		    \"T\"+i2s(dt.getHours(),10,2)+\":\"+i2s(dt.getMinutes(),10,2)+\":\"+i2s(dt.getSeconds(),10,2);\n"
   "	    }\n"
   "	    if(val_r) {\n"
   "		val_r.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "		var dt = new Date(parseInt(dataReq.textContent)*1000);\n"
   "		val_r.innerText = i2s(dt.getDate(),10,2)+'.'+i2s(dt.getMonth()+1,10,2)+'.'+i2s(dt.getFullYear(),10,4)+\n"
   "		    ' '+i2s(dt.getHours(),10,2)+':'+i2s(dt.getMinutes(),10,2)+':'+i2s(dt.getSeconds(),10,2);\n"
   "	    }\n"
   "	}\n"
   "	//View other string and numberic fields\n"
   "	else {\n"
   "	    var lab = null; var val_r = null; var val_w = null;\n"
   "	    if(cBlk) {\n"
   "		// View info\n"
   "		if(!wr) {\n"
   "		    val_r = document.createElement('span'); val_r.className = 'const';\n"
   "		    val_r.StatusTip = selPath+'/'+brPath; val_r.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "		}\n"
   "		// View edit\n"
   "		else {\n"
   "		    val_w = document.createElement('span'); val_w.className = 'line';\n"
   "		    val_w.itPath = selPath+'/'+brPath;\n"
   "		    val_w.srcNode = t_s;\n"
   "		    val_w.itComm = comm;\n"
   "		    val_w.appendChild(document.createElement('input')); val_w.childNodes[0].type = 'text';\n"
   "		    val_w.StatusTip = selPath+'/'+brPath; val_w.onmouseover = function() { setStatus(this.StatusTip,10000); }\n"
   "\n"
   "		    var tp = t_s.getAttribute('tp');\n"
   "		    if(t_s.getAttribute('dest') == 'sel_ed') {\n"
   "			val_w.childNodes[0].size = 50;\n"
   "			var cmbImg = document.createElement('img'); cmbImg.src = '/'+MOD_ID+'/img_combar';\n"
   "			cmbImg.onclick = function( ) {\n"
   "			    if(!this.parentNode.sel_list || !this.parentNode.sel_list.length) return false;\n"
   "			    var combMenu = getCombo();\n"
   "			    var optHTML = '';\n"
   "			    for(var iL = 0; iL < this.parentNode.sel_list.length; iL++)\n"
   "				optHTML += '<option>' + this.parentNode.sel_list[iL] + '</option>';\n"
   "			    var edFld = this.parentNode.childNodes[0];\n"
   "			    combMenu.childNodes[0].edFld = edFld;\n"
   "			    combMenu.childNodes[0].innerHTML = optHTML;\n"
   "			    combMenu.childNodes[0].size = Math.max(3,this.parentNode.sel_list.length);\n"
   "			    combMenu.style.cssText = 'visibility: visible; left: '+posGetX(edFld,true)+'px; '+\n"
   "						     'top: '+(posGetY(edFld,true)+edFld.offsetHeight)+'px; '+\n"
   "						     'width: '+edFld.offsetWidth+'px';\n"
   "			    combMenu.childNodes[0].focus();\n"
   "			    combMenu.childNodes[0].onclick = function( ) {\n"
   "				this.parentNode.style.cssText = 'visibility: hidden; left: -200px; top: -200px;';\n"
   "				if(this.selectedIndex < 0) return;\n"
   "				this.edFld.value = this.options[this.selectedIndex].value;\n"
   "				if(this.edFld.parentNode.itComm) this.edFld.parentNode.srcNode.textContent = this.edFld.value;\n"
   "				else {\n"
   "				    var updTm = pgRefrTmDef;\n"
   "				    var rez = servSet(this.edFld.parentNode.itPath, 'com=com', '<set>'+this.edFld.value+'</set>', true);\n"
   "				    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "				    else if(rez.getAttribute('updTm'))\n"
   "					updTm = Math.min(pgRefrTmMax,parseFloat(rez.getAttribute('updTm'))*1000);\n"
   "				    pageRefresh(updTm);\n"
   "				}\n"
   "				return false;\n"
   "			    }\n"
   "			    return false;\n"
   "			}\n"
   "			val_w.appendChild(cmbImg);\n"
   "		    }\n"
   "		    else if(tp == 'dec') {\n"
   "			val_w.className += ' number';\n"
   "			val_w.childNodes[0].size = 10;\n"
   "			var spinImg = document.createElement('img'); spinImg.src = '/'+MOD_ID+'/img_spinar';\n"
   "			spinImg.onclick = function(e) {\n"
   "			    if(!e) e = window.event;\n"
   "			    var val_w = this.parentNode.childNodes[0];\n"
   "			    val_w.value = parseInt(val_w.value)+(((e.clientY-posGetY(this))<10)?1:-1);\n"
   "			    val_w.onkeyup();\n"
   "			    return false;\n"
   "			}\n"
   "			val_w.appendChild(spinImg);\n"
   "		    }\n"
   "		    else if(tp == 'hex' || tp == 'oct' || tp == 'real') { val_w.className += ' number'; val_w.childNodes[0].size = 10; }\n"
   "		    else {\n"
   "			val_w.childNodes[0].size = 30;\n"
   "			val_w.childNodes[0].maxLength = t_s.getAttribute('len');\n"
   "			if(!val_w.childNodes[0].maxLength) val_w.childNodes[0].maxLength = 1000;\n"
   "		    }\n"
   "\n"
   "		    val_w.childNodes[0].onkeyup = function(e) {\n"
   "			if(this.parentNode.itComm) {\n"
   "			    var curVal = this.value;\n"
   "			    if(this.parentNode.srcNode.getAttribute('tp') == 'hex') curVal = parseInt(curVal, 16);\n"
   "			    else if(this.parentNode.srcNode.getAttribute('tp') == 'oct') curVal = parseInt(curVal, 8);\n"
   "			    this.parentNode.srcNode.textContent = curVal;\n"
   "			    return true;\n"
   "			}\n"
   "			if(!e) e = window.event;\n"
   "			if(this.parentNode.isEdited && e.keyCode == 13) { this.parentNode.lastChild.onclick(); return true; }\n"
   "			if(this.parentNode.isEdited && e.keyCode == 27) {\n"
   "			    this.value = this.defaultValue;\n"
   "			    this.parentNode.isEdited = false;\n"
   "			    this.parentNode.removeChild(this.parentNode.lastChild);\n"
   "			    return true;\n"
   "			}\n"
   "			if(this.parentNode.isEdited || this.value == this.defaultValue) return true;\n"
   "			var btOk = document.createElement('img'); btOk.src = '/' + MOD_ID + '/img_button_ok';\n"
   "			btOk.onclick = function( ) {\n"
   "			    var curVal = this.parentNode.childNodes[0].value;\n"
   "			    if((tVl=this.parentNode.srcNode.getAttribute('tp')) == 'dec') curVal = parseInt(curVal);\n"
   "			    else if(tVl == 'hex') curVal = parseInt(curVal, 16);\n"
   "			    else if(tVl == 'oct') curVal = parseInt(curVal, 8);\n"
   "			    else if(tVl == 'real') curVal = parseFloat(curVal);\n"
   "			    if(tVl == 'dec' || tVl == 'hex' || tVl == 'oct') {\n"
   "				if((tVl2=this.parentNode.srcNode.getAttribute('min')) != null)	curVal = Math.max(parseInt(tVl2), curVal);\n"
   "				if((tVl2=this.parentNode.srcNode.getAttribute('max')) != null)	curVal = Math.min(parseInt(tVl2), curVal);\n"
   "			    }\n"
   "			    else if(tVl == 'real') {\n"
   "				if((tVl2=this.parentNode.srcNode.getAttribute('min')) != null)	curVal = Math.max(parseFloat(tVl2), curVal);\n"
   "				if((tVl2=this.parentNode.srcNode.getAttribute('max')) != null)	curVal = Math.min(parseFloat(tVl2), curVal);\n"
   "			    }\n"
   "			    var updTm = pgRefrTmDef;\n"
   "			    var rez = servSet(this.parentNode.itPath, 'com=com', '<set>'+curVal+'</set>', true);\n"
   "			    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "			    else if(rez.getAttribute('updTm'))\n"
   "				updTm = Math.min(pgRefrTmMax,parseFloat(rez.getAttribute('updTm'))*1000);\n"
   "			    pageRefresh(updTm);\n"
   "			    this.parentNode.isEdited = false;\n"
   "			    this.parentNode.removeChild(this);\n"
   "			    return false;\n"
   "			}\n"
   "			this.parentNode.appendChild(btOk);\n"
   "			this.parentNode.isEdited = true;\n"
   "			return true;\n"
   "		    }\n"
   "		}\n"
   "		// Check use label\n"
   "		if(t_s.getAttribute('dscr')) {\n"
   "		    lab = document.createElement('span'); lab.className = 'label';\n"
   "		    cBlk.dBlk = document.createElement('div'); cBlk.dBlk.className = 'elem'; cBlk.dBlk.appendChild(lab);\n"
   "		    if(val_w) cBlk.dBlk.appendChild(val_w);\n"
   "		    if(val_r) cBlk.dBlk.appendChild(val_r);\n"
   "		    cBlk.appendChild(cBlk.dBlk);\n"
   "		}\n"
   "		else {\n"
   "		    if(val_w) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_w); else { delete val_w; val_w = null; } }\n"
   "		    if(val_r) { if(cBlk.dBlk) cBlk.dBlk.appendChild(val_r); else { delete val_r; val_r = null; } }\n"
   "		}\n"
   "		t_s.addr_lab = lab; t_s.addr_val_r = val_r; t_s.addr_val_w = val_w;\n"
   "	    }\n"
   "	    else { lab = t_s.addr_lab; val_r = t_s.addr_val_r; val_w = t_s.addr_val_w; }\n"
   "	    // Fill line\n"
   "	    var sval = dataReq.textContent;\n"
   "	    if(t_s.getAttribute('tp') == 'hex') sval = '0x' + parseInt(sval).toString(16);\n"
   "	    else if(t_s.getAttribute('tp') == 'oct') sval = '0' + parseInt(sval).toString(8);\n"
   "\n"
   "	    if(lab) lab.innerText = t_s.getAttribute('dscr') + ':';\n"
   "	    if(val_r) {\n"
   "		val_r.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "		val_r.innerText = sval;\n"
   "	    }\n"
   "	    if(val_w && !val_w.isEdited) {\n"
   "		val_w.title = (tVl=t_s.getAttribute('help')) ? tVl : \"\";\n"
   "		val_w.childNodes[0].value = val_w.childNodes[0].defaultValue = sval;\n"
   "		// Load combo list\n"
   "		if(t_s.getAttribute('dest') == 'sel_ed') {\n"
   "		    if(t_s.getAttribute('select')) {\n"
   "			val_w.sel_list = new Array();\n"
   "			var xLst = servGet(t_s.getAttribute('select').replace(/%/g,'%25').replace(/\\//g,'%2f'),'com=get');\n"
   "			if(xLst)\n"
   "			    for(var iEl = 0; iEl < xLst.childNodes.length; iEl++)\n"
   "				if(xLst.childNodes[iEl].nodeName.toLowerCase() == 'el')\n"
   "				    val_w.sel_list.push(xLst.childNodes[iEl].textContent);\n"
   "		    } else if(t_s.getAttribute('sel_list')) val_w.sel_list = t_s.getAttribute('sel_list').split(';');\n"
   "		}\n"
   "	    }\n"
   "	}\n"
   "    }\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * toFitPgEls - To fit page elements vertically.   *\n"
   " ***************************************************/\n"
   "function toFitPgEls( )\n"
   "{\n"
   "    scrlArea = document.getElementById('gen-pnl-right');\n"
   "    sclIts = document.querySelectorAll(\".elem textarea, .elem div.table, .elem select.list\");\n"
   "\n"
   "    //Resetting the fitting parameters\n"
   "    for(iScN = 0; iScN < sclIts.length; iScN++) {\n"
   "	sclIt = sclIts[iScN];\n"
   "	sclIt.style.height = \"\";\n"
   "	if(sclIt.applySize) sclIt.applySize();\n"
   "    }\n"
   "\n"
   "    //Setting the fitting parameters\n"
   "    sclFitSz = scrlArea.clientHeight-scrlArea.children[0].offsetHeight;\n"
   "    for(fitStp = Math.max(5,sclFitSz/(10*Math.max(1,sclIts.length))), iScN = 0; sclFitSz > fitStp; ) {\n"
   "	sclIt = null;\n"
   "	sclFromBeg = (iScN == 0);\n"
   "	for( ; iScN < sclIts.length && !sclIt; iScN++) {\n"
   "	    if(sclIts[iScN].scrollHeight <= sclIts[iScN].clientHeight) continue;\n"
   "	    sclIt = sclIts[iScN];\n"
   "	    sclIt.style.height = (sclIt.offsetHeight-((sclIt.nodeName==\"SELECT\")?0:getSpareHeight(sclIt))+fitStp)+'px';\n"
   "	    if(sclIt.applySize) sclIt.applySize();\n"
   "	    sclFitSz -= fitStp;\n"
   "	}\n"
   "	if(!sclIt && sclFromBeg) break;\n"
   "	if(iScN && iScN >= sclIts.length) iScN = 0;\n"
   "    }\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * actEnable - Actions enable.                     *\n"
   " ***************************************************/\n"
   "function actEnable( act, vl )\n"
   "{\n"
   "    var actEl = document.getElementById(act);\n"
   "    if(!actEl) return null;\n"
   "    if(vl != null) {\n"
   "	actEl.disabled = !vl;\n"
   "	actEl.className = vl ? 'active' : 'inactive';\n"
   "	actEl.childNodes[0].src = vl ? actEl.childNodes[0].src.replace('filtr=unact','filtr=none') :\n"
   "				       actEl.childNodes[0].src.replace('filtr=none','filtr=unact');\n"
   "    }\n"
   "\n"
   "    return !actEl.disabled;\n"
   "}\n"
   "\n"
   "/***************************************************\n"
   " * chkStruct - Info page tree check structure.     *\n"
   " ***************************************************/\n"
   "function chkStruct( wNd, nNd )\n"
   "{\n"
   "    //Check access\n"
   "    if(wNd.getAttribute('acs') != nNd.getAttribute('acs')) return true;\n"
   "\n"
   "    //Scan deleted nodes\n"
   "    for(var iW = 0; iW < wNd.childNodes.length; iW++) {\n"
   "	var iN;\n"
   "	for(iN = 0; iN < nNd.childNodes.length; iN++)\n"
   "	    if(wNd.childNodes[iW].nodeName.toLowerCase() == nNd.childNodes[iN].nodeName.toLowerCase() &&\n"
   "		    wNd.childNodes[iW].getAttribute('id') == nNd.childNodes[iN].getAttribute('id'))\n"
   "		break;\n"
   "	if(iN >= nNd.childNodes.length && wNd.nodeName.toLowerCase() != 'table' && wNd.nodeName.toLowerCase() != 'list')\n"
   "	return true;\n"
   "    }\n"
   "\n"
   "    //Scan for new nodes and check present nodes\n"
   "    for(var iN = 0; iN < nNd.childNodes.length; iN++) {\n"
   "	var iW;\n"
   "	for(iW = 0; iW < wNd.childNodes.length; iW++)\n"
   "	    if(wNd.childNodes[iW].nodeName.toLowerCase() == nNd.childNodes[iN].nodeName.toLowerCase() &&\n"
   "		    wNd.childNodes[iW].getAttribute('id') == nNd.childNodes[iN].getAttribute('id'))\n"
   "		break;\n"
   "	if(iW >= wNd.childNodes.length) return true;\n"
   "	else if(chkStruct(wNd.childNodes[iW],nNd.childNodes[iN])) return true;\n"
   "\n"
   "	//Check of the description present\n"
   "	if((wNd.childNodes[iW].getAttribute('dscr') && !nNd.childNodes[iN].getAttribute('dscr')) ||\n"
   "		(!wNd.childNodes[iW].getAttribute('dscr') && nNd.childNodes[iN].getAttribute('dscr')))\n"
   "	    return true;\n"
   "\n"
   "	//Check base fields destination change\n"
   "	if(wNd.childNodes[iW].nodeName.toLowerCase() == 'fld' &&\n"
   "		(wNd.childNodes[iW].getAttribute('dest') != nNd.childNodes[iN].getAttribute('dest') ||\n"
   "		wNd.childNodes[iW].getAttribute('tp') != nNd.childNodes[iN].getAttribute('tp')))\n"
   "	    return true;\n"
   "    }\n"
   "\n"
   "    return false;\n"
   "}\n"
   "/***************************************************\n"
   " * tabSelect - Select page tab                     *\n"
   " ***************************************************/\n"
   "function tabSelect( tab )\n"
   "{\n"
   "    if(!tab || tab.className == 'active') return;\n"
   "    for(var iT = 0; iT < tab.parentNode.childNodes.length; iT++)\n"
   "	if(tab.parentNode.childNodes[iT].className == 'active')\n"
   "	    tab.parentNode.childNodes[iT].className = '';\n"
   "    tab.className = 'active';\n"
   "\n"
   "    for(var iCf = 0; iCf < root.childNodes.length; iCf++)\n"
   "	if(root.childNodes[iCf].nodeName.toLowerCase() == 'area' && tab.innerText == root.childNodes[iCf].getAttribute('dscr'))\n"
   "	{ root.childNodes[iCf].setAttribute('qview','0'); break; }\n"
   "\n"
   "    pageCyclRefrStop();\n"
   "    pageDisplay(selPath);\n"
   "}\n"
   "/***************************************************\n"
   " * hostsUpdate - Init/update tree hosts.           *\n"
   " ***************************************************/\n"
   "function hostsUpdate( )\n"
   "{\n"
   "    var treeRoot = document.getElementById('treeRoot');\n"
   "    //Make hosts\n"
   "    var hostN = servGet('/', 'com=chlds');\n"
   "    if(hostN) {\n"
   "	// Remove no present hosts\n"
   "	for(var iTop = 0; iTop < treeRoot.childNodes.length; iTop++) {\n"
   "	    var iH;\n"
   "	    for(iH = 0; iH < hostN.childNodes.length; iH++)\n"
   "		if(treeRoot.childNodes[iTop].getAttribute('id') == ('/'+hostN.childNodes[iH].getAttribute('id')))\n"
   "		    break;\n"
   "	    if(iH >= hostN.childNodes.length) { treeRoot.removeChild(treeRoot.childNodes[iTop]); iTop--; }\n"
   "	}\n"
   "	// Add/update hosts\n"
   "	for(var i = 0; i < hostN.childNodes.length; i++) {\n"
   "	    var liN = null;\n"
   "	    for(var iTop = 0; iTop < treeRoot.childNodes.length; iTop++) {\n"
   "		if(treeRoot.childNodes[iTop].getAttribute('id') == ('/'+hostN.childNodes[i].getAttribute('id')))\n"
   "		{ liN = treeRoot.childNodes[iTop]; break; }\n"
   "	    }\n"
   "	    if(!liN) { liN = document.createElement('li'); treeRoot.appendChild(liN); }\n"
   "	    liN.setAttribute('id', '/'+hostN.childNodes[i].getAttribute('id'));\n"
   "	    liN.isExpand = false;\n"
   "	    // Load groups\n"
   "	    liN.grps = new Array();\n"
   "	    for(var iGrp = 0; iGrp < hostN.childNodes[i].childNodes.length; iGrp++)\n"
   "		if(hostN.childNodes[i].childNodes[iGrp].nodeName.toLowerCase() == 'grp')\n"
   "		    liN.grps.push(hostN.childNodes[i].childNodes[iGrp]);\n"
   "	    // Init links\n"
   "	    var treeIco = '/'+MOD_ID+'/img_tree'+(liN.isExpand?'Minus':'Plus')+((i!=0)?'Up':'')+((i!=(hostN.childNodes.length-1))?'Down':'');\n"
   "	    var liCont = \"<a class='pm' onclick='expand(this.parentNode,!this.parentNode.isExpand); return false;'><img src='\"+treeIco+\"'/></a>\";\n"
   "	    if(parseInt(hostN.childNodes[i].getAttribute('icoSize')))\n"
   "		liCont += \"<span><img src='/\"+MOD_ID+liN.getAttribute('id')+\"?com=ico&size=16'/></span>\";\n"
   "		//liCont += \"<span><img height='16px' src='/\"+MOD_ID+liN.getAttribute('id')+\"?com=ico'/></span>\"; \n"
   "	    liCont += \"<span><a onclick='selectPage(this.parentNode.parentNode.getAttribute(\\\"id\\\")); return false;' \"+\n"
   "		\"onmouseover='setStatus(this.parentNode.parentNode.getAttribute(\\\"id\\\"),10000);' href='#'>\"+hostN.childNodes[i].textContent+\"</a></span>\";\n"
   "	    liN.innerHTML = liCont;\n"
   "	}\n"
   "	if(hostN.childNodes.length) return '/'+hostN.childNodes[0].getAttribute('id');\n"
   "    }\n"
   "}\n"
   "/**************************************************\n"
   " * treeUpdate - Update tree expanded elements.    *\n"
   " **************************************************/\n"
   "function treeUpdate( )\n"
   "{\n"
   "    var treeRoot = document.getElementById('treeRoot');\n"
   "    for(var iT = 0; iT < treeRoot.childNodes.length; iT++)\n"
   "	if(treeRoot.childNodes[iT].isExpand)\n"
   "	    expand(treeRoot.childNodes[iT], true, true);\n"
   "}\n"
   "/**************************************************\n"
   " * getPopup - Get popup menu.                     *\n"
   " **************************************************/\n"
   "function getPopup( )\n"
   "{\n"
   "    var popUpMenu = document.getElementById('popupmenu');\n"
   "    if(!popUpMenu) {\n"
   "	popUpMenu = document.createElement('div'); popUpMenu.id = 'popupmenu';\n"
   "	popUpMenu.appendChild(document.createElement('select'));\n"
   "	popUpMenu.childNodes[0].onblur = function() { this.parentNode.style.visibility = 'hidden'; }\n"
   "	document.body.appendChild(popUpMenu);\n"
   "	popUpMenu.style.visibility = 'hidden';\n"
   "    }\n"
   "    return popUpMenu;\n"
   "}\n"
   "/**************************************************\n"
   " * getCombo - Get combo menu.                     *\n"
   " **************************************************/\n"
   "function getCombo( )\n"
   "{\n"
   "    var comboMenu = document.getElementById('combomenu');\n"
   "    if(!comboMenu) {\n"
   "	comboMenu = document.createElement('div'); comboMenu.id = 'combomenu';\n"
   "	comboMenu.appendChild(document.createElement('select'));\n"
   "	comboMenu.childNodes[0].onblur = function() { this.parentNode.style.visibility = 'hidden'; }\n"
   "	document.body.appendChild(comboMenu);\n"
   "	comboMenu.style.visibility = 'hidden';\n"
   "    }\n"
   "    return comboMenu;\n"
   "}\n"
   "/**************************************************\n"
   " * pageRefresh - Curent page refrash call.        *\n"
   " **************************************************/\n"
   "function pageRefresh( toTm )\n"
   "{\n"
   "    //Immediately update with the completion sign in <toTm>\n"
   "    if(typeof(toTm) == 'boolean') pageDisplay(selPath, toTm);\n"
   "    //Periodic update is enabled\n"
   "    else if(!actEnable('actStart')) {\n"
   "	pageDisplay(selPath);\n"
   "	pgRefrTmID = setTimeout('pageRefresh();', pgRefrTmPer);\n"
   "    }\n"
   "    else {\n"
   "	if(pgRefrTmID) { clearTimeout(pgRefrTmID); pgRefrTmID = null; }\n"
   "	if(toTm != null) {\n"
   "	    pgRefrTmID = setTimeout('pageRefresh();', toTm);\n"
   "	    if(toTm < 2000) return;	//!!!! Updating right now only for times greater 2000 ms\n"
   "	}\n"
   "\n"
   "	pageDisplay(selPath);\n"
   "    }\n"
   "}\n"
   "/********************************************************\n"
   " * pageCyclRefrStart - Start current page cyclic refrash.*\n"
   " ********************************************************/\n"
   "function pageCyclRefrStart( )\n"
   "{\n"
   "    actEnable('actUpdate',false); actEnable('actStart',false); actEnable('actStop',true);\n"
   "    pageRefresh();\n"
   "}\n"
   "/********************************************************\n"
   " * pageCyclRefrStop - Stop current page cyclic refrash.  *\n"
   " ********************************************************/\n"
   "function pageCyclRefrStop( )\n"
   "{\n"
   "    if(pgRefrTmID) { clearTimeout(pgRefrTmID); pgRefrTmID = null; }\n"
   "    actEnable('actUpdate',true); actEnable('actStart',true); actEnable('actStop',false);\n"
   "}\n"
   "/**************************************************\n"
   " * itDBLoad - Load current page from DB.           *\n"
   " **************************************************/\n"
   "function itDBLoad( force )\n"
   "{\n"
   "    var rez = servSet(selPath+'/%2fobj', 'com=com', '<load force=\"'+((force==true)?'1':'')+'\" />', true);\n"
   "    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "    else pageRefresh(pgRefrTmDef);\n"
   "}\n"
   "/**************************************************\n"
   " * itDBSave - Save current page to DB.             *\n"
   " **************************************************/\n"
   "function itDBSave( force )\n"
   "{\n"
   "    var rez = servSet(selPath+'/%2fobj', 'com=com', '<save force=\"'+((force==true)?'1':'')+'\" />', true);\n"
   "    if(!rez || parseInt(rez.getAttribute('rez')) == Er_NoError ||\n"
   "	       parseInt(rez.getAttribute('rez')) == Er_Core_CntrWarning)\n"
   "	pageRefresh(pgRefrTmDef);\n"
   "    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "}\n"
   "/**************************************************\n"
   " * pageUp - Select up page.                       *\n"
   " **************************************************/\n"
   "function pageUp( )\n"
   "{\n"
   "    var iL = selPath.length-1;\n"
   "    while(true) {\n"
   "	var iL = selPath.lastIndexOf('/', iL);\n"
   "	if(iL == -1 || iL == 0) return;\n"
   "	if((selPath.length-iL) > 1) break;\n"
   "	iL--;\n"
   "    }\n"
   "    selectPage(selPath.substr(0,iL));\n"
   "}\n"
   "/**************************************************\n"
   " * pagePrev - Get previous page.                  *\n"
   " **************************************************/\n"
   "function pagePrev( )\n"
   "{\n"
   "    if(!ndPrev.length) return;\n"
   "    ndNext.push(selPath);\n"
   "    pageDisplay(ndPrev.pop());\n"
   "}\n"
   "/**************************************************\n"
   " * pageNext - Get next page.                      *\n"
   " **************************************************/\n"
   "function pageNext( )\n"
   "{\n"
   "    if(!ndNext.length) return;\n"
   "    ndPrev.push(selPath);\n"
   "    pageDisplay(ndNext.pop());\n"
   "}\n"
   "/**************************************************\n"
   " * itAdd - Add new item action process.           *\n"
   " **************************************************/\n"
   "function itAdd( )\n"
   "{\n"
   "    if(!selPath.length) return;\n"
   "    var branchS = null;\n"
   "    for(var iCh = 0; iCh < root.childNodes.length; iCh++)\n"
   "	if(root.childNodes[iCh].nodeName.toLowerCase() == 'branches' && root.childNodes[iCh].getAttribute('id') == 'br')\n"
   "	    branchS =  root.childNodes[iCh];\n"
   "    if(!branchS) return;\n"
   "\n"
   "    //Load branches list\n"
   "    var typeCfg = '';\n"
   "    for(var iB = 0; iB < branchS.childNodes.length; iB++)\n"
   "	if(parseInt(branchS.childNodes[iB].getAttribute('acs'))&SEC_WR)\n"
   "	    typeCfg += \"<option idSz='\"+branchS.childNodes[iB].getAttribute('idSz')+\n"
   "			\"' gid='\"+branchS.childNodes[iB].getAttribute('id')+\n"
   "			\"' idm='\"+branchS.childNodes[iB].getAttribute('idm')+\"'>\"+\n"
   "		branchS.childNodes[iB].getAttribute('dscr')+\"</option>\";\n"
   "    if(!typeCfg.length) { alert('###There is no container for editing.###'); return; }\n"
   "\n"
   "    dlgWin = ReqIdNameDlg(document.getElementById('actAddIt').childNodes[0].src,(\"###Adding an item to the node '%1'.###\").replace('%1',selPath));\n"
   "    dlgWin.document.getElementById('wDlgHeader').innerText = '###Adding a node###';\n"
   "    dlgWin.document.getElementById('wDlgType').style.display = '';\n"
   "    dlgWin.document.getElementById('wDlgType').childNodes[1].childNodes[0].innerHTML = typeCfg;\n"
   "    dlgWin.document.getElementById('wDlgType').childNodes[1].childNodes[0].onchange = function( ) {\n"
   "	if(this.selectedIndex < 0) return;\n"
   "	var idSz = parseInt(this.options[this.selectedIndex].getAttribute('idSz'));\n"
   "	dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].maxLength = (idSz > 0) ? idSz : 1000;\n"
   "	var idm = parseInt(this.options[this.selectedIndex].getAttribute('idm'));\n"
   "	dlgWin.document.getElementById('wDlgName').style.display = idm ? '' : 'none';\n"
   "	dlgWin.document.getElementById('wDlgName').childNodes[1].childNodes[0].maxLength = (idm > 1) ? idm : 1000;\n"
   "    }\n"
   "    dlgWin.document.getElementById('wDlgType').childNodes[1].childNodes[0].onchange();\n"
   "    dlgWin.document.getElementById('wDlgActOk').onclick = function() {\n"
   "	var tpSel = dlgWin.document.getElementById('wDlgType').childNodes[1].childNodes[0];\n"
   "	if(!tpSel || tpSel.selectedIndex < 0) { document.body.dlgWin.close(); return false; }\n"
   "	var idm = parseInt(tpSel.options[tpSel.selectedIndex].getAttribute('idm'));\n"
   "	var gbrId = tpSel.options[tpSel.selectedIndex].getAttribute('gid');\n"
   "	var inpId = dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].value;\n"
   "	var inpName = idm ? dlgWin.document.getElementById('wDlgName').childNodes[1].childNodes[0].value : inpId;\n"
   "\n"
   "	// Check for already present node\n"
   "	var req = servSet(selPath+'/%2fbr%2f'+gbrId,'com=com','<get/>',true);\n"
   "	if(!req || parseInt(req.getAttribute('rez')) != Er_NoError) { alertCntr(req); document.body.dlgWin.close(); return false; }\n"
   "	for(var iLel = 0; iLel < req.childNodes.length; iLel++)\n"
   "	    if((req.childNodes[iLel].getAttribute('id') && req.childNodes[iLel].getAttribute('id') == inpId) ||\n"
   "		(!req.childNodes[iLel].getAttribute('id') && req.childNodes[iLel].textContent == inpId))\n"
   "	    {\n"
   "		alert((\"###Item '%1' already exists.###\").replace('%1',inpId));\n"
   "		document.body.dlgWin.close();\n"
   "		return;\n"
   "	    }\n"
   "\n"
   "	// Send command\n"
   "	var rez = servSet(selPath+'/%2fbr%2f'+gbrId,'com=com',\"<add \"+(idm?(\"id='\"+inpId+\"'\"):\"\")+\">\"+inpName+\"</add>\",true);\n"
   "	if(!rez || parseInt(rez.getAttribute('rez')) != Er_NoError) { alertCntr(rez); document.body.dlgWin.close(); return false; }\n"
   "	document.body.dlgWin.close();\n"
   "	treeUpdate(); pageRefresh();\n"
   "	return false;\n"
   "    }\n"
   "}\n"
   "/**************************************************\n"
   " * itDel - Delete new item action process.        *\n"
   " **************************************************/\n"
   "function itDel( it )\n"
   "{\n"
   "    var selNds = new Array();\n"
   "    var selNds_lim = \"\";\n"
   "    if(it != null && it.length) selNds.push(it);\n"
   "    else {\n"
   "	selNds.push(selPath);\n"
   "	selNds_lim += (selNds_lim.length?\"\\n\":\"\") + selPath;\n"
   "	var treeRootSelIts = document.getElementById('treeRoot').getElementsByClassName('select');\n"
   "	if(treeRootSelIts.length > 1) {\n"
   "	    for(var iIt = 0; iIt < treeRootSelIts.length; iIt++)\n"
   "		if((tVl=treeRootSelIts[iIt].getAttribute('id')) != selPath) {\n"
   "		    selNds.push(tVl);\n"
   "		    if(selNds.length < limShowOp) selNds_lim += (selNds_lim.length?\"\\n\":\"\") + tVl;\n"
   "		}\n"
   "	    if(selNds.length > limShowOp)\n"
   "		selNds_lim += (\"###... and yet %1 nodes###\").replace('%1',selNds.length-limShowOp);\n"
   "	}\n"
   "    }\n"
   "    if(!selNds.length)	return;\n"
   "\n"
   "    var confirmText = (selNds.length == 1)\n"
   "			? (\"###Are you sure you want to remove the node '%1'?###\").replace('%1',selNds[0])\n"
   "			: (\"###Are you sure you want to remove the nodes: %1 ?###\").replace('%1',selNds_lim);\n"
   "\n"
   "    if(!confirm(confirmText)) return;\n"
   "\n"
   "    var toUpdt = false;\n"
   "    for(var iIt = 0; iIt < selNds.length; iIt++) {\n"
   "	var rmit = selNds[iIt];\n"
   "\n"
   "	var tEl, sel_own = '', sel_el;\n"
   "	var n_obj = 0;\n"
   "	for(pathLev.off = 0; (tEl=pathLev(rmit,0,true)).length; n_obj++)\n"
   "	{ if(n_obj) sel_own += ('/'+sel_el); sel_el = tEl; }\n"
   "	if(n_obj > 2) {\n"
   "	    var req = servGet(sel_own+'/%2fbr','com=info');\n"
   "	    if(parseInt(req.getAttribute('rez')) != Er_NoError) { alertCntr(req); continue; }\n"
   "	    if(!req.childNodes[0]) continue;\n"
   "\n"
   "	    var branch = req.childNodes[0];\n"
   "	    for(var iB = 0; iB < branch.childNodes.length; iB++) {\n"
   "		var bId = branch.childNodes[iB].getAttribute('id');\n"
   "		if(bId == sel_el.substr(0,bId.length) && parseInt(branch.childNodes[iB].getAttribute('acs'))&SEC_WR) {\n"
   "		    var idm = parseInt(branch.childNodes[iB].getAttribute('idm'));\n"
   "		    var com = idm ? (\"<del id='\"+sel_el.substr(bId.length)+\"'/>\")\n"
   "				  : (\"<del>\"+sel_el.substr(bId.length)+\"</del>\");\n"
   "		    var rez = servSet(sel_own+'/%2fbr%2f'+bId,'com=com',com,true);\n"
   "		    if(rez && parseInt(rez.getAttribute('rez')) != Er_NoError) alertCntr(rez);\n"
   "		    else toUpdt = true;\n"
   "		    break;\n"
   "		}\n"
   "	    }\n"
   "	}\n"
   "    }\n"
   "    if(toUpdt) { treeUpdate(); if(!it) { selPath = sel_own; pageDisplay(selPath); } }\n"
   "}\n"
   "/**************************************************\n"
   " * itCut - Cut selected item.                     *\n"
   " **************************************************/\n"
   "function itCut( )\n"
   "{\n"
   "    copyBuf = '1'+selPath;\n"
   "    editToolUpdate();\n"
   "}\n"
   "/**************************************************\n"
   " * itCopy - Copy selected item.                   *\n"
   " **************************************************/\n"
   "function itCopy( )\n"
   "{\n"
   "    copyBuf = '0'+selPath;\n"
   "    editToolUpdate();\n"
   "}\n"
   "/**************************************************\n"
   " * itPaste - Paste copy or cut item.              *\n"
   " **************************************************/\n"
   "function itPaste( )\n"
   "{\n"
   "    var typeCfg = '';\n"
   "    var itCnt = 0, defIt = 0;\n"
   "    var sEl, sElp = '', tEl, bGrp = '';\n"
   "    var branchS = null;\n"
   "\n"
   "    //Src elements calc\n"
   "    var nSel = 0;\n"
   "    for(pathLev.off = 0; (tEl=pathLev(copyBuf.substr(1),0,true)).length; nSel++)\n"
   "    { if(nSel) sElp += ('/'+sEl); sEl = tEl; }\n"
   "\n"
   "    //if(pathLev(copyBuf.substr(1),0) != pathLev(selPath,0)) { alert('###Copy is impossible.###'); return; }\n"
   "\n"
   "    rootW = root;\n"
   "    toPath = selPath;\n"
   "\n"
   "    if(copyBuf.substr(1) == toPath) {	//For copy into the branch and not select directly the parent node\n"
   "	toPath = sElp;\n"
   "	pgInfo = servGet(toPath, 'com=info');\n"
   "	if(parseInt(pgInfo.getAttribute('rez')) != 0) return;\n"
   "	rootW = pgInfo.childNodes[0];\n"
   "    }\n"
   "\n"
   "    if(parseInt(rootW.getAttribute('acs'))&SEC_WR) { typeCfg += \"<option idSz='-1' gid=''>###Selected###</option>\"; itCnt++; }\n"
   "    for(var iCh = 0; iCh < rootW.childNodes.length; iCh++)\n"
   "	if(rootW.childNodes[iCh].nodeName.toLowerCase() == 'branches' && rootW.childNodes[iCh].getAttribute('id') == 'br')\n"
   "	    branchS = rootW.childNodes[iCh];\n"
   "    if(branchS)\n"
   "	for(var iB = 0; iB < branchS.childNodes.length; iB++)\n"
   "	    if(parseInt(branchS.childNodes[iB].getAttribute('acs'))&SEC_WR) {\n"
   "		var gbrId = branchS.childNodes[iB].getAttribute('id');\n"
   "		typeCfg += \"<option idSz='\" + branchS.childNodes[iB].getAttribute('idSz') + \"' gid='\" + gbrId + \"'>\" +\n"
   "				branchS.childNodes[iB].getAttribute('dscr') + \"</option>\";\n"
   "		if(sEl.substr(0,gbrId.length) == gbrId) { defIt = itCnt; bGrp = gbrId; }\n"
   "		itCnt++;\n"
   "	    }\n"
   "\n"
   "    pathLev.off = 1; statNmSrc = pathLev(copyBuf, 0, true);\n"
   "    pathLev.off = 0; statNm = pathLev(toPath, 0, true);\n"
   "\n"
   "    //Make a request dialog\n"
   "    dlgWin = ReqIdNameDlg('/'+MOD_ID+'/img_it_add');\n"
   "    dlgWin.document.getElementById('wDlgHeader').innerText = '###Moving or copying the node###';\n"
   "    wDlgTitle = dlgWin.document.getElementById('wDlgTitle').childNodes[1];\n"
   "    wDlgTitle.innerText = ((copyBuf.charAt(0)=='1')?\"###Move node '%1' to '%2'.###\":\"###Copy node '%1' to '%2'.###\").replace('%1',copyBuf.substr(1)).replace('%2',toPath);\n"
   "    if(bGrp.length) dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].value = sEl.substr(bGrp.length);\n"
   "    dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].disabled = (statNm != statNmSrc);\n"
   "    dlgWin.document.getElementById('wDlgName').style.display = 'none';\n"
   "    wDlgType = dlgWin.document.getElementById('wDlgType');\n"
   "    wDlgType.style.display = '';\n"
   "    wDlgType.childNodes[1].childNodes[0].innerHTML = typeCfg;\n"
   "    wDlgType.childNodes[1].childNodes[0].onchange = function( ) {\n"
   "	if(this.selectedIndex < 0) return;\n"
   "	var idSz = parseInt(this.options[this.selectedIndex].getAttribute('idSz'));\n"
   "	dlgWin.document.getElementById('wDlgId').style.display = (idSz >= 0) ? '' : 'none';\n"
   "	dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].maxLength = (idSz > 0) ? idSz : 1000;\n"
   "    }\n"
   "    wDlgType.childNodes[1].childNodes[0].selectedIndex = defIt;\n"
   "    wDlgType.childNodes[1].childNodes[0].onchange();\n"
   "    wDlgType.childNodes[1].childNodes[0].disabled = (statNm != statNmSrc);\n"
   "    dlgWin.document.getElementById('wDlgActOk').onclick = function( ) {\n"
   "	var tpSel = dlgWin.document.getElementById('wDlgType').childNodes[1].childNodes[0];\n"
   "	if(!tpSel || tpSel.selectedIndex < 0) { document.body.dlgWin.close(); return false; }\n"
   "	var idSz = parseInt(tpSel.options[tpSel.selectedIndex].getAttribute('idSz'));\n"
   "	var gbrId = tpSel.options[tpSel.selectedIndex].getAttribute('gid');\n"
   "	var inpId = dlgWin.document.getElementById('wDlgId').childNodes[1].childNodes[0].value;\n"
   "\n"
   "	var statNm, statNmSr, srcNm, dstNm;\n"
   "	pathLev.off = 1; statNmSrc = pathLev(copyBuf, 0, true); srcNm = copyBuf.substr(pathLev.off);\n"
   "	pathLev.off = 0; statNm = pathLev(toPath, 0, true); dstNm = toPath.substr(pathLev.off);\n"
   "\n"
   "	if(idSz >= 0) {\n"
   "	    dstNm += '/'+gbrId+inpId;\n"
   "	    // Check for already present node\n"
   "	    var req = servSet(toPath+'/%2fbr%2f'+gbrId,'com=com','<get/>', true);\n"
   "	    if(!req || parseInt(req.getAttribute('rez')) != Er_NoError) { alertCntr(req); document.body.dlgWin.close(); return false; }\n"
   "	    for(var iLel = 0; iLel < req.childNodes.length; iLel++)\n"
   "		if((req.childNodes[iLel].getAttribute('id') && req.childNodes[iLel].getAttribute('id') == inpId) ||\n"
   "			(!req.childNodes[iLel].getAttribute('id') && req.childNodes[iLel].textContent == inpId)) {\n"
   "		    if(confirm((\"###Node '%1' already present. Continue?###\").replace('%1',dstNm))) break;\n"
   "		    document.body.dlgWin.close(); return;\n"
   "		}\n"
   "	}\n"
   "	//Copy visual item\n"
   "	var rez = servSet('/'+statNm+'/%2fobj','com=copy',\"<copy src='\"+srcNm+\"' dst='\"+dstNm+\"' statNmSrc='\"+statNmSrc+\"' statNm='\"+statNm+\"'/>\", true);\n"
   "	if(!rez || parseInt(rez.getAttribute('rez')) != Er_NoError) { alertCntr(rez); document.body.dlgWin.close(); return false; }\n"
   "\n"
   "	//Remove source widget\n"
   "	if(copyBuf.charAt(0) == '1') {\n"
   "	    itDel(copyBuf.substr(1));\n"
   "	    if(selPath == copyBuf.substr(1)) selectPage(\"/\"+statNm+dstNm);\n"
   "	    else pageRefresh();\n"
   "	    copyBuf = '0';\n"
   "	} else pageRefresh();\n"
   "	treeUpdate();\n"
   "	document.body.dlgWin.close();\n"
   "	return false;\n"
   "    }\n"
   "}\n"
   "/**********************************************************\n"
   " * ReqIdNameDlg - Get identifier and name request dialog. *\n"
   " **********************************************************/\n"
   "function ReqIdNameDlg( ico, mess, actPath, nmFile )\n"
   "{\n"
   "    var dlgWin = document.body.dlgWin;\n"
   "    if(!dlgWin) {\n"
   "	dlgWin = document.createElement('div');\n"
   "	dlgWin.setAttribute(\"id\", 'gen-pnl-dlg');\n"
   "	document.body.dlgWin = dlgWin;\n"
   "	dlgWin.close = function( ) { document.body.removeChild(this); this.isLoad = null; }\n"
   "    }\n"
   "    if(dlgWin.isLoad) document.body.removeChild(this);\n"
   "\n"
   "    dlgWin.innerHTML =\n"
   "	\"<table cellspacing='0' \"+\n"
   "	    \"style='left: \"+((window.innerWidth-400-5)/2)+\"px; top: \"+((this.window.innerHeight-200-18)/2)+\"px;'>\\n\"+\n"
   "	\"<tr style='cursor: move;' onmousedown='this.clX = event.clientX; this.clY = event.clientY; return false;' \\n\"+\n"
   "	\"   onmouseup='this.clX = this.clY = null; return false;' \\n\"+\n"
   "	\"   onmouseout='this.clX = this.clY = null; return false;' \\n\"+\n"
   "	\"   onmousemove='if(this.clX != null) { \"+\n"
   "	\"     this.offsetParent.style.left = (parseInt(this.offsetParent.style.left)+event.clientX-this.clX)+\\\"px\\\"; \"+\n"
   "	\"     this.offsetParent.style.top  = (parseInt(this.offsetParent.style.top)+event.clientY-this.clY)+\\\"px\\\"; \"+\n"
   "	\"     this.clX = event.clientX; this.clY = event.clientY; }'>\"+\n"
   "	\" <td id='wDlgHeader'>###Selecting node id and/or name###</td>\\n\"+\n"
   "	\" <td style='color: red; cursor: pointer; text-align: right; width: 1px; ' onclick='document.body.dlgWin.close();'>X</td>\\n\"+\n"
   "	\"</tr>\\n\"+\n"
   "	\"<tr><td colspan='2' style='max-width: 400px;'>\\n\"+\n"
   "	\" <center>\\n\"+\n"
   "	\"  <form id='wDlgFormBlk' action='\"+actPath+\"' method='post' enctype='multipart/form-data'>\\n\"+\n"
   "	\"   <table border='0' cellspacing='3px' class='dlg'>\\n\"+\n"
   "	\"    <tr><td id='wDlgTitle' colspan='2'><img src='' style='height: 32px; float: left; padding-right: 5px;'/><span style='word-wrap: break-word; word-break: break-all;'/></td></tr>\\n\"+\n"
   "	\"    <tr id='wDlgType'><td>###Element type:###</td><td><select name='type'/></td></tr>\\n\"+\n"
   "	\"    <tr id='wDlgId'><td>###ID:###</td><td><input name='id'/></td></tr>\\n\"+\n"
   "	\"    <tr id='wDlgName'><td>###Name:###</td><td><input name='name' type='\"+(nmFile?'file':'text')+\"'/></td></tr>\\n\"+\n"
   "	\"    <tr><td colspan='2' style='text-align: right; border-top: 1px solid black; padding-top: 10px;'>\\n\"+\n"
   "	\"      <input id='wDlgActOk' name='actOk' type='button' value='###Ok###'/> <input id='wDlgActCancel' name='actCancel' type='button' value='###Close###' onclick='document.body.dlgWin.close(); return false;'/>\\n\"+\n"
   "	\"    </td></tr>\\n\"+\n"
   "	\"   </table>\\n\"+\n"
   "	\"  </form>\\n\"+\n"
   "	\" </center>\\n\"+\n"
   "	\"</td></tr></table>\"+\n"
   "	\"<div/>\\n\";\n"
   "    document.body.appendChild(dlgWin);\n"
   "    dlgWin.isLoad = true;\n"
   "\n"
   "    if(ico) document.getElementById('wDlgTitle').childNodes[0].src = ico;\n"
   "    if(mess) document.getElementById('wDlgTitle').childNodes[1].innerText = mess;\n"
   "\n"
   "    return window;\n"
   "}\n"
   "/************************************************************************\n"
   " * snthHglUpd - Updating the pointed textarea for the syntax highlight. *\n"
   " ***********************************************************************/\n"
   "function snthHglUpd( )\n"
   "{\n"
   "    if(snthHglObj != null) {\n"
   "	snthHglObj.applySnthHgl();\n"
   "	snthHglObj.onscroll();\n"
   "    }\n"
   "}\n"
   "\n"
   "//First start data init\n"
   "if(genPnlLeft=document.getElementById('gen-pnl-left')) {\n"
   "    genPnlLeft.ondblclick = function(e) { if(e.elPrc) return true; e.elPrc = true; hostsUpdate(); }\n"
   "    genPnlLeft.onmousedown = function(){ return false; }\n"
   "}\n"
   "\n"
   "// Tool bar init\n"
   "var actManual = document.getElementById('actManual');\n"
   "//  Tree update action\n"
   "var actTreeUpdt = document.getElementById('treeBlk');\n"
   "if(actTreeUpdt) {\n"
   "    actTreeUpdt.ondblclick = function(e) { if(e.elPrc) return true; e.elPrc = true; treeUpdate(); }\n"
   "    actTreeUpdt.onmousedown = function(){ return false; }\n"
   "}\n"
   "//  Update actions\n"
   "var actUpdate = document.getElementById('actUpdate');\n"
   "if(actUpdate) actUpdate.onclick = function()	{ if(this.className=='active') pageRefresh(); treeUpdate(); return false; }\n"
   "var actStart = document.getElementById('actStart');\n"
   "if(actStart) actStart.onclick = function()	{ if(this.className=='active') pageCyclRefrStart(); return false; }\n"
   "var actStop = document.getElementById('actStop');\n"
   "if(actStop) actStop.onclick = function()	{ if(this.className=='active') pageCyclRefrStop(); return false; }\n"
   "//  DB actions\n"
   "var actLoad = document.getElementById('actLoad');\n"
   "if(actLoad) actLoad.onclick = function()	{ if(this.className=='active') itDBLoad(); return false; }\n"
   "var actLoad_f = document.getElementById('actLoad_f');\n"
   "if(actLoad_f) actLoad_f.onclick = function()	{ itDBLoad(true); return false; }\n"
   "var actSave = document.getElementById('actSave');\n"
   "if(actSave) actSave.onclick = function()	{ if(this.className=='active') itDBSave(); return false; }\n"
   "var actSave_f = document.getElementById('actSave_f');\n"
   "if(actSave_f) actSave_f.onclick = function()	{ itDBSave(true); return false; }\n"
   "//  Navigate actions\n"
   "var actUp = document.getElementById('actUp');\n"
   "if(actUp) actUp.onclick = function()		{ if(this.className=='active') pageUp(); return false; }\n"
   "var actPrevious = document.getElementById('actPrevious');\n"
   "if(actPrevious) actPrevious.onclick = function(){ if(this.className=='active') pagePrev(); return false; }\n"
   "var actNext = document.getElementById('actNext');\n"
   "if(actNext) actNext.onclick = function()	{ if(this.className=='active') pageNext(); return false; }\n"
   "//  Create/delete actions\n"
   "var actAddIt = document.getElementById('actAddIt');\n"
   "if(actAddIt) actAddIt.onclick = function()	{ if(this.className=='active') itAdd(); return false; }\n"
   "var actDelIt = document.getElementById('actDelIt');\n"
   "if(actDelIt) actDelIt.onclick = function()	{ if(this.className=='active') itDel(); return false; }\n"
   "//  Copy actions\n"
   "var actCopy = document.getElementById('actCopy');\n"
   "if(actCopy) actCopy.onclick = function()	{ if(this.className=='active') itCopy(); return false; }\n"
   "var actCut = document.getElementById('actCut');\n"
   "if(actCut) actCut.onclick = function()		{ if(this.className=='active') itCut(); return false; }\n"
   "var actPaste = document.getElementById('actPaste');\n"
   "if(actPaste) actPaste.onclick = function()	{ if(this.className=='active') itPaste(); return false; }\n"
   "//  About\n"
   "var actAbout = document.getElementById('actAbout');\n"
   "if(actAbout && gPrms.length) actAbout.href += gPrms;\n"
   "\n"
   "pageDisplay(hostsUpdate());\n"
   "\n"
   "setStatus('###Page loaded.###', pgRefrTmPer);\n"
   "\n"
   "/**********************************************************\n"
   " * Design specific part					  */\n"
   "function getSpareWidth( node ) {\n"
   "    compStl = getComputedStyle(node, null);\n"
   "    return parseInt(compStl.getPropertyValue('border-left-width')) + parseInt(compStl.getPropertyValue('padding-left')) +\n"
   "    parseInt(compStl.getPropertyValue('border-right-width')) + parseInt(compStl.getPropertyValue('padding-right'));\n"
   "}\n"
   "\n"
   "function getSpareHeight( node ) {\n"
   "    compStl = getComputedStyle(node, null);\n"
   "    return parseInt(compStl.getPropertyValue('border-top-width')) + parseInt(compStl.getPropertyValue('padding-top')) +\n"
   "    parseInt(compStl.getPropertyValue('border-bottom-width')) + parseInt(compStl.getPropertyValue('padding-bottom'));\n"
   "}\n"
   "\n"
   "//Resize processing\n"
   "function pageResize( horOnly ) {\n"
   "    var w = Math.max(600, window.innerWidth);\n"
   "    var h = Math.max(400, window.innerHeight);\n"
   "    genPnlUp = document.getElementById('gen-pnl-up');\n"
   "    genPnlLeft = document.getElementById('gen-pnl-left');\n"
   "    genPnlRight = document.getElementById('gen-pnl-right');\n"
   "    genPnlDown = document.getElementById('gen-pnl-down');\n"
   "    genPnlSplt = document.getElementById('gen-pnl-splt');\n"
   "\n"
   "    genPnlUp.style.width = (w-getSpareWidth(genPnlUp))+'px';\n"
   "    genPnlDown.style.width = (w-getSpareWidth(genPnlDown))+'px';\n"
   "    genPnlRight.style.width = (w-genPnlRight.offsetLeft-getSpareWidth(genPnlRight))+'px';\n"
   "    if(!horOnly) {\n"
   "	genPnlDown.style.top = (h-genPnlDown.clientHeight-1)+'px';\n"
   "	genPnlLeft.style.height = (genPnlDown.offsetTop-genPnlLeft.offsetTop-getSpareHeight(genPnlLeft))+'px';\n"
   "	genPnlRight.style.height = (genPnlDown.offsetTop-genPnlRight.offsetTop-getSpareHeight(genPnlRight))+'px';\n"
   "	genPnlSplt.style.height = (genPnlDown.offsetTop-genPnlSplt.offsetTop-getSpareHeight(genPnlSplt))+'px';\n"
   "    }\n"
   "\n"
   "    setTimeout('pageRefresh(true)', 2000);\n"
   "}\n"
   "window.onresize = function( ) { pageResize(); }\n"
   "pageResize();\n"
   "\n"
   "//Split processing\n"
   "document.getElementById('gen-pnl-splt').onmousedown = function(e) {\n"
   "    e = e ? e : window.event;\n"
   "    if(e.preventDefault) e.preventDefault();\n"
   "    this.toMove = true;\n"
   "}\n"
   "window.onmouseup = function( ) { document.getElementById('gen-pnl-splt').toMove = false; }\n"
   "window.onmousemove = function( e ) {\n"
   "    e = e ? e : window.event;\n"
   "    genPnlSplt = document.getElementById('gen-pnl-splt');\n"
   "    if(genPnlSplt.toMove) {\n"
   "	genPnlLeft = document.getElementById('gen-pnl-left');\n"
   "	genPnlRight = document.getElementById('gen-pnl-right');\n"
   "\n"
   "	genPnlSplt.style.left = e.clientX+'px';// (e.clientX-genPnlSplt.clientWidth/2)+'px';\n"
   "	genPnlRight.style.left = e.clientX+'px';\n"
   "	genPnlLeft.style.width = (e.clientX-getSpareWidth(genPnlLeft))+'px';\n"
   "	pageResize(true);\n"
   "	return false;\n"
   "    }\n"
   "}\n"
;
