
 var PAGE_DIV = "pagediv";
 var DEBUG_MODE = "debug";
 var ERROR_MSG_HEAD = "___errorMsg";
 var POPUP_ONE_ACTION = "/popuponepage";
 var POPUP_TWO_ACTION = "/popuptwopage";
 var lastPageMap = new ValueMap();
 var lastInnerTagMap = new ValueMap();
 var lastActionMap = new ValueMap();
 var lastPageDataMap = new ValueMap();
 var lastActionMethodMap = new ValueMap();
 var lastActionMethodParaMap = new ValueMap();
 var SCRIPT_INNER_TAG = "___script";
 var LOGON_AREA_ID = "login";
 var DEFAULT_LOGON_DO = "___defaultlogondo";
 var INIT_FLAG = false;
 var USER_LOGON_NAME = null;
 var IS_LOGON = false;
 var PREVIOUS_USER_LOGON_NAME = null;
 var designMode = false;
 var ATTRIBUTE_CHECK_TYPE = "checktype";
 var ATTRIBUTE_AREASET_NAME = "areaset";
 var ATTRIBUTE_AREASET_VALUE = "yes";
 var PORTLET_PK = "portletpk";
 var SAVE_HISTORY_PATH = "savehistorypath";
 var PAGE_AREA_PK = "___pageareapk";
