/*
Version : XPOWS shell Library 1.22
update  : 07-06-22
*/
xpow.shell=new Object();
var XPOWS=new Object();
function isTree(strObject) { var re=false; if (isObject(strObject)) { try { if (strObject.getObjectType()=='XPOWS.shellTree') re=true; } catch(e) { }; }; return re; }
function isTable(strObject) { var re=false; if (isObject(strObject)) { try { if (strObject.getObjectType()=='XPOWS.shellTable') re=true; } catch(e) { }; }; return re; }
XPOWS.shellTree=function(){this._count=-1;this._i=0;this._data=new Array();this._ObjectType='XPOWS.shellTree';}
XPOWS.shellTree.prototype.isData=function() { return isInt(this._count) };XPOWS.shellTree.prototype.getObjectType=function() { return this._ObjectType; }
XPOWS.shellTree.prototype.getCount=function() { return this._count+1; };XPOWS.shellTree.prototype.getLength=function() { return this._data.length; }
XPOWS.shellTree.prototype.getI=function() { return this._i; };
XPOWS.shellTree.prototype.getArray=function() { return this._data; }
XPOWS.shellTree.prototype.doBegin=function() { this._i=0; };
XPOWS.shellTree.prototype.doEnd=function() { this._i=(this._count>-1 ? this._count : 0); }
XPOWS.shellTree.prototype.doMove=function(strer){if (!isInt(strer)) strer=1;this._i+=strer; if (this._i>this._count) this._i=this._count;if (this._i<0) this._i=0;}
XPOWS.shellTree.prototype.getItemKey=function() { return (this._count>-1) ? this._data[this._i][0] : ""; };
XPOWS.shellTree.prototype.getItemValue=function() { return (this._count>-1) ? this._data[this._i][1] : ''; }
XPOWS.shellTree.prototype.addItem=function(strKey,strValue){for (var i=0;i<=this._count;i++){if (this._data[i][0]==strKey) { this._data[i][1]=strValue; return; }}this._count++;this._data[this._count]=new Array(strKey,strValue);}
XPOWS.shellTree.prototype.setItem=function(strKey,strValue){for (var i=0;i<=this._count;i++){if (this._data[i][0]==strKey) { this._data[i][1]=strValue; return; }}}
XPOWS.shellTree.prototype.delItem=function(strKey){for (var i=0;i<=this._data.length;i++){if (this._data[i][0]==strKey){this._data=this._data.slice(0,i).concat(this._data.slice(i+1,this._data.length));this._count=this._data.length-1;this.doBegin();break;}}}
XPOWS.shellTree.prototype.isItem=function(strKey){var re=false;for (var i=0;i<=this._count;i++){if (this._data[i][0]==strKey) { re=true; break; }}return re;}
XPOWS.shellTree.prototype.getItem=function(strKey){var re="";for (var i=0;i<=this._count;i++){if (this._data[i][0]==strKey) { re=this._data[i][1]; break; }}return re;}
XPOWS.shellTree.prototype.getItemInt=function(strKey) { return toInt(this.getItem(strKey)); };
XPOWS.shellTree.prototype.getItemNum=function(strKey) { return toNum(this.getItem(strKey)); }
XPOWS.shellTree.prototype.getFields=function(){var re="";for (var i=0;i<=this._count;i++) { re+=","+this._data[i][0]; }if (re.length>0) re=re.substr(1);return re;}
XPOWS.shellTree.prototype.getFieldArray=function(){var reAry=new Array();for (var i=0;i<=this._count;i++) { reAry[i]=this._data[i][0]; }return reAry;}
XPOWS.shellTree.prototype.getValues=function(){var re="";for (var i=0;i<=this._count;i++) { re+=","+this._data[i][1]; }if (re.length>0) re=re.substr(1);return re;}
XPOWS.shellTree.prototype.getValueArray=function(){var reAry=new Array();for (var i=0;i<=this._count;i++) { reAry[i]=this._data[i][1]; }return reAry;}
XPOWS.shellTree.prototype.doAppendTree=function(strTree,strPrefix){if (isTree(strTree)){var tmpPrefix=(isEmpty(strPrefix)) ? "" : strPrefix;strTree.doBegin();for (var i=0;i<strTree.getCount();i++){this.addItem(tmpPrefix+strTree.getItemKey(),strTree.getItemValue());strTree.doMove()}}}
//########################################
//########################################
XPOWS.shellTable=function(){this._row=-1;this._col=-1;this._i=1;this._data=new Array();this._ObjectType="XPOWS.shellTable";};XPOWS.shellTable.prototype.isData=function() { return this._count>-1 ? true : false; }
XPOWS.shellTable.prototype.getObjectType=function() { return this._ObjectType; };XPOWS.shellTable.prototype.getRow=function() { return this._row; }
XPOWS.shellTable.prototype.getCol=function() { return this._col+1; };XPOWS.shellTable.prototype.getI=function() { return this._i; }
XPOWS.shellTable.prototype.getArray=function() { return this._data; };XPOWS.shellTable.prototype.doItemBegin=function() { this._i=1; }
XPOWS.shellTable.prototype.doItemEnd=function() { this._i=(this._row>0 ? this._row : 1); }
XPOWS.shellTable.prototype.doItemMove=function(strer){if (!isInt(strer)) strer=1; this._i+=strer;if (this._i>this._row) this._i=this._row;if (this._i<1) this._i=1;}
XPOWS.shellTable.prototype.addItem=function(strTree){if (isTree(strTree)){if (this._row<0 && strTree.getCount()>0){this._row=0;this._col=strTree.getCount()-1;this._data[this._row]=strTree.getFieldArray();}if (this._row<0) return;this._row++;this._data[this._row]=new Array(this._col+1);for (var c=0;c<=this._col;c++){this._data[this._row][c]=strTree.getItem(this._data[0][c]);}}}
XPOWS.shellTable.prototype.setItem=function(strTree){if (isTree(strTree) && this._row>0){for (var c=0;c<=this._col;c++){this._data[this._i][c]=strTree.getItem(this._data[0][c]);}}}
XPOWS.shellTable.prototype.setItemValue=function(strKey,strValue){if (this._row>0){for (var c=0;c<=this._col;c++){if (this._data[0][c]==strKey){this._data[this._i][c]=strValue;break;}}}}
XPOWS.shellTable.prototype.delItem=function(strer){if (this._row>0){var tmpRow = isInt(strer) ? strer : this._i;var tmpAry=this._data;this._row=-1;this._data=new Array();for (var _r=0;_r<tmpAry.length;_r++){if (_r!=tmpRow){this._row++;this._data[this._row]=tmpAry[_r];}}this._i=1;}}
XPOWS.shellTable.prototype.getItemTree=function(){var reTree=new XPOWS.shellTree();if (this._row>0){for (var c=0;c<=this._col;c++){reTree.addItem(this._data[0][c],this._data[this._i][c]);}}return reTree;}
XPOWS.shellTable.prototype.getItemValue=function(strKey){var re="";if (this._row>0){for (var c=0;c<=this._col;c++){if (this._data[0][c]==strKey){re=this._data[this._i][c];break;}}}return re;}
XPOWS.shellTable.prototype.getItemValueInt=function(strKey) { return toInt(this.getItemValue(strKey)); }
XPOWS.shellTable.prototype.getItemValueNum=function(strKey) { return toNum(this.getItemValue(strKey)); }
XPOWS.shellTable.prototype.getFields=function(){var re="";if (this._row>0){for (var c=0;c<=this._col;c++) { re+=","+this._data[0][c]; }if (re.length>0) re=re.substr(1);}return re;}
XPOWS.shellTable.prototype.setFields=function(strFields){var tmpFieldAry=strFields.split(",");if (tmpFieldAry.length>0){this._row=0;this._col=tmpFieldAry.length-1;this._data=new Array();this._data[this._row]=tmpFieldAry;}}
XPOWS.shellTable.prototype.doAppendTree=function(strTree){if (isObject(strTree) && strTree.getObjectType()==this._ObjectType){strTree.doBegin();for (var i=0;i<strTree.getCount();i++){this.addItem(strTree.getItemKey(),strTree.getItemValue());strTree.doMove();}}}
//########################################
//########################################//putArray(this._data[this._row]);
XPOWS.utilMap=function(){this._list=new Array();};XPOWS.utilMap.prototype.setItem=function(strKey,strObject){this._list[strKey]=strObject;};XPOWS.utilMap.prototype.getItem=function(strKey,strObject){return this._list[strKey];}
XPOWS.utilMap.prototype.getItemString=function(strKey,strObject){var re="";if (!isEmpty(this._list[strKey])) re=this._list[strKey];return re;}
XPOWS.utilMap.prototype.getItemArray=function(strKey,strObject){var reArray=new Array();if (isArray(this._list[strKey])) reArray=this._list[strKey];return reArray;}
XPOWS.utilMap.prototype.getItemTree=function(strKey,strObject){var reTree=new XPOWS.shellTree();if (isTree(this._list[strKey])) reTree=this._list[strKey];return reTree;}
XPOWS.utilMap.prototype.getItemTable=function(strKey,strObject){var reTable=new XPOWS.shellTable();if (isTable(this._list[strKey])) reTable=this._list[strKey];return reTable;}
//########################################
//########################################
/*-1	未初始化,0	正常,1	对像初始化错误,2	数据检测不完整,3	内容载入不正常,4	载入状态错误 .readyState!=4,5	HTTP状态错误 .status!=200*/
XPOWS.shellHTTP=function(){this._xmlHttp;this._ErrorType=-1;this._isLoad=false;this._isCheck=false;this._PS='';this._reData=1;this._isParse=false;this._readyState=-1;this._status=-1;this._ResponseBody=null;this._ResponseText=null;this._ResponseXML=null;this._ReqHeader="text/xml";this._method="GET";this._Async=false;this._URL="";this._Dir="";this._SendData=null;}
XPOWS.shellHTTP.prototype.getErrorType=function() { return this._ErrorType; }
XPOWS.shellHTTP.prototype.getRequestObject=function(){var reObject=null;if (window.ActiveXObject){var tmpObjectAry=new Array('Msxml2.XMLHTTP','Microsoft.XMLHTTP');for (var o=0;o<tmpObjectAry.length;o++){try  { reObject=new ActiveXObject(tmpObjectAry[o]); } catch(e) { reObject=null; }if (reObject!=null) break;}}else if(window.XMLHttpRequest){reObject=new XMLHttpRequest();}return reObject;}
XPOWS.shellHTTP.prototype.isLoad=function() { return this._isLoad; }
XPOWS.shellHTTP.prototype.isCheck=function() { return this._isCheck; };XPOWS.shellHTTP.prototype.isParse=function() { return this._isParse; }
XPOWS.shellHTTP.prototype.setMethod=function(strer) { if (strer!='POST') strer='GET'; this._method=strer; }
XPOWS.shellHTTP.prototype.setAsync=function(strer) { this._Async=strer; }
XPOWS.shellHTTP.prototype.setPS=function(strer) { this._PS=strer; };XPOWS.shellHTTP.prototype.getPS=function() {return this._PS }
XPOWS.shellHTTP.prototype.setURL=function(strer) { this._URL=strer; this._isCheck=false; };XPOWS.shellHTTP.prototype.setSendData=function(strer) { this._SendData=strer; }
XPOWS.shellHTTP.prototype.setDir=function(strer){ this._Dir=strer};XPOWS.shellHTTP.prototype.setReqHeader=function(strer){ this._ReqHeader=strer;}
XPOWS.shellHTTP.prototype.parseQuery=function(){var xslURL=this._URL.split('?');var vPS = (xslURL[0].length == 1)?this.getPS():xslURL[0];var xslQueryString = this._Dir + vPS+ '?' + xslURL[1] + "&timeStamp=" + new Date().getTime();this._URL=xpow.point.Path.getFPath(xslQueryString)}//;alert(xslQueryString);}
XPOWS.shellHTTP.prototype.doInit=function(strer){this._ErrorType=-1;this._isLoad=false;this._isCheck=false;this._isParse=false;this._readyState=-1;this._status=-1;this._ResponseBody=null;this._ResponseText=null;this._reData=1;this._ResponseXML=null;if (strer==true){this._method="GET";this._Async=false;this._URL="";this._SendData=null;}}
XPOWS.shellHTTP.prototype.doLoad=function(){if (!this._isLoad){this._xmlHttp=this.getRequestObject();this._ErrorType=(this._xmlHttp==null) ? 1 : 0;this._isLoad=true;}}
XPOWS.shellHTTP.prototype.doCheck=function(){if (!this._isCheck){if (this._URL!=""){this._isCheck=true;}if (!this._isCheck){this._ErrorType=2;}}}
XPOWS.shellHTTP.prototype.doParse=function(strer){if (strer==true) this.doInit(false);this.doLoad();this.doCheck();if (!this._isParse && this._ErrorType==0) {try {this._xmlHttp.open(this._method,this._URL,this._Async);this._xmlHttp.setRequestHeader("Content-Type",this._ReqHeader);this._xmlHttp.send(this._SendData);}catch(exception) {this._ErrorType=3;}if (this._ErrorType!=3) {this._readyState=this._xmlHttp.readyState;this._status=this._xmlHttp.status;if(this._readyState==4){if (this._status==200 || this._status==0){this._ErrorType=0;} else {this._ErrorType=5;}} else {this._ErrorType=4;}}this._isParse=true;}}
XPOWS.shellHTTP.prototype.doStateChange=function(){if(this._xmlHttp.readyState==4) {if (this._xmlHttp.status==200 || this._xmlHttp.status==0) {alert("The Local replied with:" + this._xmlHttp.responseBody);}}}
XPOWS.shellHTTP.prototype.getResponseBody=function(){if (this._ErrorType==0 && this._ResponseBody==null){this._ResponseBody=this._xmlHttp.responseBody;if (this._ResponseBody==null) this._ResponseBody="";}var re=this._ResponseBody;return (re==null) ? "" : re;}
XPOWS.shellHTTP.prototype.getResponseText=function(){if (this._ErrorType==0 && this._ResponseText==null){this._ResponseText=this._xmlHttp.responseText;if (this._ResponseText==null) this._ResponseText="";}var re=this._ResponseText;return (re==null) ? "" : re;}
XPOWS.shellHTTP.prototype.getResponseXML=function(){if (this._ErrorType==0 && this._ResponseXML==null){if (this._xmlHttp.responseXML){this._ResponseXML=this._xmlHttp.responseXML.xml;if (this._ResponseXML==null) this._ResponseXML="";}else this._ResponseXML="";}var re=this._ResponseXML;return (re==null) ? "" : re;}
XPOWS.shellHTTP.prototype.getResponseXMLObject=function() { return this._xmlHttp.responseXML; };XPOWS.shellHTTP.prototype.getResponseHeader=function(strer) { return this._xmlHttp.getResponseHeader(strer); };XPOWS.shellHTTP.prototype.getReadyState=function() { return this._readyState; }	//0=uninitialized,1=loading,2=loaded,3=interactive,4=complete
XPOWS.shellHTTP.prototype.getStatus=function() { return this._status; };XPOWS.shellHTTP.prototype.getXMLHttp=function() { return this._xmlHttp; }
//########################################
//########################################
XPOWS.utilXCML=function(){this._i=0;this._Dom=null;this._isObject=false;this._NodeConfigure=null;this.ConfigureNode="";this.ConfigureField="";this._NodeItem=null;this._NodeItemLength=0;this._NodeItemNow=0;this._NodeItemArray=new Array();this._ObjectType="XPOWS.utilXCML";}
XPOWS.utilXCML.prototype.getDomObject=function(){var reObject=null;if (window.ActiveXObject){var tmpObjectAry=new Array("Microsoft.XMLDOM");for (var o=0;o<tmpObjectAry.length;o++){try  { reObject=new ActiveXObject(tmpObjectAry[o]); } catch(e) { reObject=null; }if (reObject!=null) break;}}else if(document.implementation && document.implementation.createDocument){reObject=document.implementation.createDocument("","",null);}return reObject;}
XPOWS.utilXCML.prototype.doInit=function(strer){ this._Dom=this.getDomObject();if (this._Dom!=null){this._Dom.async=false;this._Dom.resolveExternals=false;this._isObject=true;}}
XPOWS.utilXCML.prototype.loadResponseXML=function(strResponseXML){if (isObject(strResponseXML)){try{this._Dom=strResponseXML.documentElement;this._isObject=true;}catch(e) { this._isObject=false; }}}
XPOWS.utilXCML.prototype.loadFile=function(strer) { this._Dom.load(strer); };XPOWS.utilXCML.prototype.loadURL=function(strer) { this._Dom.load(strer); }
XPOWS.utilXCML.prototype.loadXML=function(strer) { this._Dom.loadXML(strer); };XPOWS.utilXCML.prototype.isObject=function(strer) { return this._isObject; }
XPOWS.utilXCML.prototype.getXML=function() { return (this._isObject==true) ? this._Dom.xml : ""; }
XPOWS.utilXCML.prototype.doParse=function(){if (!this._isObject || !this._Dom) return;this._NodeConfigure=this.getNodeObject("configure");this.ConfigureNode=this.getConfigure("node");this.ConfigureField=this.getConfigure("field");}
XPOWS.utilXCML.prototype.doParseNode=function(strer){if (!this._isObject) return;if (strer.length>0){this._NodeItem=this.getNodeObject(strer);this._NodeItemLength=this._NodeItem.length;if (this.ConfigureField.length>0) this._NodeItemArray=this.ConfigureField.split(",");}}
XPOWS.utilXCML.prototype.doParseItem=function() { this.doParseNode(this.ConfigureNode); };XPOWS.utilXCML.prototype.getConfigure=function(strKey) { return this.getNodeValue(this._NodeConfigure,0,strKey); };XPOWS.utilXCML.prototype.getConfigureNode=function() { return this.ConfigureNode; }
XPOWS.utilXCML.prototype.getConfigureField=function() { return this.ConfigureField; };XPOWS.utilXCML.prototype.getItemField=function() { return this.ConfigureField; }
XPOWS.utilXCML.prototype.getItemCount=function() { return this._NodeItemLength; };XPOWS.utilXCML.prototype.getItemLength=function() { return this._NodeItemLength; }
XPOWS.utilXCML.prototype.getItemNow=function() { return this._NodeItemNow; };XPOWS.utilXCML.prototype.doItemBegin=function() { return this._NodeItemNow=0; }
XPOWS.utilXCML.prototype.doItemMove=function(){this._NodeItemNow++;if (this._NodeItemNow>(this._NodeItemLength-2)) this._NodeItemNow=this._NodeItemLength-1;}
XPOWS.utilXCML.prototype.getItem=function(strKey){var re="";if (this._isObject && this._NodeItemLength>0) { re=this.getNodeValue(this._NodeItem,this._NodeItemNow,strKey); }return re;}
XPOWS.utilXCML.prototype.getItemTree=function(){var reTree=new XPOWS.shellTree();if (this._isObject && this._NodeItemLength>0) { reTree=this.getNodeTree(this._NodeItem,this._NodeItemNow); }return reTree;}
XPOWS.utilXCML.prototype.getNodeObject=function(strer) { return (this._isObject==true) ? this._Dom.getElementsByTagName(strer) : null; }
XPOWS.utilXCML.prototype.getNodeValue=function(strNode,strNum,strKey){var re="";try{if (strNode==null) strNode=this._Dom;re=strNode.item(strNum).getElementsByTagName(strKey).item(0).firstChild.nodeValue;}catch(e) { }return re;}
XPOWS.utilXCML.prototype.getNodeTree=function(strNode,strNum){var reTree=new XPOWS.shellTree();try{if (!isObject(strNode)) strNode=this.getNodeObject(strNode);var tmpNodes=strNode.item(strNum).childNodes;var tmpKey,tmpValue;for (var c=0;c<tmpNodes.length;c++){tmpKey=tmpNodes.item(c).tagName;if (!isEmpty(tmpKey)){tmpValue="";if (isObject(tmpNodes.item(c).firstChild)) tmpValue=tmpNodes.item(c).firstChild.nodeValue;reTree.addItem(tmpKey,tmpValue);}}}catch(e) { }return reTree;}
//########################################
xpow.shell.getURL2Tree=function(strURL){var reTree=new XPOWS.shellTree();var tmpHttp=new XPOWS.shellHTTP();tmpHttp.setURL(strURL);tmpHttp.doParse();if (tmpHttp.getErrorType()==0){var tmpXCML=new XPOWS.utilXCML();tmpXCML.loadResponseXML(tmpHttp.getResponseXMLObject());tmpXCML.doParse();var tmpItemArray=tmpXCML.getConfigure("node").split(",");for (var a=0;a<tmpItemArray.length;a++){reTree.doAppendTree(tmpXCML.getNodeTree(tmpItemArray[a]),tmpItemArray[a]+".");}}return reTree;}
xpow.shell.getURL2Table=function(strURL){var reTable=new XPOWS.shellTable();var tmpHttp=new XPOWS.shellHTTP();tmpHttp.setURL(strURL);tmpHttp.doParse();if (tmpHttp.getErrorType()==0){var tmpXCML=new XPOWS.utilXCML();tmpXCML.loadResponseXML(tmpHttp.getResponseXMLObject());tmpXCML.doParse();var tmpFields=tmpXCML.getConfigureField();if (tmpFields!=""){reTable.setFields(tmpFields);tmpXCML.doParseItem();tmpXCML.doItemBegin();for (var a=0;a<tmpXCML.getItemCount();a++){reTable.addItem(tmpXCML.getItemTree());tmpXCML.doItemMove();}}}return reTable;}
Array.prototype.del=function(n){if(n<0) return this;return this.slice(0,n).concat(this.slice(n+1,this.length));}
//########################################