function sendReturnText(thisTagOrId, url, innerTagNodeOrId, doMethod, methodPara, debugTag, setValueMode, noReturnValue, isSync, urlToForm, sendData, historyKey, noError) {
	if (thisTagOrId!=null && typeof(thisTagOrId)=="object" && thisTagOrId.length>0){
		var param = [];
		if (thisTagOrId.length>0){
			param[param.length] = thisTagOrId[0];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>1){
			param[param.length] = thisTagOrId[1];
		}else{
			param[param.length] = null;
		}
		param[param.length] = null;
		if (thisTagOrId.length>2){
			param[param.length] = thisTagOrId[2];
		}else{
			param[param.length] = null
		}
		if (thisTagOrId.length>3){
			param[param.length] = thisTagOrId[3];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>4){
			param[param.length] = thisTagOrId[4];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>5){
			param[param.length] = thisTagOrId[5];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>6){
			param[param.length] = thisTagOrId[6];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>7){
			param[param.length] = thisTagOrId[7];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>8){
			param[param.length] = thisTagOrId[8];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>9){
			param[param.length] = thisTagOrId[9];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>10){
			param[param.length] = thisTagOrId[10];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>11){
			param[param.length] = thisTagOrId[11];
		}else{
			param[param.length] = null;
		}
		if (thisTagOrId.length>12){
			param[param.length] = thisTagOrId[12];
		}else{
			param[param.length] = null;
		}
		return sendDataReturnText(param);
	}else{
		return sendDataReturnText(thisTagOrId,url,null,innerTagNodeOrId,doMethod,methodPara, debugTag, setValueMode, noReturnValue, isSync, urlToForm, sendData, historyKey, noError);
	}
}
function showdialog(thisTagOrId,url,width,height,formNodeOrId,useFrame,param,fullScreen){
	if (useFrame==null || useFrame==''){
		useFrame = 'true';
	}
	var actionUrl = VIRTUAL_PATH+ACTION_PATH+POPUP_ONE_ACTION+ACTION_EXT_NAME+"?";
	var innerTag = getInnerTagNodeId(thisTagOrId);
	if (innerTag!=null){
		var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
		if (portPKTag!=null && portPKTag.value!=null){
			actionUrl += PORTLET_PK+"="+portPKTag.value+"&";
		}
	}
	if (url.indexOf("?")>-1){
		actionUrl += url.substring(url.indexOf("?")+1,url.length);
		url = url.substring(0,url.indexOf("?"));
	}
	actionUrl += "&useframe="+useFrame+"&tomainaction="+url+"&";
	actionUrl = getFormData(formNodeOrId,actionUrl);
	if (HTA_MODE!=null){
		actionUrl=HOST_ADDRESS+actionUrl;
	}
	if (actionUrl.substring(actionUrl.length-1,actionUrl.length)=='&'){
		actionUrl = actionUrl.substring(0,actionUrl.length-1);
	}
	var features = "status:yes;resizable:yes;directories:yes;help:yes;scroll:yes;";
	if (fullScreen){
		features += "dialogWidth:"+screen.width+"px;dialogHeight:"+screen.height+"px;dialogLeft:0px;dialogTop:0px;";
	}else{
		features += "dialogWidth:"+width+"px;dialogHeight:"+height+"px;dialogLeft:"+Math.round(screen.width/2-width/2)+"px;dialogTop:"+Math.round(screen.height/2-height/2) +"px;";
	}
	return window.showModalDialog(actionUrl,param,features);
}
function showdialogTwo(thisTagOrId,leftUrl,rightUrl,width,height,formNodeOrId,param,fullScreen){
	var actionUrl = VIRTUAL_PATH+ACTION_PATH+POPUP_TWO_ACTION+ACTION_EXT_NAME+"?";
	var innerTag = getInnerTagNodeId(thisTagOrId);
	if (innerTag!=null){
		var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
		if (portPKTag!=null && portPKTag.value!=null){
			actionUrl += PORTLET_PK+"="+portPKTag.value+"&";
		}
	}
	if (leftUrl.indexOf("?")>-1){
		actionUrl += leftUrl.substring(leftUrl.indexOf("?")+1,leftUrl.length)+"&";
		leftUrl = leftUrl.substring(0,leftUrl.indexOf("?"));
	}
	if (rightUrl.indexOf("?")>-1){
		actionUrl += rightUrl.substring(rightUrl.indexOf("?")+1,rightUrl.length);
		rightUrl = rightUrl.substring(0,rightUrl.indexOf("?"));
	}
	actionUrl += "&leftaction="+leftUrl+"&rightaction="+rightUrl+"&";
	actionUrl = getFormData(formNodeOrId,actionUrl);
	if (HTA_MODE!=null){
		actionUrl=HOST_ADDRESS+actionUrl;
	}
	if (actionUrl.substring(actionUrl.length-1,actionUrl.length)=='&'){
		actionUrl = actionUrl.substring(0,actionUrl.length-1);
	}
	var features = "status:yes;resizable:yes;directories:yes;help:yes;scroll:yes;";
	if (fullScreen){
		features += "dialogWidth:"+screen.width+"px;dialogHeight:"+screen.height+"px;dialogLeft:0px;dialogTop:0px;";
	}else{
		features += "dialogWidth:"+width+"px;dialogHeight:"+height+"px;dialogLeft:"+Math.round(screen.width/2-width/2)+"px;dialogTop:"+Math.round(screen.height/2-height/2) +"px;";
	}
	return window.showModalDialog(actionUrl,param,features);
}
function popuptwo(thisTagOrId,leftUrl,rightUrl,title, width, height, formNodeOrId, showBar){
	var features = "";
	if (showBar==null){
		showBar = "yes";
	}
	features += "toolbar="+showBar+",location="+showBar+",status="+showBar+",menubar="+showBar+",scrollbars=yes,resizable=yes,channelmode="+showBar;
	features += "',width="+width+",height="+height;
	features += ",top="+Math.round(screen.height/2-height/2)+",left="+Math.round(screen.width/2-width/2);
	var actionUrl = VIRTUAL_PATH+ACTION_PATH+POPUP_TWO_ACTION+ACTION_EXT_NAME+"?";
	var innerTag = getInnerTagNodeId(thisTagOrId);
	if (innerTag!=null){
		var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
		if (portPKTag!=null && portPKTag.value!=null){
			actionUrl += PORTLET_PK+"="+portPKTag.value+"&";
		}
	}
	if (leftUrl.indexOf("?")>-1){
		actionUrl += leftUrl.substring(leftUrl.indexOf("?")+1,leftUrl.length)+"&";
		leftUrl = leftUrl.substring(0,leftUrl.indexOf("?"));
	}
	if (rightUrl.indexOf("?")>-1){
		actionUrl += rightUrl.substring(rightUrl.indexOf("?")+1,rightUrl.length);
		rightUrl = rightUrl.substring(0,rightUrl.indexOf("?"));
	}
	actionUrl += "&leftaction="+leftUrl+"&rightaction="+rightUrl+"&";
	actionUrl = getFormData(formNodeOrId,actionUrl);
	if (HTA_MODE!=null){
		actionUrl=HOST_ADDRESS+actionUrl;
	}
	if (actionUrl.substring(actionUrl.length-1,actionUrl.length)=='&'){
		actionUrl = actionUrl.substring(0,actionUrl.length-1);
	}
	window.open(actionUrl,title,features);
}
function popupone(thisTagOrId,url,title, width, height, formNodeOrId,useFrame,showBar,fullScreen){
	var features = "";
	if (useFrame==null){
		useFrame = "no";
	}
	if (showBar==null){
		showBar = "yes";
	}
	if (useFrame==null || useFrame==""){
		useFrame = "true";
	}
	features += "toolbar="+showBar+",location="+showBar+",status=yes,menubar="+showBar+",scrollbars=yes,resizable=yes,channelmode="+showBar;
	if (fullScreen){
		features += "',width="+screen.width+",height="+screen.height;
		features += ",top=0,left=0";
	}else{
		features += "',width="+width+",height="+height;
		features += ",top="+Math.round(screen.height/2-height/2)+",left="+Math.round(screen.width/2-width/2);
	}
	var actionUrl = VIRTUAL_PATH+ACTION_PATH+POPUP_ONE_ACTION+ACTION_EXT_NAME+"?";
	var innerTag = getInnerTagNodeId(thisTagOrId);
	if (innerTag!=null){
		var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
		if (portPKTag!=null && portPKTag.value!=null){
			actionUrl += PORTLET_PK+"="+portPKTag.value+"&";
		}
	}
	if (url.indexOf("?")>-1){
		actionUrl += url.substring(url.indexOf("?")+1,url.length);
		url = url.substring(0,url.indexOf("?"));
	}
	actionUrl += "&useframe="+useFrame+"&tomainaction="+url+"&";
	actionUrl = getFormData(formNodeOrId,actionUrl);
	if (HTA_MODE!=null){
		actionUrl=HOST_ADDRESS+actionUrl;
	}
	if (actionUrl.substring(actionUrl.length-1,actionUrl.length)=='&'){
		actionUrl = actionUrl.substring(0,actionUrl.length-1);
	}
	window.open(actionUrl,title,features);
}
function popupaction(thisTagOrId,url,title, width, height, formNodeOrId, showBar,fullScreen){
	if (url==null){
		return;
	}
	if (showBar==null){
		showBar = "yes";
	}
	var features = "";
	features += "toolbar="+showBar+",location="+showBar+",status="+showBar+",menubar="+showBar+",scrollbars=yes,resizable=yes,channelmode="+showBar;
	if (fullScreen){
		features += "',width="+screen.width+",height="+screen.height;
		features += ",top=0,left=0";
	}else{
		features += "',width="+width+",height="+height;
		features += ",top="+Math.round(screen.height/2-height/2)+",left="+Math.round(screen.width/2-width/2);
	}
	if (url.indexOf("?")>-1){
		if (url.indexOf(ACTION_EXT_NAME)<0){
			url = url.replace("?",ACTION_EXT_NAME+"?");
		}
	}else{
		url += ACTION_EXT_NAME+"?";
	}
	url = VIRTUAL_PATH+ACTION_PATH+url+"&";
	url = getFormData(formNodeOrId,url);
	var innerTag = getInnerTagNodeId(thisTagOrId);
	if (innerTag!=null){
		var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
		if (portPKTag!=null && portPKTag.value!=null){
			url += "&"+PORTLET_PK+"="+portPKTag.value+"&";
		}
	}
	if (HTA_MODE!=null){
		url=HOST_ADDRESS+url;
	}
	if (url.substring(url.length-1,url.length)=='&'){
		url = url.substring(0,url.length-1);
	}
	window.open(url,title,features);
}
function showModalDialogHTML(thisTagOrId,url,param, width, height, fullScreen){
	if (url==null){
		return;
	}
	var features = "status:yes;resizable:yes;directories:yes;help:yes;scroll:yes;";
	if (fullScreen){
		features += "dialogWidth:"+screen.width+"px;dialogHeight:"+screen.height+"px;dialogLeft:0px;dialogTop:0px;";
	}else{
		features += "dialogWidth:"+width+"px;dialogHeight:"+height+"px;dialogLeft:"+Math.round(screen.width/2-width/2)+"px;dialogTop:"+Math.round(screen.height/2-height/2) +"px;";
	}
	url = VIRTUAL_PATH+url;
	if (HTA_MODE!=null){
		url=HOST_ADDRESS+url;
	}
	var innerTag = getInnerTagNodeId(thisTagOrId);
	if (innerTag!=null){
		var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
		if (portPKTag!=null && portPKTag.value!=null){
			if (url.indexOf("?")>-1){
				url += "&"+PORTLET_PK+"="+portPKTag.value+"&";
			}else{
				url += "?"+PORTLET_PK+"="+portPKTag.value+"&";
			}
		}
	}
	if (url.substring(url.length-1,url.length)=='&'){
		url = url.substring(0,url.length-1);
	}
	return window.showModalDialog(url,param,features);
}
function popupHTML(thisTagOrId,url,title, width, height, showBar, fullScreen){
	if (url==null){
		return;
	}
	if (showBar==null){
		showBar = "yes";
	}
	var features = "";
	features += "toolbar="+showBar+",location="+showBar+",status="+showBar+",menubar="+showBar+",scrollbars=yes,resizable=yes,channelmode="+showBar;
	if (fullScreen){
		features += "',width="+screen.width+",height="+screen.height;
		features += ",top=0,left=0";
	}else{
		features += "',width="+width+",height="+height;
		features += ",top="+Math.round(screen.height/2-height/2)+",left="+Math.round(screen.width/2-width/2);
	}
	url = VIRTUAL_PATH+url;
	var innerTag = getInnerTagNodeId(thisTagOrId);
	if (innerTag!=null){
		var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
		if (portPKTag!=null && portPKTag.value!=null){
			if (url.indexOf("?")>-1){
				url += "&"+PORTLET_PK+"="+portPKTag.value+"&";
			}else{
				url += "?"+PORTLET_PK+"="+portPKTag.value+"&";
			}
		}
	}
	if (HTA_MODE!=null){
		url=HOST_ADDRESS+url;
	}
	if (url.substring(url.length-1,url.length)=='&'){
		url = url.substring(0,url.length-1);
	}
	window.open(url,title,features);
}
function backPageByKey(innerTagId, historyKey){
	backPage(null,innerTagId,null,null,null,null,null,null,null,null,historyKey);
}
function backPage(thisTagOrId, innerTagNodeOrId, doMethod, methodPara, debugTag, setValueMode, noReturnValue, isSync, urlToForm, sendData, historyKey){
	if (thisTagOrId!=null && typeof(thisTagOrId)=="object" && thisTagOrId.length>0){
		if (thisTagOrId.length>5){
			setValueMode = thisTagOrId[5];
		}
		if (thisTagOrId.length>4){
			debugTag = thisTagOrId[4];
		}
		if (thisTagOrId.length>3){
			methodPara = thisTagOrId[3];
		}
		if (thisTagOrId.length>2){
			doMethod = thisTagOrId[2];
		}
		if (thisTagOrId.length>1){
			innerTagNodeOrId = thisTagOrId[1];
		}
		if (thisTagOrId.length>0){
			thisTagOrId = thisTagOrId[0];
		}
	}
	var url;
	var innerTag;
	if (historyKey!=null && historyKey!=""){
		innerTagNodeOrId = getNodeByObject(lastInnerTagMap.get(historyKey));
		innerTag = getNodeByObject(innerTagNodeOrId);
		if (innerTag==null){
			return;
		}
		url = lastActionMap.get(historyKey);
		if (doMethod==null){
			doMethod = lastActionMethodMap.get(historyKey);
			methodPara = lastActionMethodParaMap.get(historyKey);
		}
		if (sendData==null){
			sendData = lastPageDataMap.get(historyKey);
		}
	}else{
		if (innerTagNodeOrId==null || innerTagNodeOrId==""){
				innerTagNodeOrId = getInnerTagNodeId(thisTagOrId);
		}
		innerTag = getNodeByObject(innerTagNodeOrId);
		if (innerTag==null){
			return;
		}
		var innerTagID = getNodeIdByObject(innerTag);
		if (innerTagID==null || innerTagID==""){
			return;
		}
		url = lastActionMap.get(innerTagID);
		if (doMethod==null){
			doMethod = lastActionMethodMap.get(innerTagID);
			methodPara = lastActionMethodParaMap.get(innerTagID);
		}
		if (sendData==null){
			sendData = lastPageDataMap.get(innerTagID);
		}
	}
	sendReturnText(thisTagOrId, url, innerTag, doMethod, methodPara, debugTag, setValueMode, noReturnValue, isSync, urlToForm, sendData);
}
function getInnerTagNodeId(thisTagOrId){
	try{
		return getNodeByNeighborhood(thisTagOrId,ATTRIBUTE_AREASET_NAME,ATTRIBUTE_AREASET_VALUE).id;
	}catch(e){}
	return "";
}
function sendDataReturnText(thisTagOrId, url, formNodeOrId, innerTagNodeOrId, doMethod, methodPara, debugTag, setValueMode, noReturnValue, isSync, urlToForm, sendData, historyKey, noError) {
	if (thisTagOrId!=null
			&& typeof(thisTagOrId)=="object"
			&& thisTagOrId.length>0 && url==null){
		if (thisTagOrId.length>13){
			noError = thisTagOrId[13];
		}
		if (thisTagOrId.length>12){
			historyKey = thisTagOrId[12];
		}
		if (thisTagOrId.length>11){
			sendData = thisTagOrId[11];
		}
		if (thisTagOrId.length>10){
			urlToForm = thisTagOrId[10];
		}
		if (thisTagOrId.length>9){
			isSync = thisTagOrId[9];
		}
		if (thisTagOrId.length>8){
			noReturnValue = thisTagOrId[8];
		}
		if (thisTagOrId.length>7){
			setValueMode = thisTagOrId[7];
		}
		if (thisTagOrId.length>6){
			debugTag = thisTagOrId[6];
		}
		if (thisTagOrId.length>5){
			methodPara = thisTagOrId[5];
		}
		if (thisTagOrId.length>4){
			doMethod = thisTagOrId[4];
		}
		if (thisTagOrId.length>3){
			innerTagNodeOrId = thisTagOrId[3];
		}
		if (thisTagOrId.length>2){
			formNodeOrId = thisTagOrId[2];
		}
		if (thisTagOrId.length>1){
			url = thisTagOrId[1];
		}
		if (thisTagOrId.length>0){
			thisTagOrId = thisTagOrId[0];
		}
	}
	var req;
	if (url==null){
		return;
	}
	var qPoint = url.indexOf("?");
	var tPoint = url.indexOf(".");
	if (qPoint>-1){
		if (tPoint<0 || qPoint<tPoint){
			url = url.replace("?",ACTION_EXT_NAME+"?");
		}
	}else if (tPoint<0){
		url += ACTION_EXT_NAME;
	}
	var innerTag;
	var innerTagID;
	var setValueModeOld;
	if (innerTagNodeOrId==null || innerTagNodeOrId==""){
		innerTagNodeOrId = getInnerTagNodeId(thisTagOrId);
	}
 	innerTag = getNodeByObject(innerTagNodeOrId);
	if (innerTag!=null){
		innerTagID = getNodeIdByObject(innerTag);
	}
	if (!noReturnValue){
		if (innerTag==null){
			return;
		}
		if (setValueMode==null){
			setValueMode = "innerhtml";
			setValueModeOld = setValueMode;
		}else{
			setValueModeOld = setValueMode;
			setValueMode = setValueMode.toLowerCase();
		}
	}
	if (innerTagID!=null && innerTag!=null){
		try{
			lastPageMap.put(innerTagID,innerTag.innerHTML);
		}catch(e){}
	}
	if(window.XMLHttpRequest){
		req = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	req.onreadystatechange = function() {
		this.returnInnerTag = innerTag;
		this.returnInnerTagId = getNodeIdByObject(innerTag);
		this.sendBeforeHTML = lastPageMap.get(innerTagID);
		this.afterSendDoMethod = doMethod;
		this.afterSendDoMethodPara = methodPara;
		this.debugTag = debugTag;
		this.setValueMode = setValueMode;
		this.noReturnValue = noReturnValue;
		if(req.readyState == 4){
			if (req.status < 400) {
				var resValue = req.responseText;
				var scriptNodes = null;
				if(noReturnValue){
					var vNode = document.createElement("DIV");
					vNode.innerHTML = resValue;
					scriptNodes = getElementsInNodeByAttribute(vNode,"name",SCRIPT_INNER_TAG);
				}else{
					if (debugTag=="debug"){
						resValue =
							getPageTest(resValue,url, formNodeOrId, innerTagNodeOrId, doMethod, methodPara, debugTag, setValueMode);
						if (setValueMode=="innerhtml"){
							innerTag.innerHTML = resValue;
						}else if (setValueMode=="innertext"){
							innerTag.innerText = resValue;
						}else if (setValueMode=="value"){
							try{
								innerTag.value = resValue;
							}catch(e){}
						}else{
							try{
								innerTag.setAttribute(setValueModeOld,resValue);
							}catch(e){}
						}
					}else{
						if (setValueMode=="innerhtml"){
							innerTag.innerHTML = resValue;
						}else if (setValueMode=="innertext"){
							innerTag.innerText = resValue;
						}else if (setValueMode=="value"){
							try{
								innerTag.value = resValue;
							}catch(e){}
						}else{
							try{
								innerTag.setAttribute(setValueModeOld,resValue);
							}catch(e){}
						}
					}
					scriptNodes = getElementsInNodeByAttribute(innerTag,"name",SCRIPT_INNER_TAG);
				}
				if (scriptNodes!=null){
					var i=0;
					while(i<scriptNodes.length){
						if (scriptNodes[i]!=null){
							eval(scriptNodes[i].value);
						}
						i++;
					}
				}
				if (doMethod!=null){
					try{
						doMethod(methodPara,resValue)
					}catch(e){}
				}
			}else{
				if (!noError){
					if (noReturnValue){
						alert("服务器繁忙请稍后再试!");
					}else{
						resText = getPageError(null,url, formNodeOrId, innerTagNodeOrId, doMethod, methodPara, debugTag, setValueMode);
						if (setValueMode=="innerhtml"){
							innerTag.innerHTML = resText;
						}else if (setValueMode=="innertext"){
							innerTag.innerText = resText;
						}else {
							try{
								innerTag.value = resText;
							}catch(e){}
						}
					}
				}
			}
		}
	}
	var portPKTag = getElementInNodeByAttribute(innerTag,"id",PORTLET_PK);
	var sendContent = "";
	if (innerTagID!=null && innerTagID!=""){
		sendContent = PAGE_AREA_PK+"="+innerTagID+"&";
	}
	if (portPKTag!=null){
		sendContent += PORTLET_PK+"="+portPKTag.value+"&";
	}
	if (formNodeOrId!=null){
		if (typeof formNodeOrId == "string"){
			var elems = formNodeOrId.split(";");
			var i = 0;
			while(i<elems.length){
				if (elems[i]!=null){
					try{
						sendContent = getFormData(document.getElementById(elems[i]),sendContent,true);
					}catch(e){
						return;
					}
				}
				i++;
			}
		}else{
			try{
				sendContent = getFormData(formNodeOrId,sendContent,true);
			}catch(e){
				return;
			}
		}
	}
	var pageTag = getNodeByNeighborhood(thisTagOrId,"id",PAGE_DIV);
	if (pageTag!=null){
		sendContent = getFormData(pageTag,sendContent);
	}
	var thisAction;
	if (url.indexOf("?")>-1){
		if (urlToForm){
			sendContent += "&"+url.substring(url.indexOf("?")+1,url.length)+"&";
			url = url.substring(0,url.indexOf("?"));
			thisAction = url;
		}else{
			thisAction = url.substring(0,url.indexOf("?"));
		}
	}else{
		thisAction = url;
	}
	try{
		if (!isSync && !noReturnValue && setValueMode=="innerhtml"){
			innerTag.innerHTML = getPagePleaseWait();
		}
	}catch(e){}
	if (url.indexOf("http")!=0 && url.indexOf(".htm")<0){
		if (ACTION_PATH=='' || url.indexOf(ACTION_PATH)<0){
			url = ACTION_PATH+url;
		}
		if (VIRTUAL_PATH=='' || url.indexOf(VIRTUAL_PATH)<0){
			url = VIRTUAL_PATH+url;
		}
		if (HTA_MODE!=null){
			url = HOST_ADDRESS+url;
		}
	}
	if (sendData!=null && sendData!=""){
		if (sendContent==null || sendContent==""){
			sendContent = sendData;
		}else{
			sendContent += "&"+sendData;
		}
	}
	if (url.substring(url.length-1,url.length)=='&'){
		url = url.substring(0,url.length-1);
	}
	if (isSync){
		req.open("POST",url, false);
	}else{
		req.open("POST",url, true);
	}
	req.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
	try{
		req.send(sendContent);
	}catch(e){}
	if (!noReturnValue){
		var saveUrl = false;
		if (historyKey!=null && historyKey!=""){
			saveUrl = true;
		}
		if (url.indexOf(SAVE_HISTORY_PATH+"=true")>-1){
			saveUrl = true;
			url = url.replace(SAVE_HISTORY_PATH+"=true",SAVE_HISTORY_PATH+"=false");
		}
		if (sendContent.indexOf(SAVE_HISTORY_PATH+"=true")>-1){
			saveUrl = true;
			sendContent = sendContent.replace(SAVE_HISTORY_PATH+"=true",SAVE_HISTORY_PATH+"=false");
		}
		if (saveUrl){
			if (historyKey!=null && historyKey!=""){
				lastInnerTagMap.put(historyKey,innerTagID);
				lastActionMap.put(historyKey,url);
				lastActionMethodMap.put(historyKey,doMethod);
				lastActionMethodParaMap.put(historyKey,methodPara);
				lastPageDataMap.put(historyKey,sendContent);
			}
			lastActionMap.put(innerTagID,url);
			lastActionMethodMap.put(innerTagID,doMethod);
			lastActionMethodParaMap.put(innerTagID,methodPara);
			lastPageDataMap.put(innerTagID,sendContent);
		}
	}
	return req;
}
function getNewElement(htmlText,nodeName){
	if (nodeName==null || nodeName==""){
		nodeName = "div";
	}
	var newNode = document.createElement(nodeName);
	newNode.innerHTML = htmlText;
	return newNode;
}
function getNodeByNeighborhood(tagOrId,attributeName,attributeValue){
	var node = getNodeByObject(tagOrId);
	if (node==null){
		return null;
	}
	var reNode =
		getElementInNodeByAttribute(node,attributeName,attributeValue);
	if (reNode!=null){
		return reNode;
	}
	var nodeName;
	try{
		nodeName = node.nodeName;
	}catch(e){}
	if (nodeName=="#document"){
		return null;
	}
	var parentNode = null;
	try{
		parentNode = node.parentNode;
	}catch(e){}
	if (parentNode!=null){
		return getNodeByNeighborhood(parentNode,attributeName,attributeValue);
	}
}
function checkScriptFromInnerTag(innerTagOrId){
	this.returnInnerTag = getNodeByObject(innerTagOrId);
	this.returnInnerTagId = getNodeIdByObject(innerTagOrId);
	var executed = false;
	var innerTag = getNodeByObject(innerTagOrId);
	if (innerTag==null){
		return executed;
	}
	var scriptNodes = getElementsInNodeByAttribute(innerTag,"name",SCRIPT_INNER_TAG);
	if (scriptNodes!=null){
		var i=0;
		while(i<scriptNodes.length){
			if (scriptNodes[i]!=null){
				eval(scriptNodes[i].value);
				executed = true;
			}
			i++;
		}
	}
	return executed;
}
function checkScriptFromHTML(html){
	try{
		return checkScriptFromInnerTag(getNewElement(html));
	}catch(e){}
	return false;
}
function getNodeElementsByNodeName(nodeOrId,nodeName){
		var reArrl = [];
		var node = getNodeByObject(nodeOrId);
		if (node==null || nodeName==null || nodeName==""){
			return reArrl;
		}
		nodeName = nodeName.toUpperCase();
		var nodeValue = "";
		try{
			nodeValue = node.nodeName;
		}catch(e){}
		if (nodeName==nodeValue){
			reArrl[reArrl.length] = node;
		}
		if (!node.canHaveChildren){
			return reArrl;
		}
		var elements = node.children;
		var elementCount = 0;
		try{
			elementCount = elements.length;
		}catch(e){}
		if (elementCount==0){
			return reArrl;
		}
		var elementNo = 0;
		while(elementNo<elementCount){
			if (elements[elementNo]==null){
				continue;
			}
			var chNodeArrl = getNodeElementsByNodeName(elements[elementNo],nodeName);
			if (chNodeArrl!=null){
				var i=0;
				while(i<chNodeArrl.length){
					reArrl[reArrl.length] = chNodeArrl[i];
					i++;
				}
			}
			elementNo++;
		}
		return reArrl;
	}
function getNodeById(id){
	try{
		return document.getElementById(id);
	}catch(e){}
	return null;
}
function getNodeAttribute(node,attribName){
	var res;
	try{
		res = node.getAttribute(attribName);
	}catch(e){}
	if (res==null){
		res = "";
	}
	return res;
}
 function getNodeName(node){
 	 var res;
 	 try{
 	 	 res = node.nodeName;
 	 }catch(e){}
 	 if (res==null){
 	 	 res = "";
 	 }
 	 return res;
 }
function getFormData(submitForm,res,needCheck){
	submitForm = getNodeByObject(submitForm);
	if (submitForm==null){
		return res;
	}
	var elements = submitForm.children;
	var elementCount = 0;
	try{
		elementCount = elements.length;
	}catch(e){}
	if (elementCount==0){
		res += getElementSubmitPara(submitForm,needCheck);
		return res;
	}
	var elementNo = 0;
	while(elementNo<elementCount){
		if (elements[elementNo]==null){
			continue;
		}
		if (elements[elementNo].canHaveChildren
				&& getNodeName(elements[elementNo])!="TEXTAREA"
				&& getNodeName(elements[elementNo])!="SELECT"){
			res = getFormData(elements[elementNo],res,needCheck);
		}else{
			res += getElementSubmitPara(elements[elementNo],needCheck);
		}
		elementNo++;
	}
	return res;
}
function getNodeByObject(nodeOrId){
	if (nodeOrId==null){
		return null;
	}
	var node = null;
	try{
		if (typeof nodeOrId == "string"){
			node = document.getElementById(nodeOrId);
		}else{
			node = nodeOrId;
		}
	}catch(e){}
	if (typeof node == "undefined"){
		return null;
	}
	return node;
}
function getNodeIdByObject(nodeOrId){
	if (nodeOrId==null){
		return null;
	}
	try{
		if (typeof nodeOrId == "string"){
			return nodeOrId;
		}else{
			return nodeOrId.id;
		}
	}catch(e){
		return null;
	}
}
function getNodeElementById(nodeOrId,idValue){
	if (idValue==null){
		return null;
	}
	var node = getNodeByObject(nodeOrId);
	if (node==null){
		return null;
	}
	if (node.id==idValue){
		return node;
	}
	if (node.nodeName=="#document"){
		node = node.body;
	}
	if (!node.canHaveChildren){
		return null;
	}
	var elements = node.children;
	var elementCount = 0;
	try{
		elementCount = elements.length;
	}catch(e){}
	if (elementCount==0){
		return null;
	}
	var elementNo = 0;
	while(elementNo<elementCount){
		if (elements[elementNo]==null){
			continue;
		}
		var reNode = getNodeElementById(elements[elementNo],idValue);
		if (reNode!=null){
			return reNode;
		}
		elementNo++;
	}
	return null;
}
function getElementsInDocumentByAttribute(attributeName,attributeValue){
	var nodes = document.childNodes;
	var reNodeArr = [];
	var i=0;
	while(i<nodes.length){
		var elementNodesArr =
			getElementsInNodeByAttribute(nodes[i],attributeName,attributeValue);
		if (elementNodesArr!=null){
			var j=0;
			while(j<elementNodesArr.length){
				reNodeArr[reNodeArr.length] = elementNodesArr[j];
				j++;
			}
		}
		i++;
	}
	return reNodeArr;
}
function getElementsInNodeByAttribute(nodeOrId,attributeName,attributeValue){
	var reArrl = [];
	var node = getNodeByObject(nodeOrId);
	if (node==null){
		return reArrl;
	}
	var idValue = getNodeAttribute(node,attributeName);
	if (idValue!=null && idValue==attributeValue){
		reArrl[reArrl.length] = node;
	}
	if (node.nodeName=="#document"){
		node = node.body;
	}
	try{
		if (!node.canHaveChildren){
			return reArrl;
		}
	}catch(e){
		return reArrl;
	}
	var elements = null;
	try{
		elements = node.children;
	}catch(e){
		return reArrl;
	}
	var elementCount = 0;
	try{
		elementCount = elements.length;
	}catch(e){}
	if (elementCount==0){
		return reArrl;
	}
	var elementNo = 0;
	while(elementNo<elementCount){
		if (elements[elementNo]==null){
			continue;
		}
		var chNodeArrl = getElementsInNodeByAttribute(elements[elementNo],attributeName,attributeValue);
		if (chNodeArrl!=null){
			var i=0;
			while(i<chNodeArrl.length){
				reArrl[reArrl.length] = chNodeArrl[i];
				i++;
			}
		}
		elementNo++;
	}
	return reArrl;
}
function getElementInNodeByAttribute(nodeOrId,attributeName,attributeValue){
	var node = getNodeByObject(nodeOrId);
	if (node==null){
		return null;
	}
	var idValue = getNodeAttribute(node,attributeName);
	if (idValue!=null && idValue==attributeValue){
		return node;
	}
	if (node.nodeName=="#document"){
		node = node.body;
	}
	if (!node.canHaveChildren){
		return null;
	}
	var elements = node.children;
	var elementCount = 0;
	try{
		elementCount = elements.length;
	}catch(e){}
	if (elementCount==0){
		return null;
	}
	var elementNo = 0;
	while(elementNo<elementCount){
		if (elements[elementNo]==null){
			continue;
		}
		var reNode = getElementInNodeByAttribute(elements[elementNo],attributeName,attributeValue);
		if (reNode!=null){
			return reNode;
		}
		elementNo++;
	}
	return null;
}
function getElementSubmitPara(elem,needCheck){
	var nodeName;
	var attribType;
	var attribName;
	var attribValue;
	nodeName = getNodeName(elem);
	if (nodeName==null || nodeName=="" || nodeName.indexOf("/")==0){
		return "";
	}
	attribName = getNodeAttribute(elem,"name");
	if (attribName==""){
		return "";
	}
	if (nodeName=="INPUT"){
		attribValue = getNodeAttribute(elem,"value");
		attribType = getNodeAttribute(elem,"type");
		if (attribType==""
				|| attribType=="image"
				|| attribType=="reset"){
			return "";
		}else{
			if (attribType=="radio" || attribType=="checkbox"){
				try{
					if (!elem.checked){
						return "";
					}
				}catch(e){}
			}
		}
	}else if (nodeName=="SELECT"){
		try{
			attribValue = elem.value;
		}catch(e){}
		if (attribValue==null || attribValue==''){
			attribValue = getNodeAttribute(elem,"value");
		}
	}else if (nodeName=="TEXTAREA"){
		attribValue = elem.innerText;
		if (attribValue==null){
			attribValue = "";
		}
	}
	if (attribName==null || attribName==""){
		return "";
	}
	if (attribValue==null){
		attribValue = "";
	}
	if (needCheck){
		var checktype = getNodeAttribute(elem,ATTRIBUTE_CHECK_TYPE);
		if (checktype!=null && checktype!=""){
			checkTagValue(elem,attribValue,checktype);
		}
	}
	return attribName+"="+URLEncodePro(attribValue)+"&";
}
function checkTagValue(tagOrId,checkValue,checkType){
	if (checkType==null || checkType==""){
		return;
	}
	var checkTypes = checkType.split(",");
	var i=0;
	var errorMsg;
	var isError = false;
	while(i<checkTypes.length){
		if(checkTypes[i]==null){
			i++;
			continue;
		}
		if (checkValue==null || checkValue==""){
			if (checkTypes[i]=="nonull"){
				errorMsg = "请输入值";
				isError = true;
			}
		}else{
			if (checkTypes[i].indexOf("maxnum:")>-1){
				var size = new Number(checkTypes[i].substring("maxnum:".length,checkTypes[i].length));
				if (checkValue!=null && checkValue.length>size){
					errorMsg = "输入的值的长度大于:"+size;
					isError = true;
				}
			}else if (checkTypes[i].indexOf("minnum:")>-1){
				var size = new Number(checkTypes[i].substring("minnum:".length,checkTypes[i].length));
				if (checkValue!=null && checkValue.length<size){
					errorMsg = "输入的值的长度小于:"+size;
					isError = true;
				}
			}else if (checkTypes[i].indexOf("same:")>-1){
				var anOtherNode;
				try{
					anOtherNode = document.getElementById(checkTypes[i].substring("same:".length,checkTypes[i].length))
				}catch(e){}
				if (anOtherNode==null){
					errorMsg = "程序错误：没有找到校验信息输入框";
					isError = true;
				}else if (anOtherNode.value!=checkValue){
					errorMsg = "输入值与重复输入值不同，请重新输入";
					isError = true;
				}
			}else if (checkTypes[i]=="digit" && isDigitError(checkValue)){
				errorMsg = "输入的值不是数字";
				isError = true;
			}else if (checkTypes[i]=="stringa" && checkStringErrorA(checkValue)){
				errorMsg = "输入的值不合法：只能输入5-20个以字母开头、可带数字、\"_\"、\".\"的字串";
				isError = true;
			}else if (checkTypes[i]=="stringb" && checkStringErrorB(checkValue)){
				errorMsg = "输入的值不合法：只能输入1-30个以字母开头的字串";
				isError = true;
			}else if (checkTypes[i]=="stringc" && checkStringErrorC(checkValue)){
				errorMsg = "输入的值不合法：只能输入6-20个字母、数字、下划线";
				isError = true;
			}else if (checkTypes[i]=="tel" && isTelError(checkValue)){
				errorMsg = "输入的号码格式错误：可以\"+\"开头，除数字外，可含有\"-\"";
				isError = true;
			}else if (checkTypes[i]=="mobil" && isMobilError(checkValue)){
				errorMsg = "输入的手机号格式错误：必须以数字开头，除数字外，可含有\"-\"";
				isError = true;
			}else if (checkTypes[i]=="postal" && isPostalCode(checkValue)){
				errorMsg = "输入的邮政编码错误";
				isError = true;
			}else if (checkTypes[i]=="email" && isEmailError(checkValue)){
				errorMsg = "输入的邮件地址错误";
				isError = true;
			}else if (checkTypes[i]=="dateymd" && isDateYMDError(checkValue)){
				errorMsg = "输入的日期错误: 应为 年年年年-月月-日日";
				isError = true;
			}else if (checkTypes[i]=="dateymdh" && isDateYMDHError(checkValue)){
				errorMsg = "输入的时间错误: 应为 年年年年-月月-日日 时时";
				isError = true;
			}else if (checkTypes[i]=="dateymdhm" && isDateYMDHMError(checkValue)){
				errorMsg = "输入的时间错误: 应为 年年年年-月月-日日 时时:分分";
				isError = true;
			}else if (checkTypes[i]=="dateymdhms" && isDateYMDHMSError(checkValue)){
				errorMsg = "输入的时间错误: 应为 年年年年-月月-日日 时时:分分:秒秒";
				isError = true;
			}else if (checkTypes[i]=="dateymdhmspro" && isDateYMDHMSProError(checkValue)){
				errorMsg = "输入的时间错误: 应为 年年年年-月月-日日 时时:分分";
				isError = true;
			}else if (checkTypes[i]=="float" && checkFloatError(checkValue)){
				errorMsg = "输入的数字错误: 内容中只能包含数字，小数点和负号";
				isError = true;
			}else if (checkTypes[i]=="blank" && checkBlankError(checkValue)){
				errorMsg = "不能包含空格";
				isError = true;
			}else if (checkTypes[i]=="corpschar" && checkCorpsCharError(checkValue)){
				errorMsg = "不能包含特殊字符";
				isError = true;
			}
		}
		if (isError){
			var tagNode = getNodeByObject(tagOrId);
			if (tagNode!=null){
				try{
					tagNode.focus();
				}catch(e){}
			}
			alert(errorMsg);
			throw errorMsg;
		}
		i++;
	}
}
function checkBlankError(s){
	var len1 = s.length;
	var s = s.replace(/[\s+　]/g,"");
	var len2 = s.length;
	if(len1>len2) {
		return true;
	}
	return false;
}
function checkCorpsCharError(s){
     var i, len;
     var regArray = new Array('','@','!','#','$','%','^','&','*','(',')','~','%','!','<','>','‰','//','\\','`','[',']','{','}','?');
     len = regArray.length;
     for(i=1;i<=len;i++){
            if (s.indexOf(regArray[i])!=-1){
                   return true;
            }
     }
 	 return false;
}
function isEmailError(s) {
	var patrn=/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isDateYMDHMSError(s) {
	var patrn=/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isDateYMDHMSProError(s) {
	var patrn=/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/;
	var patrnsec = /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})$/;
	var patrnthr = /^(\d{4})-(\d{2})-(\d{2})         $/;
	var patrnfor = /^(\d{4})-(\d{2})-(\d{2})$/;
	if (patrn.exec(s) || patrnsec.exec(s) || patrnthr.exec(s) || patrnfor.exec(s)){
		return false;
	}
	return true;
}
function isDateYMDHMError(s) {
	var patrn=/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isDateYMDHError(s) {
	var patrn=/^(\d{4})-(\d{2})-(\d{2}) (\d{2})$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isDateYMDError(s) {
	var patrn=/^(\d{4})-(\d{2})-(\d{2})$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isPostalCode(s) {
	var patrn=/^[1-9](\d){5}(?!d)/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isMobilError(s) {
	var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isTelError(s) {
	var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function checkStringErrorC(s) {
	var patrn=/^(\w){6,20}$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function checkStringErrorB(s) {
	var patrn=/^[a-zA-Z]{1,30}$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function checkStringErrorA(s) {
	var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function checkFloatError(s) {
	var patrn=/^[0-9]|[.-]$/;
	if (patrn.exec(s)){
		return false;
	}
	return true;
}
function isDigitError(s) {
	var patrn=/^[0-9]{1,20}$/;
	if (patrn.exec(s)){
		 return false;
	}
	return true;
}
function URLEncodePro(plaintext){
	if (plaintext==null){
		return "";
	}
	if (plaintext==""){
		return plaintext;
	}
	return plaintext
			.replace(/%/g,"%25")
			.replace(/=/g,"%3D")
			.replace(/\+/g,"%2B")
			.replace(/ /g,"+")
			.replace(/\n/g,"%0D")
			.replace(/#/g,"%23")
			.replace(/\'/g,"%27")
			.replace(/\,/g,"%2C")
			.replace(/\"/g,"%22")
			.replace(/\;/g,"%3B")
			.replace(/\./g,"%2E")
			.replace(/\-/g,"%2D")
			.replace(/:/g,"%3A")
			.replace(/\//g,"%2F")
			.replace(/\r/g,"")
			.replace(/\t/g,"%09")
			.replace(/&/g,"%26")
			.replace(/\?/g,"%3F")
			.replace(/!/g,"%21")
			.replace(/</g,"%3C")
			.replace(/>/g,"%3E")
			.replace(/\\/g,"%5C");
}
function URLEncode(plaintext) {
	var SAFECHARS = "0123456789" +
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
					"abcdefghijklmnopqrstuvwxyz";
	var HEX = "0123456789ABCDEF";
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
				encoded += ch;
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	}
	return encoded;
}
function doubleCharLength(str){
	var iLen =0;
	var iSize = str.length;
	var i=0;
	var iCode;
	while(i<iSize){
		iCode = str.charCodeAt(i);
		if(iCode>=0 && iCode<=128) {
			iLen ++;
		}else {
			iLen +=2;
		}
		i++;
	}
	return iLen;
}
function URLDecode(encoded) {
   var HEXCHARS = "0123456789ABCDEFabcdef";
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2)
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	}
	return plaintext;
}
function getPagePleaseWait(){
	return "<div id='___pleasewait'><img src='../images/ajax-loader.gif' border='0'/>&nbsp;请稍候...</div>";
}
function getPageError(content,url, formNodeOrId, innerTagNodeOrId, doMethod, methodPara, debugTag, setValueMode){
	if (content==null){
		content = "系统忙";
	}
	return  "<div class=\"pleaseWait\"><font color=\"red\">"+content+"，请稍候点击刷新按钮</font><input type=\"button\" name=\"btrefresh\" value=\"刷新\" onclick=\"javascript:sendDataReturnText(null,'"+url+"','"+getNodeIdByObject(formNodeOrId)+"','"+getNodeIdByObject(innerTagNodeOrId)+"',"+getMethodName(doMethod)+",'"+methodPara+"','"+debugTag+"','"+setValueMode+"');\" style=\"BORDER: #ffffff 1px solid;PADDING:6px 2px 1px 2px;FONT-SIZE: 12px;FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#d1d1d1);CURSOR: hand;\" /></div>";
}
function getPageTest(pageContent,url, formNodeOrId, innerTagNodeOrId, doMethod, methodPara, debugTag, setValueMode){
	return pageContent+"<br/><textarea cols=\"50\" rows=\"10\" id=\"debugtestarea097876\">"
		   +pageContent+"</textarea><input type=\"button\" name=\"testbt1\" value=\"刷新\" onclick=\"javascript:sendDataReturnText(null,'"+url+"','"+getNodeIdByObject(formNodeOrId)+"','"+getNodeIdByObject(innerTagNodeOrId)+"',"+getMethodName(doMethod)+",'"+methodPara+"','"+debugTag+"','"+setValueMode+"');\" "
		   +" style=\"BORDER: #ffffff 1px solid;PADDING:6px 2px 1px 2px;FONT-SIZE: 12px;FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#d1d1d1);CURSOR: hand;\" />";
}
 function getMethodName(doMethod){
	if (doMethod!=null){
		var methodBody = doMethod.toString();
	    return methodBody.substring(methodBody.toLowerCase().indexOf("function")+9,methodBody.indexOf("("));
	}
	return null;
 }
function cloneAllNode(srcNodeOrID){
	var srcNode = getNodeByObject(srcNodeOrID);
	if (srcNode==null){
		return null;
	}
	var nodeType = srcNode.nodeType;
	if (nodeType==null){
		return srcNode;
	}
	var reNode = srcNode.cloneNode();
	if (srcNode.hasChildNodes){
		var childNodes = srcNode.childNodes;
		var nodeCount = childNodes.length;
		var i=0;
		while(i<nodeCount){
			reNode.appendChild(cloneAllNode(childNodes[i]));
			i++;
		}
	}
	return reNode;
}
function copyForm(srcFormOrId,objFormOrId,objDocument){
	objFormOrId = getNodeByObject(objFormOrId);
	var tagList = [];
	getAllSubmitTag(srcFormOrId,tagList);
	var tagCount = tagList.length;
	var i=0;
	while(i<tagCount){
		var nodeName = tagList[i].nodeName;
		var objTag = objDocument.createElement(nodeName);
		objTag.name=tagList[i].name;
		if (nodeName=='INPUT' || nodeName=='SELECT'){
			objTag.setAttribute('type',tagList[i].getAttribute('type'));
			objTag.setAttribute('value',tagList[i].getAttribute('value'));
		}else if (nodeName=='TEXTAREA'){
			objTag.innerHTML = tagList[i].innerHTML;
		}else{
			i++;
			continue;
		}
		objFormOrId.appendChild(objTag);
		i++;
	}
}
function getAllSubmitTag(formOrId,tagList){
	formOrId = getNodeByObject(formOrId);
	var elements = formOrId.children;
	var elementCount = 0;
	try{
		elementCount = elements.length;
	}catch(e){}
	if (elementCount==0){
		nodeName = getNodeName(formOrId);
		if (nodeName==null || nodeName=="" || nodeName.indexOf("/")==0){
			return;
		}
		attribName = getNodeAttribute(formOrId,"name");
		if (attribName==""){
			return;
		}
		if (nodeName=="INPUT"
				|| nodeName=="SELECT"
				|| nodeName=="TEXTAREA"){
			tagList[tagList.length] = formOrId;
		}
	}
	var elementNo = 0;
	while(elementNo<elementCount){
		if (elements[elementNo]==null){
			continue;
		}
		getAllSubmitTag(elements[elementNo],tagList);
		elementNo++;
	}
}
function getSid(){
	var time = new String((new Date()).getTime());
	var randomStr = new String(Math.random());
	randomStr = randomStr.substring(2,randomStr.length);
	return (time+randomStr).substring(0,20);
}
function moveNode(thisNodeOrId,type){
	var thisNode = getNodeByObject(thisNodeOrId);
	if (thisNode==null){
		return;
	}
	var parentNode = null;
	try{
		parentNode = thisNode.parentNode;
	}catch(e){}
	var childNodes = null;
	try{
		childNodes = parentNode.childNodes;
	}catch(e){}
	if (childNodes==null){
		return;
	}
	var thisNodePoint = 0;
	while(childNodes[thisNodePoint]!=thisNode){
		thisNodePoint++;
	}
	var fixChildNodes = cloneAllNode(parentNode).childNodes;
	var childNodeCount = fixChildNodes.length;
	var moveNode1 = null;
	var moveNode2 = null;
	var movePoint1 = thisNodePoint;
	var movePoint2 = thisNodePoint;
	if (type==2){
		movePoint2--;
		if (movePoint2>-1){
			moveNode1 = fixChildNodes[movePoint2];
		}
		moveNode2 = fixChildNodes[movePoint1];
	}else if (type==3){
		movePoint2++;
		if (movePoint2<childNodeCount){
			moveNode1 = fixChildNodes[movePoint2];
		}
		moveNode2 = fixChildNodes[movePoint1];
	}
	parentNode.innerHTML = "";
	if (type==1){
		try{
			parentNode.appendChild(cloneAllNode(moveNode));
		}catch(e){}
	}
	var i=0;
	while(i<childNodeCount){
		try{
			if (moveNode1==null || moveNode2==null){
				parentNode.appendChild(cloneAllNode(fixChildNodes[i]));
			}else{
				if (type==2 || type==3){
					if (i==movePoint1){
						parentNode.appendChild(cloneAllNode(moveNode1));
					}else if (i==movePoint2){
						parentNode.appendChild(cloneAllNode(moveNode2));
					}else{
						parentNode.appendChild(cloneAllNode(fixChildNodes[i]));
					}
				}else{
					parentNode.appendChild(cloneAllNode(fixChildNodes[i]));
				}
			}
		}catch(e){}
		i++;
	}
	if (type==2){
		try{
			parentNode.appendChild(cloneAllNode(moveNode));
		}catch(e){}
	}
}
function insertNode(thisNodeOrId,newNode,type,isParentNode){
	var thisNode = getNodeByObject(thisNodeOrId);
	if (thisNode==null || newNode==null){
		return;
	}
	if (type==null){
		type = 0;
	}
	if (type!=0 && type!=1){
		isParentNode = false;
	}
	var parentNode = null;
	if (isParentNode){
		parentNode = thisNode;
	}else{
		parentNode = thisNode.parentNode;
	}
	var childNodes = null;
	try{
		childNodes = parentNode.childNodes;
	}catch(e){}
	var thisNodePoint = 0;
	if (!isParentNode && childNodes!=null){
		while(childNodes[thisNodePoint]!=thisNode){
			thisNodePoint++;
		}
	}
	var fixChildNodes = null;
	try{
		fixChildNodes = cloneAllNode(parentNode).childNodes;
	}catch(e){}
	var childNodeCount = 0;
	if (fixChildNodes!=null){
		childNodeCount = fixChildNodes.length;
	}
	parentNode.innerHTML = "";
	if (type==0){
		try{
			parentNode.appendChild(newNode);
		}catch(e){}
	}
	var i=0;
	while(i<childNodeCount){
		try{
			if (!isParentNode){
				if (i==thisNodePoint){
					if (type==2){
						parentNode.appendChild(newNode);
						parentNode.appendChild(cloneAllNode(fixChildNodes[i]));
						i++;
						continue;
					}else if (type==3){
						parentNode.appendChild(cloneAllNode(fixChildNodes[i]));
						parentNode.appendChild(newNode);
						i++;
						continue;
					}
				}
			}
			parentNode.appendChild(cloneAllNode(fixChildNodes[i]));
		}catch(e){}
		i++;
	}
	if (type==1){
		try{
			parentNode.appendChild(newNode);
		}catch(e){
			alert(e.description);
		}
	}
}
function fixArrayListString(allArrayListString,elementString,type){
	if (allArrayListString==null){
		allArrayListString = "";
	}
	if (elementString==null){
		elementString = "";
	}
	if (type==0){
		if (allArrayListString.length>0){
			return allArrayListString+","+elementString;
		}
		return elementString;
	}else if (type==1){
		var arrs = allArrayListString.split(",");
		var reStr = "";
		var i = 0;
		var j = 0;
		while(i<arrs.length){
			if (arrs[i]==elementString){
				i++;
				continue;
			}
			if (j>0){
				reStr += ",";
			}
			reStr += arrs[i];
			j++;
			i++;
		}
		return reStr;
	}
	return allArrayListString;
}
function ValueList(){
	var listValue = [];
	this.typeName = "List";
	this.size = getSize;
	this.add = addElement;
	this.removeByElement = removeByElement;
	this.removeByIndex = removeByIndex;
	this.get = getElement;
	this.contains = containsElement;
	this.clearAll = clearAll;
	this.getList = getElementList;
	this.getListString = getElementString;
	this.toJavaString = getJavaString;
	this.toEncodeJavaString = getEncodeJavaString;
	function getSize(){
		return listValue.length;
	}
	function getJavaString(){
		return getObjectJavaString(this);
	}
	function getEncodeJavaString(){
		return URLEncodePro(getObjectJavaString(this));
	}
	function clearAll(){
		listValue = [];
	}
	function addElement(element,index){
		if (index==null || index==""){
			listValue[listValue.length] = element;
			return;
		}
		var indexInt;
		try{
			indexInt = new Number(index);
		}catch(e){
			return;
		}
		if (indexInt<0){
			return;
		}
		var i =listValue.length;
		while(i>indexInt){
			listValue[i] = listValue[i-1];
			i--;
		}
		listValue[indexInt] = element;
	}
	function removeByElement(element){
		var afterRemoveList = [];
		var i = 0;
		while(i<listValue.length){
			if (listValue[i]==element){
				i++;
				continue;
			}
			afterRemoveList[afterRemoveList.length]=listValue[i];
			i++;
		}
		listValue = afterRemoveList;
	}
	function removeByIndex(index){
		var indexInt;
		try{
			indexInt = new Number(index);
		}catch(e){
			return;
		}
		var afterRemoveList = [];
		var i = 0;
		while(i<listValue.length){
			if (i==indexInt){
				i++;
				continue;
			}
			afterRemoveList[afterRemoveList.length]=listValue[i];
			i++;
		}
		listValue = afterRemoveList;
	}
	function getElement(index){
		var indexInt;
		try{
			indexInt = new Number(index);
		}catch(e){
			return null;
		}
		try{
			return listValue[index];
		}catch(e){
			return null;
		}
	}
	function containsElement(element){
		var i=0;
		while(i<listValue.length){
			if (listValue[i]==element){
				return true;
			}
			i++;
		}
		return false;
	}
	function getElementList(){
		return listValue;
	}
	function getElementString(){
		var reStr = "";
		var i=0;
		while(i<listValue.length){
			if (i>0){
				reStr += ",";
			}
			if (listValue[i]!=null){
				reStr += listValue[i];
			}
			i++;
		}
		return reStr;
	}
}
function ValueMap(){
	var keyList = new ValueList();
	var vMap = ({});
	this.typeName = "Map";
	this.put = doPut;
	this.get = doGet;
	this.clear = doClear;
	this.getKeys = doGetKeys;
	this.remove = doRemove;
	this.getKeyString = doGetKeyString;
	this.getKeyList = doGetKeyList;
	this.toJavaString = getJavaString;
	this.toEncodeJavaString = getEncodeJavaString;
	function getEncodeJavaString(){
		return URLEncodePro(getObjectJavaString(this));
	}
	function getJavaString(){
		return getObjectJavaString(this);
	}
	function doRemove(key){
		vMap[key] = null;
		if (keyList.contains(key)){
			keyList.removeByElement(key);
		}
	}
	function doGetKeys(){
		return keyList.getList();
	}
	function doGetKeyList(){
		return keyList;
	}
	function doClear(){
		keyList.clearAll();
		vMap = ({});
	}
	function doPut(key,value){
		vMap[key] = value;
		if (!keyList.contains(key)){
			keyList.add(key);
		}
	}
	function doGet(key){
		var reValue = vMap[key];
		if (reValue==null){
			reValue = "";
		}
		return reValue;
	}
	function doGetKeyString(){
		return keyList.getListString();
	}
}
function getObjectJavaString(object){
	if (object == null){
		return "";
	}
	var typeName = object.typeName;
	if (typeName==null){
		return object;
	}else if (typeName=="List"){
		var reValueStr = "";
		var reSizeStr = "";
		var elementStr;
		var i=0;
		while(i<object.size()){
			if (i>0){
				reSizeStr += ",";
			}
			elementStr = getObjectJavaString(object.get(i));
			if (elementStr==null){
				elementStr = "";
			}
			reValueStr += elementStr;
			reSizeStr += doubleCharLength(elementStr);
			i++;
		}
		var elementString = reSizeStr+";"+reValueStr;
		elementString = doubleCharLength(elementString)+";"+elementString;
		var reStr = "19,"+doubleCharLength(elementString)+";java.util.ArrayList"+elementString;
		return doubleCharLength(reStr)+";"+reStr;
	}else if (typeName=="Map"){
		var valueValueStr = "";
		var valueSizeStr = "";
		var valueStr;
		var keyList = object.getKeyList();
		var i=0;
		while(i<keyList.size()){
			valueStr = getObjectJavaString(object.get(keyList.get(i)));
			if (i>0){
				valueSizeStr += ",";
			}
			if (valueStr==null){
				valueStr = "";
			}
			valueValueStr += valueStr;
			valueSizeStr += doubleCharLength(valueStr);
			i++;
		}
		var keyString = getObjectJavaString(keyList);
		var valueString = valueSizeStr+";"+valueValueStr;
		valueString = doubleCharLength(valueString)+";"+valueString;
		valueString = "19,"+doubleCharLength(valueString)+";java.util.ArrayList"+valueString;
		valueString = doubleCharLength(valueString)+";"+valueString;
		var reStr = "17,"+doubleCharLength(keyString)+","+doubleCharLength(valueString)+";java.util.HashMap"+keyString+valueString;
		return doubleCharLength(reStr)+";"+reStr;
	}
}
function copyFormDataToOtherForm(srcFormOrId,objFormOrId,notFirst){
	var srcTag = getNodeByObject(srcFormOrId);
	var objTag = getNodeByObject(objFormOrId);
	if (srcTag==null || objTag==null){
		return objTag;
	}
	if (notFirst==null){
		var newSrcTag = document.createElement("div");
		newSrcTag.innerHTML = srcTag.innerHTML;
		srcTag = newSrcTag;
	}
	var nodeName = getNodeName(srcTag);
	if (nodeName=="INPUT" || nodeName=="TEXTAREA" || nodeName=="SELECT"){
		var typeAttrilb = getNodeAttribute(srcTag,"type").toLowerCase();
		if (typeAttrilb=='button'){
			return objTag;
		}
		try{
			insertNode(objTag,srcTag.cloneNode(),1,true);
		}catch(e){}
	}else{
		var clds;
		try{
			clds = srcTag.children;
		}catch(e){}
		if (clds!=null && clds.length>0){
			var i=0;
			while(i<clds.length){
				objTag = copyFormDataToOtherForm(clds[i],objTag,true);
				i++;
			}
		}
	}
	return objTag;
}
function ltrim(s){
	return s.replace( /^\s*/, "");
}
function rtrim(s){
	return s.replace( /\s*$/, "");
}
function trim(s){
	return rtrim(ltrim(s));
}
function getXMLHttp()
	{
	var oXML = null;
	if(window.XMLHttpRequest)
	{
		oXML = new XMLHttpRequest();
	if (oXML.overrideMimeType)
	{
		oXML.overrideMimeType('text/xml');
	}
	return oXML;
	}
	else if (window.ActiveXObject)
	{
	try
	{
		oXML = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
	try
	{
		oXML = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (e) {}
	}
	}
	if (!oXML)
	{
		window.alert("不能创建XMLHttpRequest对象实例.");
		return false;
	}
	return oXML;
}
function Thread(_task,_delay,_times)
{
    this.runFlag=false;
    this.busyFlag=false;
    this.taskArgs=Array.prototype.slice.call(arguments,3);
    if (_times!=undefined)
    {
        this.times=_times;
    }
    else
    {
        this.times=1;
    }
    var _point=this;
    this.timerID=-1;
    this.start=function()
    {
        if (this.runFlag==false)
        {
            this.timerID=window.setInterval(_point.run,_delay);
            this.runFlag=true;
        }
    }
    this.run=function()
    {
        if (_point.busyFlag) return;
        if (_point.times==-1)
        {
            _task(_point.taskArgs);
        }
        else if (_point.times>0)
        {
            _task(_point.taskArgs);
            _point.times-=1;
            if (_point.times==0)
            {
                window.clearInterval(this.timerID);
            }
        }
    }
    this.sleep=function()
    {
        this.busyFlag=true;
    }
    this.resume=function()
    {
        this.busyFlag=false;
    }
    this.abort=function()
    {
        window.clearInterval(this.timerID);
    }
}