dbg.Tree=function(strObject) { if (isTree(strObject)) put(toArrayString(strObject.getArray())); }
dbg.Table=function(strObject) { if (isTable(strObject)) put(toArrayString(strObject.getArray())); }
dbg.Array=function(strObject) { if (isArray(strObject)) put(toArrayString(strObject)); }
function toArrayString(strAry,strTitle)
{
	var re='';
	re='<table border="1">';
	if (typeof(strAry[0])=='object') {
		var tmpCol=strAry[0].length;
		var tmpRow=strAry.length;
		var tmpAry,_r;
		if (!isEmpty(strTitle)) re+='<tr><td colspan="'+(tmpCol+1)+'">'+strTitle+'</td></tr>';
		re+='<tr><td colspan="'+(tmpCol+1)+'">Col='+tmpCol+', Row='+tmpRow+'</td></tr>';
		for (var _a=0;_a<strAry.length;_a++) {
			tmpAry=strAry[_a];
			re+='<tr>';
			re+='<td>'+(_a+1)+'.</td>';
			for (_r=0;_r<tmpAry.length;_r++) { re+='<td>'+tmpAry[_r]+'</td>'; }
			re+='</tr>';
		}
	} else {
		if (!isEmpty(strTitle)) re+='<tr><td colspan="2">'+strTitle+'</td></tr>';
		re+='<tr><td colspan="2">Lnegth='+strAry.length+'</td></tr>';
		for (var _a=0;_a<strAry.length;_a++) { re+='<tr><td>'+(_a+1)+'.</td><td>'+strAry[_a]+'</td></tr>'; }
	}
	re+='</table>';
	return re;
}

