﻿document.write("<script src='/icons/icons/bevariables.js'><\/script>");document.write("<script src='/icons/icons/ComView.js'><\/script>");document.write("<script src='/icons/icons/ComboBox.js'><\/script>");

//添加到当前表单临时变量值中goForm.Holidays
function bAddHoliday(psUsername,psType,psValue){
	if (!goForm.Holidays){
		if (goForm.e_Holidays){
			if (goForm.e_Holidays.value.trim()=="")
				goForm.Holidays = new Array();
			else
				goForm.Holidays = goForm.e_Holidays.value.split(";");
		}else
			goForm.Holidays = new Array();
	}

	var lsLeft = psUsername + "|" + psType + "|";
	
	for (var i=0;i<goForm.Holidays.length;i++) if (goForm.Holidays[i].indexOf(lsLeft)==0) break;
	
	if (i<goForm.Holidays.length)
		goForm.Holidays[i] = lsLeft+psValue;
	else
		goForm.Holidays[goForm.Holidays.length] = lsLeft+psValue;
	if (goForm.e_Holidays) goForm.e_Holidays.value = goForm.Holidays.join(';');
	return true;
}
//将goForm.Holidays值提交给人事管理代理，注意代理以服务器身份运行
//上/下一环节同一办理人时存在自动提交请假数据到人事管理的问题，需要改用流程流向中执行代理归档到人事管理。
function bSaveHoliday(){
	var lsPara = (goForm.e_Holidays)?goForm.e_Holidays.value:((goForm.Holidays)?goForm.Holidays.join(';'):"");
	if(lsPara==null || lsPara=="") return false;
	var lsURL = gsCurURL  + "zRsgl.nsf/agtSaveHoliday?OpenAgent&t="+((new Date()).valueOf());
	var xmlhttp = oGetXmlHttpRequest();
	if (xmlhttp==null) return false;
	xmlhttp.open("POST",lsURL, false);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send(escape(lsPara));
	return true;
}


//取某一用户的所有假期值数组，以假期类型为下标
function aGetHoliday(psUsername){
	var lsUsername = (psUsername==null || psUsername=="")?gsCurUser:psUsername;
	var laHoliday = new Array();

	var lsURL = gsCurURL  + "zRsgl.nsf/agtGetHoliday?OpenAgent&Name=" + encodeURIComponent(lsUsername) + "&t="+((new Date()).valueOf());
	var xmlhttp = oGetXmlHttpRequest();
	if (xmlhttp==null) return false;
	xmlhttp.open("GET",lsURL, false);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send('');
	
	if (xmlhttp.readyState == 4 && xmlhttp.status == 200 ) {
    		var xmlDoc = xmlhttp.responseXML;
    		var lsRoot = "hol_root";
    		var loRoot = xmlDoc.selectSingleNode(lsRoot);
    		if (loRoot!=null){
			for (var i=0;i<loRoot.childNodes.length;i++){
				var loNode = loRoot.childNodes[i];
				laHoliday[loNode.nodeName] = loNode.text;
			}
		}
    	}
    	return laHoliday;
}

function sGetLabel(psObject,pbObject){var loElement=(typeof(psObject)=="string")?eval("document.all."+psObject):psObject;if(typeof(loElement)!="object"){return"";}if(typeof(loElement.type)=="undefined"&&typeof(loElement.length)!="undefined"){loElement=loElement[0];}else{if(!$null(loElement)&&!$null(loElement.Label)){if(pbObject!=true){return loElement.Label;}}}var loTmp=loElement;while(loTmp!=null){if(loTmp.tagName=="TD"&&loTmp.isInner!="1"||loTmp.tagName=="FORM"){break;}loTmp=loTmp.parentElement;}if(loTmp==null||loTmp.tagName=="FORM"){return"";}if(loTmp.previousSibling!=null){var loTd=loTmp.previousSibling;}else{var loTmp=loTmp.parentElement.previousSibling;if(loTmp==null){return"";}var loTd=loTmp.children[0];}var lsLabel=loTd.innerText;if(lsLabel!=null&&lsLabel.trim()!=""){if(pbObject){return loTd;}return(lsLabel.replace(/[:：*]$/,"").replace(/\s/,""));}var liShowIndex=-1,liIndex=-1;for(var i=loTd.children.length-1;i>=0;i--){if(loTd.children[i].tagName=="INPUT"&&loTd.children[i].value!=""){liIndex=i;if(loTd.children[i].offsetWidth>0){liShowIndex=i;}}}if(liIndex<0){return"";}if(pbObject){return loTd;}if(liShowIndex<0){liShowIndex=liIndex;}return(loTd.children[liShowIndex].value.replace(/[:：*]$/,"").replace(/\s/,""));}

function bSetLabel(poObj,pbMark){var loObj=poObj;if(loObj==null){return false;}var lbMark=$null(pbMark)?true:pbMark;var lsText=loObj.innerText;if(lsText!=null&&lsText.trim()!=""){var lbTrue=eval("lsText.substring(lsText.length-2, lsText.length)"+(lbMark?"!=":"==")+'" *"');if(lbTrue){if(loObj.innerHTML.indexOf(lsText)>0){for(var i=loObj.children.length-1;i>=0;i--){var loTmp=loObj.children[i];if(loTmp.tagName=="INPUT"){var lsV=loTmp.value;if(lsV!=""){var lbTrue=eval("lsV.substring(lsV.length-2, lsV.length)"+(lbMark?"!=":"==")+'" *"');if(lbTrue){loTmp.innerText=lbMark?(lsV+" *"):lsV.substring(0,lsV.length-2);}}}else{if(loTmp.tagName!="INPUT"){var lsT=lbMark?(lsText+" *"):lsText.substring(0,lsText.length-2);if(loTmp.innerHTML.indexOf(lsText)>0){loTmp.innerHTML=sReplaceSubstring(loTmp.innerHTML,lsText,lsT);}else{loTmp.innerText=lsT;}}}}}else{loObj.innerText=lbMark?(lsText+" *"):lsText.substring(0,lsText.length-2);}}}else{for(var i=loObj.children.length-1;i>=0;i--){var loTmp=loObj.children[i];if(loTmp.tagName=="INPUT"){var lsV=loTmp.value;if(lsV!=""){var lbTrue=eval("lsV.substring(lsV.length-2, lsV.length)"+(lbMark?"!=":"==")+'" *"');if(lbTrue){loTmp.innerText=lbMark?(lsV+" *"):lsV.substring(0,lsV.length-2);}}}}}return true;}function bMarkValidLabel(psFieldNames,pbMark){if(psFieldNames==null||psFieldNames==""||!goForm){return false;}var laNull=$null(goForm.validNullFields)?(new Array()):goForm.validNullFields.split(";");var laField;if(typeof(psFieldNames)=="string"){laField=psFieldNames.split(";");}else{if(Object.prototype.toString.apply(psFieldNames)=="[object Array]"){laField=psFieldNames;}else{laField=new Array();laField.push(psFieldNames);}}for(var i=0;i<laField.length;i++){var loField=laField[i];var loObj=sGetLabel(loField,true);if(loObj==null||loObj==""){continue;}bSetLabel(loObj,pbMark);var lsField=typeof(loField)=="string"?loField:loField.name;var liTmp=laNull.indexOf(lsField);if(pbMark!=false){if(liTmp==-1){laNull.push(lsField);}}else{if(liTmp!=-1){laNull.splice(liTmp,1);}}}goForm.validNullFields=laNull.join(";");return true;}function bFormatForm(poForm){var loForm=(poForm!=null)?poForm:goForm;if(!loForm){return false;}var zoomin=function(){var loObj=event.srcElement;loObj.originalHeight=loObj.offsetHeight;loObj.style.height=loObj.offsetHeight*3;};var zoomout=function(){var loObj=event.srcElement;if(loObj.originalHeight!=null){loObj.style.height=loObj.originalHeight;}};var dspDate=function(){var loObj=event.srcElement;loObj.blur();DisplayDate(loObj);};var dspTime=function(){var loObj=event.srcElement;loObj.blur();var lsFormat=(loObj.format!=null&&loObj.format!="")?loObj.format:null;DisplayTime(loObj,lsFormat);};var loBrowser=new Browser();var lbSetLabelfor=(loBrowser.System==5.2&&loBrowser.Version==6&&typeof(loForm.MSOffice)=="object")?false:true;var loField,lsType,lsClass,loObj,loParent,loLabel,loPrev,loText,lsID,lsAllIDs=";",lsNullFields=";",lsNumberFields=";",lsDateFields=";",lsCharFields=";";for(var i=0;i<loForm.elements.length;i++){loField=loForm.elements[i];lsType=(loField.type!=null&&loField.type!="")?loField.type.toLowerCase():"";lsClass=(loField.className!=null&&loField.className!="")?loField.className.toLowerCase():"";if(loField.validNull=="1"){var loObj=sGetLabel(loField,true);if(loObj!=null&&loObj!=""){bSetLabel(loObj);}if(lsNullFields.indexOf(";"+loField.name+";")==-1){lsNullFields+=loField.name+";";}}if(loField.validNumber!=null&&loField.validNumber!=""){if(lsNumberFields.indexOf(";"+loField.name+";")==-1){lsNumberFields+=loField.name+";";}}if(loField.validDate=="1"){if(lsDateFields.indexOf(";"+loField.name+";")==-1){lsDateFields+=loField.name+";";}}if(loField.checkChars!=null&&loField.checkChars!=""){if(lsCharFields.indexOf(";"+loField.name+";")==-1){lsCharFields+=loField.name+";";}}if(loField.tagName=="INPUT"&&(lsType=="radio"||lsType=="checkbox")){if(lsClass!=lsType){loField.className=loField.type;}if(lbSetLabelfor!=true){continue;}if(loField.id!=null&&loField.id!=""){lsID=loField.id;}else{lsID="_"+loField.name+"_"+i;loField.id=lsID;}if(lsAllIDs.indexOf(";"+lsID+";")==-1){loText=loField.nextSibling;if(!$null(loText)&&!$null(loText.nodeValue)){loLabel=document.createElement("label");with(loLabel){loLabel.htmlFor=lsID;loLabel.innerText=loText.nodeValue;}loPrev=loLabel;loParent=loField.parentNode;loParent.replaceChild(loLabel,loText);}lsAllIDs+=lsID+";";}else{if(loPrev!=null){loPrev.outerHTML=loPrev.innerText;loPrev=null;}}}else{if(loField.tagName=="INPUT"&&lsType=="button"){if(lsClass==""||lsClass=="autosize"){loField.className="Control";}}else{if(lsClass=="date"){loField.attachEvent("onfocus",dspDate);}else{if(lsClass=="time"){loField.attachEvent("onfocus",dspTime);}else{if(lsClass=="zoom"){loField.attachEvent("onfocus",zoomin);loField.attachEvent("onblur",zoomout);}}}}}}if(lsNullFields!=";"){loForm.validNullFields=lsNullFields.substring(1,lsNullFields.length-1);}if(lsNumberFields!=";"){loForm.validNumberFields=lsNumberFields.substring(1,lsNumberFields.length-1);}if(lsDateFields!=";"){loForm.validDateFields=lsDateFields.substring(1,lsDateFields.length-1);}if(lsCharFields!=";"){loForm.validCharFields=lsCharFields.substring(1,lsCharFields.length-1);}var bRemoveUnLoad=function(){if(document.body.beforeunloadEditor){document.body.beforeunloadEditor.remove(0);}return true;};setFormSubmit(loForm,bValidForm);setFormSubmit(loForm,bRemoveUnLoad);return true;}function setFormSubmit(poForm,poFun){poForm.attachEvent("onsubmit",poFun);if(!poForm.submitEditor){poForm.submitEditor=new Array();}poForm.submitEditor[poForm.submitEditor.length]=poFun;if(!poForm.originalSubmit){poForm.originalSubmit=poForm.submit;poForm.submit=function(){if(this.submitEditor){for(var i=0;i<this.submitEditor.length;i++){if(this.submitEditor[i]()==false){return false;}}}if(this.disabledElements!=null){for(var i=0;i<this.disabledElements.length;i++){this.disabledElements[i].disabled=false;}}if(this.originalSubmit()==false){for(var i=0;i<this.disabledElements.length;i++){this.disabledElements[i].disabled=true;}return false;}};}}function bSetFieldEdit(psFieldNames){if(psFieldNames==null||psFieldNames==""||!goForm){return false;}if(goForm.disabledElements==null){goForm.disabledElements=new Array();}var lsEditFields=";"+psFieldNames+";";var lbDisabled=false,loObj,lsID;for(var i=0;i<goForm.elements.length;i++){if(goForm.elements[i].name!=""&&lsEditFields.indexOf(";"+goForm.elements[i].name+";")!=-1){continue;}lbDisabled=true;loObj=goForm.elements[i].parentElement;while(loObj!=null&&loObj.tagName!="FORM"){lsID="";if(loObj.id!=null&&loObj.id!=""){lsID=loObj.id;}else{if(loObj.name!=null&&loObj.name!=""){lsID=loObj.name;}}if(lsID!=""&&lsEditFields.indexOf(";"+lsID+";")!=-1){lbDisabled=false;break;}loObj=loObj.parentElement;}if(lbDisabled!=true){continue;}goForm.elements[i].disabled=true;goForm.elements[i].readOnly=true;goForm.disabledElements[goForm.disabledElements.length]=goForm.elements[i];}return true;}function bSetFieldRead(psFieldNames){if(psFieldNames==null||psFieldNames==""||!goForm){return false;}if(goForm.disabledElements==null){goForm.disabledElements=new Array();}var lsReadFields=";"+psFieldNames+";";var lbDisabled=false,loObj,lsID;for(var i=0;i<goForm.elements.length;i++){lbDisabled=false;if(goForm.elements[i].name!=""&&lsReadFields.indexOf(";"+goForm.elements[i].name+";")!=-1){lbDisabled=true;}else{loObj=goForm.elements[i].parentElement;while(loObj!=null&&loObj.tagName!="FORM"){lsID="";if(loObj.id!=null&&loObj.id!=""){lsID=loObj.id;}else{if(loObj.name!=null&&loObj.name!=""){lsID=loObj.name;}}if(lsID!=""&&lsReadFields.indexOf(";"+lsID+";")!=-1){lbDisabled=true;break;}loObj=loObj.parentElement;}}if(lbDisabled!=true){continue;}goForm.elements[i].disabled=true;goForm.elements[i].readOnly=true;goForm.disabledElements[goForm.disabledElements.length]=goForm.elements[i];}return true;}function bSetFieldHide(psFieldNames){if(psFieldNames==null||psFieldNames==""){return false;}var lvHideFields=psFieldNames.split(";");for(var i=0;i<lvHideFields.length;i++){var loFields=document.getElementsByName(lvHideFields[i]);if(loFields==null){continue;}if((typeof(loFields[0])=="object"&&typeof(loFields[0].type)!="undefined")&&(loFields[0].type=="radio"||loFields[0].type=="checkbox")){loFields[0].parentElement.style.display="none";}else{for(var j=0;j<loFields.length;j++){loFields[j].style.display="none";}}}return true;}function bSetWatermark(){document.oncontextmenu=Function("return false;");document.onselectstart=Function("return false;");var liBodySH=document.body.scrollHeight,liBodySW=document.body.scrollWidth;var liBodyOH=document.body.offsetHeight;var lsUser=gsCurUser;if(lsUser==null||lsUser==""){lsUser="wellsoft";}var lsHtml=' <table style="width:100%;height:100%;" class="BorderNone">';for(var i=0;i<liBodySH;i+=45){lsHtml+='<tr style="height:40px;">';for(var j=0;j<liBodySW;j+=100){lsHtml+="<td>"+lsUser+"</td>";}lsHtml+="</tr>";}lsHtml+="</table>";var loDiv=document.createElement("DIV");loDiv.className="watermark";loDiv.style.height=liBodySH>liBodyOH?liBodySH:liBodyOH;document.body.appendChild(loDiv);loDiv.innerHTML=lsHtml;var objs=$TagName(null,"TABLE");if(objs!=null){for(var i=0;i<objs.length;i++){objs[i].style.filter="alpha(opacity=70)";}}function controlKeyDown(){if(document.body.prevKeyCode==17&&event.keyCode==78){return false;}document.body.prevKeyCode=event.keyCode;}if(!document.body){return;}if(!document.body.keyDownEditor){document.body.keyDownEditor=new Array();}document.body.keyDownEditor[document.body.keyDownEditor.length]=controlKeyDown;if(!document.body.originalKeyDown){document.body.originalKeyDown=document.body.onkeydown;document.body.onkeydown=function(){if(document.body.keyDownEditor){for(var i=0;i<document.body.keyDownEditor.length;i++){if(document.body.keyDownEditor[i]()==false){return false;}}}if(document.body.originalKeyDown&&document.body.originalKeyDown()==false){return false;}};}}function bAttachFormModifyEvent(){if(typeof top.document!="object"||typeof top.document.all.ID_Form_MenuBar!="object"){return false;}if(typeof goForm!="object"){return false;}var changeFun=function(){if(this.originalChange!=null){this.originalChange();}top.FormModified=true;};var clickFun=function(){top.FormModified=true;};for(var i=0;i<goForm.elements.length;i++){if(goForm.elements[i].IsNotModify=="1"){continue;}if(goForm.elements[i].onchange){goForm.elements[i].originalChange=goForm.elements[i].onchange;}goForm.elements[i].onchange=changeFun;if(goForm.elements[i].onclick){goForm.elements[i].attachEvent("onclick",clickFun);}}for(var i=0;i<document.links.length;i++){if(document.links[i].offsetHeight>0&&document.links[i].IsNotModify!="1"){document.links[i].attachEvent("onclick",clickFun);}}return true;}function bAssistantInput(psFieldName,psValue,psCert,psDBPath,psUNID){var lsValue=psValue;if(lsValue==null){lsValue=eval("goForm."+psFieldName+".value");}var lsRange="";if(lsValue!=null&&lsValue!=""){lsRange="@Contains(@LowerCase(@Trim("+psFieldName+'));"'+lsValue.toLowerCase()+'")';}if(psCert!=null&&psCert!=""){lsRange=(lsRange=="")?psCert:lsRange+" & ("+psCert+")";}return bAssistantInputExt(lsRange,psFieldName,psDBPath,psUNID);}function bAssistantInputExt(psRangeFormula,psTitleFormula,psDBPath,psUNID,psInputRules,psTextRules,psHtmlRules){var lsDBPath=psDBPath;if(lsDBPath==null){lsDBPath=encodeURI(gsCurURL.substr(1)+gsCurDBName);}var lsURL=encodeURI(gsOAURL)+gsSRDBName+"/agtAssistantInput?openagent";var lsPara="<Root><Range>"+((psRangeFormula!=null)?escape(psRangeFormula):"")+"</Range><Title>"+((psTitleFormula!=null)?escape(psTitleFormula):"")+"</Title><DBPath>"+escape(lsDBPath)+"</DBPath><UNID>"+((psUNID!=null)?psUNID:"")+"</UNID>";var xmlhttp=oGetXmlHttpRequest();if(xmlhttp==null){return false;}xmlhttp.open("POST",lsURL+"&Temp="+Math.random(),false);xmlhttp.send(lsPara);var xmlDoc=xmlhttp.responseXML;if(null==xmlDoc||xmlDoc.xml==""){return false;}var loRoot=xmlDoc.firstChild;if(loRoot.getAttribute("type")=="document"){var laNode=xmlDoc.selectNodes("Root/Document");if(laNode==null||laNode.length==0){alert(sGetLang("P_DOCUMENTNOTFOUND"));xmlhttp=null;return false;}else{var laDocument=new Array();for(var i=0;i<laNode.length;i++){var lsText=laNode[i].firstChild.data;laDocument[laDocument.length]=lsText.substring(1,lsText.length-1);}laDocument.sort(function(a,b){return a.localeCompare(b);});var lsReturn=sSelectArray("Single",sGetLang("P_PROMPTDOCUMENTTITLE"),"",laDocument.join(";"));if(lsReturn!=null&&lsReturn!=""){lsPara="<Root><DBPath>"+escape(lsReturn.substring(0,lsReturn.indexOf("|")))+"</DBPath><UNID>"+lsReturn.substring(lsReturn.indexOf("|")+1,lsReturn.length)+"</UNID>";xmlhttp.open("POST",lsURL+"&Temp="+Math.random(),false);xmlhttp.send(lsPara);xmlDoc=xmlhttp.responseXML;if(null==xmlDoc||xmlDoc.xml==""){return false;}var loRoot=xmlDoc.firstChild;}}}xmlhttp=null;if(loRoot.getAttribute("type")=="item"){bFormInput(loRoot,document.forms[0],psInputRules,psTextRules,psHtmlRules);return true;}return false;}function bFormInput(poFrom,poTo,psInputRules,psTextRules,psHtmlRules){function sGetFieldValueByName(psName,poForm){var lsName=psName;if(lsName==null||lsName==""||lsName.indexOf("%")!=-1){return null;}if(poFrom.tagName.toLowerCase()=="root"){if(lsName.indexOf("$")!=-1){return null;}var node=poFrom.selectSingleNode(lsName.toLowerCase());if(node==null){return null;}var lsValue=node.text;}else{for(var j=0;j<poFrom.elements.length;j++){if(poFrom.elements[j].name.toLowerCase()==lsName.toLowerCase()){var lsValue=poFrom.elements[j].value;break;}}if(j>=poFrom.elements.length){return null;}}return lsValue;}var lsName,lsValue,lsValueString,lsRule="";if(psInputRules!=null&&psInputRules!=""){lsRule=";"+psInputRules+";";}else{if(typeof document.all.ID_InputRules=="object"&&document.all.ID_InputRules.innerText!=""){lsRule=";"+document.all.ID_InputRules.innerText+";";}}for(var i=0;i<poTo.elements.length;i++){lsName=poTo.elements[i].name;if(lsName==null){continue;}if(lsRule.indexOf(";"+lsName+"=")!=-1){lsName=lsRule.substring(lsRule.indexOf(";"+lsName+"=")+lsName.length+2,lsRule.length);lsName=lsName.substring(0,lsName.indexOf(";"));}else{if(lsRule!=""){continue;}}lsValue=sGetFieldValueByName(lsName,poFrom);if(lsValue==null){continue;}lsValueString=";"+lsValue+";";switch(poTo.elements[i].type){case"radio":if(lsValueString.indexOf(";"+poTo.elements[i].value+";")!=-1){poTo.elements[i].checked=true;}else{continue;}break;case"checkbox":if(lsValueString.indexOf(";"+poTo.elements[i].value+";")!=-1){poTo.elements[i].checked=true;}else{poTo.elements[i].checked=false;}break;case"select-one":case"select-multiple":for(var j=0;j<poTo.elements[i].options.length;j++){if(lsValueString.indexOf(";"+poTo.elements[i].options[j].value+";")!=-1||lsValueString.indexOf(";"+poTo.elements[i].options[j].text+";")!=-1){poTo.elements[i].options[j].selected=true;}else{poTo.elements[i].options[j].selected=false;}}break;case"hidden":case"text":case"textarea":poTo.elements[i].value=lsValue;break;}if(typeof poTo.elements[i].onclick=="function"){poTo.elements[i].onclick();}if(typeof poTo.elements[i].onchange=="function"){poTo.elements[i].onchange();}}var laField=null;if(psTextRules!=null&&psTextRules!=""){laField=psTextRules.split(";");}else{if(typeof document.all.ID_SetTextRules=="object"&&document.all.ID_SetTextRules.innerText!=""){laField=document.all.ID_SetTextRules.innerText.split(";");}}if(laField!=null){for(var i=0;i<laField.length;i++){var loObj=eval("document.all."+laField[i].substring(0,laField[i].indexOf("=")));if(typeof loObj=="object"){lsName=laField[i].substring(laField[i].indexOf("=")+1,laField[i].length);lsValue=sGetFieldValueByName(lsName,poFrom);if(lsValue==null){continue;}loObj.innerText=lsValue;if(typeof loObj.onclick=="function"){poTo.elements[i].onclick();}if(typeof loObj.onchange=="function"){poTo.elements[i].onchange();}}}}var laField=null;if(psHtmlRules!=null&&psHtmlRules!=""){laField=psHtmlRules.split(";");}else{if(typeof document.all.ID_SetHTMLRules=="object"&&document.all.ID_SetHTMLRules.innerText!=""){laField=document.all.ID_SetHTMLRules.innerText.split(";");}}if(laField!=null){for(var i=0;i<laField.length;i++){var loObj=eval("document.all."+laField[i].substring(0,laField[i].indexOf("=")));if(typeof loObj=="object"){lsName=laField[i].substring(laField[i].indexOf("=")+1,laField[i].length);lsValue=sGetFieldValueByName(lsName,poFrom);if(lsValue==null){continue;}loObj.innerHTML=lsValue;if(typeof loObj.onclick=="function"){poTo.elements[i].onclick();}if(typeof loObj.onchange=="function"){poTo.elements[i].onchange();}}}}return true;}function StatToField(poField){var loStatToField=this;this.ToField=poField;this.StatFields=new Array();this.StatMod;this.AddField=function(poInput){var lsToField=loStatToField.ToField.name;var lsStatField=poInput.StatField;if(typeof(lsStatField)=="undefined"||lsStatField==null||lsStatField==""){poInput.StatField=lsToField;poInput.onpropertychange=function(){var laName=this.StatField.split(";");for(var i=0;i<laName.length;i++){eval("goForm."+laName[i]+".StatToField.ToStat();");}};}else{if(lsStatField==lsToField||lsStatField.indexOf(";"+lsToField+";")!=-1||lsStatField.indexOf(lsToField+";")==0||lsStatField.lastIndexOf(";"+lsToField)!=-1&&lsStatField.lastIndexOf(";"+lsToField)==(lsStatField.length-lsToField.length-1)){return;}poInput.StatField+=";"+lsToField;}loStatToField.StatFields.push(poInput);};this.ToStat=function(){var loStat;switch(loStatToField.StatMod){case"multiply":loStat=1;break;case"concat":loStat="";break;case"sum":default:loStat=0;break;}var lbCheck=false;for(var i=0;i<loStatToField.StatFields.length;i++){var loValue=loStatToField.StatFields[i].value;switch(loStatToField.StatMod){case"concat":if(typeof(loValue)=="undefined"){loValue="";}if(loValue==""&&loStatToField.ToField.Trim!="0"){break;}var lbSeparator=(i==0||loStat==""&&loStatToField.ToField.Trim!="0"||typeof(loStatToField.ToField.Separator)=="undefined")?false:true;loStat+=(lbSeparator?loStatToField.ToField.Separator:"")+loValue;break;case"multiply":if(typeof(loValue)=="undefined"||loValue.trim()==""||isNaN(loValue.trim())){loValue=1;}else{lbCheck=true;}loStat*=Number(loValue);break;case"sum":default:if(typeof(loValue)=="undefined"||loValue.trim()==""||isNaN(loValue.trim())){loValue=0;}else{lbCheck=true;}loStat+=Number(loValue);break;}}if(loStatToField.StatMod!="concat"){if(lbCheck){loStatToField.ToField.value=loStat;}else{loStatToField.ToField.value="";}}else{loStatToField.ToField.value=loStat;}};this.Init=function(){loStatToField.StatMod=(typeof(poField.StatMod)=="undefined"||poField.StatMod==null)?"Sum":poField.StatMod;poField.StatToField=loStatToField;var laName=loStatToField.ToField.StatFields.split(";");for(var i=0;i<laName.length;i++){var laInput=document.getElementsByName(laName[i].trim());for(var j=0;j<laInput.length;j++){loStatToField.AddField(laInput[j]);}}};this.Init();}function bInitStatToField(){var laInput=document.getElementsByTagName("INPUT");for(var i=0;i<laInput.length;i++){if(laInput[i].type!="text"){continue;}if(typeof(laInput[i].StatFields)=="undefined"||laInput[i].StatFields==null||laInput[i].StatFields==""){continue;}new StatToField(laInput[i]);}}function CList(){var lvArguments=CList.arguments;if(lvArguments.length<3){return false;}this.oShowList=goForm.elements[lvArguments[0]];this.oTextObject=goForm.elements[lvArguments[1]];this.oValueObject=goForm.elements[lvArguments[2]];this.bOneness=(lvArguments.length>3)?lvArguments[3]:false;this.iPosition=-1;this.sCurValue="";this.sCurText="";if(typeof this.sLink=="undefined"){this.sLink=";";}this.bInsertValue=bInsertValue;this.bGetCurPos=bGetCurPos;this.bInitList=bInitList;this.bOneValidate=bOneValidate;this.bSetSelect=bSetSelect;this.bAddField=bAddField;this.bInsertField=bInsertField;this.bDelField=bDelField;this.bModifyField=bModifyField;this.bClearList=bClearList;this.bInitList();function bOneValidate(){var laValue=this.aBuildValue();if(laValue==null){return false;}var laExist=this.oValueObject.value.split(";");for(i=0;i<laExist.length;i++){if(laExist[i]==laValue.value){alert(sGetLang("P_ITEMISEXIST"));return false;}}return true;}function bSetSelect(piIndex){for(var i=0;i<this.oShowList.options.length;i++){if(i==piIndex){this.oShowList.options[i].selected=true;}else{this.oShowList.options[i].selected=false;}}return true;}function bInitList(){this.bClearList();if(this.oTextObject.value==""||this.oValueObject.value==""){return false;}var laValue=new Array();var laText=new Array();laValue=this.oValueObject.value.split(this.sLink);laText=this.oTextObject.value.split(this.sLink);for(i=0;i<laValue.length;i++){this.oShowList.options[i]=new Option("","");this.oShowList.options[i].text=laText[i];this.oShowList.options[i].value=laValue[i];}}function bClearList(){if(gbIsEdit&&(typeof this.oShowList=="object")){for(i=0;i<this.oShowList.options.length;i++){if(this.oShowList.options[i].text==""&&this.oShowList.options[i].value==""){this.oShowList.options[i]=null;}}return true;}else{return false;}}function bAddField(){if(this.bOneness&&!this.bOneValidate()){return false;}var laValue=this.aBuildValue();if(laValue==null){return false;}this.iPosition=this.oShowList.options.length;this.bInsertValue(laValue.value,laValue.text);this.bSetSelect(this.oShowList.options.length-1);return true;}function bInsertField(){if(!this.bGetCurPos()){return false;}if(this.bOneness&&!this.bOneValidate()){return false;}var laValue=this.aBuildValue();if(laValue==null){return false;}this.bInsertValue(laValue.value,laValue.text);return true;}function bDelField(){if(!this.bGetCurPos()){return false;}var laValue=this.oValueObject.value.split(this.sLink);var laText=this.oTextObject.value.split(this.sLink);laValue.splice(this.iPosition,1);laText.splice(this.iPosition,1);this.oValueObject.value=laValue.join(this.sLink);this.oTextObject.value=laText.join(this.sLink);this.oShowList.options[this.iPosition]=null;if(this.oShowList.options.length!=0){if(this.iPosition<this.oShowList.options.length){this.bSetSelect(this.iPosition);}else{this.bSetSelect(this.oShowList.options.length-1);}}return true;}function bModifyField(){if(!this.bGetCurPos()){return false;}if(this.bOneness&&!this.bOneValidate()){return false;}var laValue=this.aBuildValue();if(laValue==null){return false;}var liPos=this.iPosition;this.bDelField();this.iPosition=liPos;this.bInsertValue(laValue.value,laValue.text);this.bSetSelect(liPos);return true;}function bInsertValue(psValue,psText){if(this.oValueObject.value==""){this.oValueObject.value=psValue;this.oTextObject.value=psText;}else{var laValue=this.oValueObject.value.split(this.sLink);var laText=this.oTextObject.value.split(this.sLink);laValue.insert(this.iPosition,psValue);laText.insert(this.iPosition,psText);this.oValueObject.value=laValue.join(this.sLink);this.oTextObject.value=laText.join(this.sLink);}var liLength=this.oShowList.options.length;this.oShowList.options[liLength]=new Option("","");for(i=liLength;i>this.iPosition;i--){this.oShowList.options[i].text=this.oShowList.options[i-1].text;this.oShowList.options[i].value=this.oShowList.options[i-1].value;}this.oShowList.options[i].text=psText;this.oShowList.options[i].value=psValue;return true;}function bGetCurPos(){this.iPosition=this.oShowList.options.selectedIndex;if(this.iPosition==-1){alert(sGetLang("P_NORECORDSEL"));return false;}this.sCurValue=this.oShowList.options[this.oShowList.options.selectedIndex].value;this.sCurText=this.oShowList.options[this.oShowList.options.selectedIndex].text;return true;}}function bSortEntry(poField,pbUp){var lsTemp;if(poField.length==0){return false;}if(poField.selectedIndex==-1){return false;}if(pbUp==true){for(var i=0;i<poField.options.length;i++){if(poField.options[i].selected==false){continue;}if(i==0){continue;}lsTemp=poField.options[i].text;poField.options[i].text=poField.options[i-1].text;poField.options[i-1].text=lsTemp;lsTemp=poField.options[i].value;poField.options[i].value=poField.options[i-1].value;poField.options[i-1].value=lsTemp;poField.options[i-1].selected=true;poField.options[i].selected=false;}}else{for(var i=poField.options.length-1;i>=0;i--){if(poField.options[i].selected==false){continue;}if(i==poField.options.length-1){continue;}lsTemp=poField.options[i].text;poField.options[i].text=poField.options[i+1].text;poField.options[i+1].text=lsTemp;lsTemp=poField.options[i].value;poField.options[i].value=poField.options[i+1].value;poField.options[i+1].value=lsTemp;poField.options[i+1].selected=true;poField.options[i].selected=false;}}}function bMoveEntry(poFromField,poToField){var liLength=0,lsText,lsValue;var loFrom=poFromField;var loTo=poToField;if(loFrom.length==0){return false;}if(loFrom.selectedIndex==-1){return false;}if(loTo!=null){liLength=loTo.options.length;for(var i=0;i<loFrom.options.length;i++){if(loFrom.options[i].selected==false){continue;}lsText=loFrom.options[i].text;lsValue=loFrom.options[i].value;if(lsValue=="00000"||lsValue==""){continue;}var loEntry=new Option(lsText,lsValue);if(1==loTo.options.length&&loTo.options[0].text==""){loTo.options[0]=loEntry;}else{loTo.options[liLength]=loEntry;liLength++;}}}var liIndex=-1;for(var i=loFrom.options.length-1;i>=0;i--){if(loFrom.options[i].selected==false){continue;}if(loFrom.options[i].value=="00000"||loFrom.options[i].value==""){continue;}loFrom.options[i]=null;liIndex=i;}if(liIndex>-1&&liIndex<loFrom.options.length){loFrom.options[liIndex].selected=true;}else{if(loFrom.options.length>0){loFrom.options[loFrom.options.length-1].selected=true;}}}function bAddEntry(poField,psText,psValue,pbNoSelect){if(poField==null||psText==null||psValue==null){return false;}var loEntry=new Option(psText,psValue);if(1==poField.options.length&&poField.options[0].text==""){poField.options[0]=loEntry;}else{poField.options[poField.options.length]=loEntry;}if(pbNoSelect!=true){poField.selectedIndex=poField.options.length-1;}return true;}function bInsertEntry(poField,psText,psValue){if(poField==null||psText==null||psValue==null){return false;}if(poField.selectedIndex==-1){return bAddEntry(poField,psText,psValue);}var liLength=poField.options.length;var liIndex=poField.selectedIndex;poField.options[liLength]=new Option("","");for(var i=liLength;i>liIndex;i--){poField.options[i].text=poField.options[i-1].text;poField.options[i].value=poField.options[i-1].value;}poField.options[i].text=psText;poField.options[i].value=psValue;return true;}function bEditEntry(poField,psText,psValue){if(poField==null||psText==null||psValue==null){return false;}if(poField.length==0){return false;}if(poField.selectedIndex==-1){return false;}var loEntry=new Option(psText,psValue);var liIndex=poField.selectedIndex;poField.options[liIndex].text=psText;poField.options[liIndex].value=psValue;poField.selectedIndex=liIndex;return true;}function sGetAllEntryText(poField,pbSelect,psSeparator,pbContainValue){var lsReturn="",lsValue;var lsSeparator=(psSeparator!=null&&psSeparator!="")?psSeparator:";";for(var i=0;i<poField.options.length;i++){if(poField.options[i].text==""){continue;}if(pbSelect==true&&poField.options[i].selected==false){continue;}lsValue=poField.options[i].text;if(pbContainValue==true){lsValue+="|"+poField.options[i].value;}if(lsReturn==""){lsReturn=lsValue;}else{lsReturn+=lsSeparator+lsValue;}}return lsReturn;}function sGetAllEntryValue(poField,pbSelect,psSeparator){var lsReturn="";var lsSeparator=(psSeparator!=null&&psSeparator!="")?psSeparator:";";for(var i=0;i<poField.options.length;i++){if(poField.options[i].value==""){continue;}if(pbSelect==true&&poField.options[i].selected==false){continue;}if(lsReturn==""){lsReturn=poField.options[i].value;}else{lsReturn+=lsSeparator+poField.options[i].value;}}return lsReturn;}function bCheckObject(psObjectName,psValue,pbChecked){for(var i=0;i<goForm.elements.length;i++){if(goForm.elements[i].name!=psObjectName){continue;}switch(goForm.elements[i].type){case"checkbox":case"radio":if(goForm.elements[i].value!=psValue){continue;}goForm.elements[i].checked=pbChecked;break;case"select-one":case"select-multiple":for(j=0;j<goForm.elements[i].options.length;j++){if(goForm.elements[i].options[j].value==psValue||goForm.elements[i].options[j].text==psValue){goForm.elements[i].options[j].selected=pbChecked;}}break;default:break;}}}function vSelectCheckBox(psObjectName){var raValue=new Array();j=0;for(var i=0;i<goForm.elements.length;i++){if(goForm.elements[i].type!="checkbox"&&goForm.elements[i].type!="radio"){continue;}if(goForm.elements[i].name!=psObjectName){continue;}if(goForm.elements[i].checked!=true){continue;}raValue[j++]=goForm.elements[i].value;}return raValue;}function vSelectCombox(psObjectName){var raValue=new Array();raValue.SelID="";raValue.SelValue="";for(var i=0;i<goForm.elements[psObjectName].options.length;i++){if(goForm.elements[psObjectName].options[i].selected){raValue.SelID=goForm.elements[psObjectName].options[i].text;raValue.SelValue=goForm.elements[psObjectName].options[i].value;}}return raValue;}function oExcelToXML(psStartRow,psCols){var lsFileName=goForm.UploadControl.SelectFiles(false,"xls");if(lsFileName!=""){if(!UploadLocalFile(lsFileName,null,false)){return false;}var lsName=lsFileName.substr(lsFileName.lastIndexOf("\\")+1);var xmlhttp=oGetXmlHttpRequest();if(xmlhttp!=null){var lsURL=encodeURI(gsOAURL)+gsSRDBName+"/agtExcelXMLConvert?openagent&FileName="+encodeURIComponent(lsName)+"&eCol="+encodeURIComponent(psCols)+"&StartRow="+encodeURIComponent(psStartRow);lsURL+="&t="+((new Date()).valueOf());xmlhttp.open("GET",lsURL,false);xmlhttp.send("");}goForm.s_AddList.value=sReplaceSubstring("|"+goForm.s_AddList.value+"|","|"+lsName+"|","|");if(goForm.s_AddList.value.trim()=="|"||goForm.s_AddList.value.trim()==""){goForm.s_AddList.value="";}else{goForm.s_AddList.value=goForm.s_AddList.value.substr(1,goForm.s_AddList.value.lastIndexOf("|"));}return xmlhttp.responseXML;}return null;}function bXMLToExcel(psXML,psTemplate,psExportRule){if(psXML.trim()==""){return false;}var lsURL=gsCurURL+gsSRDBName+"/frmAutoClose?openForm";window.Action="XMLToExcel";window.PowerListValue=psXML;window.ExcelExportRule=psExportRule;window.argVal=psTemplate;top.RunAgent.location.replace(lsURL);}function bValidForm(poForm){var loForm=(poForm!=null)?poForm:goForm;if(!loForm){return true;}if(loForm.validNullFields!=null&&bValidNull(loForm.validNullFields,false)==false){HideDoing();return false;}if(loForm.validCharFields!=null&&bValidChar(loForm.validCharFields,false)==false){HideDoing();return false;}if(loForm.validNumberFields!=null&&bValidNumber(loForm.validNumberFields,false)==false){HideDoing();return false;}if(loForm.validDateFields!=null&&bValidDate(loForm.validDateFields,false)==false){HideDoing();return false;}return true;}function bValidNull(psFields,pbNoPrompt){if(psFields==null||psFields==""){return true;}if(psFields.indexOf(";")!=-1){var lsSeparator=";";}else{if(psFields.indexOf(",")!=-1){var lsSeparator=",";}}var lvFields=psFields.split(lsSeparator);for(i=0;i<lvFields.length;i++){try{var loField=eval("document.all."+lvFields[i]);if(typeof(loField)=="object"){if(typeof(loField.type)=="undefined"&&typeof(loField.length)!="undefined"){var lbDisplay=false;for(var n=0;n<loField.length;n++){if(loField[n].offsetWidth!=null&&loField[n].offsetWidth>0||loField[n].checkHidden=="1"){lbDisplay=true;}if(loField[n].checked==true){break;}}if(n>=loField.length&&lbDisplay==true){if(pbNoPrompt!=null){gsErrorMsg+="\n"+(++giErrorCount)+"."+sGetLang("P_SELECTVALUE",sGetLabel(lvFields[i]));if(goErrorObj==null){goErrorObj=loField[0];}}else{alert(sGetLang("P_SELECTVALUE",sGetLabel(lvFields[i])));if(loField[0].offsetWidth>0){loField[0].focus();}return false;}}}else{if(!(loField.offsetWidth!=null&&loField.offsetWidth>0||loField.checkHidden=="1")){continue;}if(loField.value.trim()==""){if(pbNoPrompt!=null){gsErrorMsg+="\n"+(++giErrorCount)+"."+sGetLang("P_INPUTVALUE",sGetLabel(lvFields[i]));if(goErrorObj==null){goErrorObj=loField;}}else{alert(sGetLang("P_INPUTVALUE",sGetLabel(lvFields[i])));if(loField.offsetWidth>0){loField.focus();}return false;}}}}}catch(e){alert(sGetLang("P_INVALIDOBJECT",lvFields[i]));}}if(pbNoPrompt==false&&gsErrorMsg!=""){alert(gsErrorMsg);if(goErrorObj.offsetWidth>0){goErrorObj.select();}gsErrorMsg="";goErrorObj=null;giErrorCount=0;return false;}return true;}function bValidChar(psFields,pbNoPrompt){if(psFields==null||psFields==""){return true;}if(psFields.indexOf(";")!=-1){var lsSeparator=";";}else{if(psFields.indexOf(",")!=-1){var lsSeparator=",";}}var lvFields=psFields.split(lsSeparator);for(i=0;i<lvFields.length;i++){try{var loField=eval("document.all."+lvFields[i]);if(typeof(loField)=="object"){if(loField.value==""){continue;}if(!(loField.offsetWidth!=null&&loField.offsetWidth>0||loField.checkHidden=="1")){continue;}if(loField.checkChars==null||loField.checkChars==""){continue;}var lsReg="";for(var j=0;j<loField.checkChars.length;j++){lsReg+="\\"+loField.checkChars.charAt(j);}lsReg="/["+lsReg+"]+/g";if(loField.value.match(eval(lsReg))!=null){if(pbNoPrompt==true){gsErrorMsg+="\n"+(++giErrorCount)+"."+sGetLang("P_INVALIDCHAR",sGetLabel(lvFields[i]),loField.checkChars);if(goErrorObj==null){goErrorObj=loField;}}else{alert(sGetLang("P_INVALIDCHAR",sGetLabel(lvFields[i]),loField.checkChars));if(loField.offsetWidth>0){loField.focus();}return false;}}}}catch(e){alert(sGetLang("P_INVALIDOBJECT",lvFields[i]));}}return true;}function bValidNumber(psFields,pbNoPrompt,piType){if(psFields==null||psFields==""){return true;}var lsSeparator;if(psFields.indexOf(";")!=-1){lsSeparator=";";}else{if(psFields.indexOf(",")!=-1){lsSeparator=",";}}var lvFields=psFields.split(lsSeparator);for(i=0;i<lvFields.length;i++){try{var loField=eval("document.all."+lvFields[i]);if(typeof(loField)=="object"){if(loField.value==""){continue;}if(!(loField.offsetWidth!=null&&loField.offsetWidth>0||loField.checkHidden=="1")){continue;}var liType;if(!$null(piType)){liType=piType;}else{liType=(loField.validNumber!=null&&loField.validNumber!="")?parseInt(loField.validNumber,10):3;}if(pbNoPrompt==true){if(bIsDigital(loField.value,liType,"")==false){gsErrorMsg+="\n"+(++giErrorCount)+"."+sGetLang("P_INVALIDVALUE",sGetLabel(lvFields[i]));if(goErrorObj==null){goErrorObj=loField;}}}else{if(bIsDigital(loField.value,liType,sGetLang("P_INVALIDVALUE",sGetLabel(lvFields[i])))==false){if(loField.offsetWidth>0){loField.focus();}return false;}}}}catch(e){alert(sGetLang("P_INVALIDOBJECT",lvFields[i]));}}return true;}function bValidDate(psFields,pbNoPrompt){if(psFields==null||psFields==""){return true;}if(psFields.indexOf(";")!=-1){var lsSeparator=";";}else{if(psFields.indexOf(",")!=-1){var lsSeparator=",";}}var lvFields=psFields.split(lsSeparator);for(i=0;i<lvFields.length;i++){try{var loField=eval("document.all."+lvFields[i]);if(typeof(loField)=="object"){if(loField.value==""){continue;}if(!(loField.offsetWidth!=null&&loField.offsetWidth>0||loField.checkHidden=="1")){continue;}if(bDateTimeValid(loField.value,1)==false&&bDateTimeValid(loField.value,2)==false&&bDateTimeValid(loField.value,3)==false){if(pbNoPrompt==true){gsErrorMsg+="\n"+(++giErrorCount)+"."+sGetLang("P_INVALIDVALUE",sGetLabel(lvFields[i]));if(goErrorObj==null){goErrorObj=loField;}}else{alert(sGetLang("P_INVALIDVALUE",sGetLabel(lvFields[i])));if(loField.offsetWidth>0){loField.focus();}return false;}}}}catch(e){alert(sGetLang("P_INVALIDOBJECT",lvFields[i]));}}return true;}function bValidCompare(psFields,pbNoPrompt){if(psFields==null||psFields==""){return true;}if(psFields.indexOf(";")!=-1){var lsSeparator=";";}else{if(psFields.indexOf(",")!=-1){var lsSeparator=",";}}var lvFields=psFields.split(lsSeparator);for(i=0;i<lvFields.length;i++){var laRet=vSplitMatch(lvFields[i]);if(laRet!=null){var lsLeftLabel=laRet[1];try{var loLeft=eval("document.all."+laRet[1]);if(typeof(loLeft)=="object"){var lsLeft="document.all."+laRet[1]+".value";var lsLeftLabel=sGetLabel(laRet[1]);}}catch(e){var lsLeft=laRet[1];}var lsRightLabel=laRet[3];try{var loRight=eval("document.all."+laRet[3]);if(typeof(loRight)=="object"){var lsRight="document.all."+laRet[3]+".value";var lsRightLabel=sGetLabel(laRet[3]);}}catch(e){var lsRight=laRet[3];}try{if(eval(lsLeft+laRet[2]+lsRight)==false){if(pbNoPrompt==true){gsErrorMsg+="\n"+(++giErrorCount)+"."+sGetLang("P_INVALIDCOMPARE",lsLeftLabel+laRet[2]+lsRightLabel);}if(pbNoPrompt!=true){alert(sGetLang("P_INVALIDCOMPARE",lsLeftLabel+laRet[2]+lsRightLabel));}if(typeof(loLeft)=="object"){if(pbNoPrompt==true&&goErrorObj==null){goErrorObj=loLeft;}if(pbNoPrompt!=true&&loLeft.offsetWidth>0){loLeft.focus();}}else{if(typeof(loRight)=="object"){if(pbNoPrompt==true&&goErrorObj==null){goErrorObj=loRight;}if(pbNoPrompt!=true&&loRight.offsetWidth>0){loRight.focus();}}}if(pbNoPrompt!=true){return false;}}}catch(e){if(pbNoPrompt==true){gsErrorMsg+="\n"+(++giErrorCount)+"."+sGetLang("P_INVALIDCOMPARE",lsLeftLabel+laRet[2]+lsRightLabel);}if(pbNoPrompt!=true){alert(sGetLang("P_INVALIDCOMPARE",lsLeftLabel+laRet[2]+lsRightLabel));}if(typeof(loLeft)=="object"){if(pbNoPrompt==true&&goErrorObj==null){goErrorObj=loLeft;}if(pbNoPrompt!=true&&loLeft.offsetWidth>0){loLeft.focus();}}else{if(typeof(loRight)=="object"){if(pbNoPrompt==true&&goErrorObj==null){goErrorObj=loRight;}if(pbNoPrompt!=true&&loRight.offsetWidth>0){loRight.focus();}}}if(pbNoPrompt!=true){return false;}}}}return true;}function bValidServerSession(pbAutoLogin,psPromptMsg){var xmlhttp=oGetXmlHttpRequest();if(xmlhttp==null){return true;}var lsURL=encodeURI(gsOAURL)+sGetLang("DB_NAME_INDEX")+"/TestSession?open&temp="+Math.random();xmlhttp.open("GET",lsURL,false);xmlhttp.send();var lsText=xmlhttp.responseText;if(lsText!=null&&lsText.indexOf("<VALID>1</VALID>")!=-1){return true;}else{if(pbAutoLogin==true){lsURL="/servlet/AutoLogin?open&u=<autologin>";xmlhttp.open("GET",lsURL,false);xmlhttp.send();var lsText=xmlhttp.responseText;if(lsText!=null&&lsText.indexOf("<VALID>1</VALID>")!=-1){return true;}}}if(psPromptMsg==null){psPromptMsg=sGetLang("P_CONST_SERVERSESSIONISEXPIRED");}alert(psPromptMsg);return false;}function bIsDigital(){var laArg=bIsDigital.arguments;if(laArg.length<1){return false;}var lsValue=laArg[0];var liType=(laArg.length>1)?laArg[1]:3;var lsPrompt=(laArg.length>2)?laArg[2]:sGetLang("P_NOTDIGITAL");if(lsValue+""==""){if(lsPrompt!=""){alert(lsPrompt);}return false;}var regInteger=/^[+-]?(0|([1-9]\d*))$/;var regDecimal=/^[+-]?(0|([1-9]\d*))\.\d+$/;var regDigital=/^[+-]?(((0|([1-9]\d*)))|((0|([1-9]\d*))\.\d+))$/;var regIntegerP=/^[+]?[1-9]\d*$/;var regIntegerN=/^\-[1-9]\d*$/;var regDecimalP=/^[+]?(([1-9]\d*\.\d+)|(0\.\d*[1-9]\d*))$/;var regDecimalN=/^\-(([1-9]\d*\.\d+)|(0\.\d*[1-9]\d*))$/;var regDigitalP=/^[+]?(([1-9]\d*)|([1-9]\d*\.\d+)|(0\.\d*[1-9]\d*))$/;var regDigitalN=/^\-(([1-9]\d*)|([1-9]\d*\.\d+)|(0\.\d*[1-9]\d*))$/;var regIntegerNN=/^(([+-]?0)|([+]?[1-9]\d*))$/;var regIntegerNP=/^(([+-]?0)|(\-[1-9]\d*))$/;var regDecimalNN=/^(([+]?(([1-9]\d*\.\d+)|(0\.\d+)))|([+-]?0\.[0]+))$/;var regDecimalNP=/^((\-(([1-9]\d*\.\d+)|(0\.\d+)))|([+-]?0\.[0]+))$/;var regDigitalNN=/^(([+-]?0)|([+]?[1-9]\d*)|([+]?(0|([1-9]\d*))\.\d+)|([+-]?0\.[0]+))$/;var regDigitalNP=/^(([+-]?0)|(\-[1-9]\d*)|(\-(0|([1-9]\d*))\.\d+)|([+-]?0\.[0]+))$/;var lbCheck=true;if(liType==1&&lsValue.match(regInteger)==null){lbCheck=false;}else{if(liType==2&&lsValue.match(regDecimal)==null){lbCheck=false;}else{if(liType==3&&lsValue.match(regDigital)==null){lbCheck=false;}else{if(liType==4&&lsValue.match(regIntegerP)==null){lbCheck=false;}else{if(liType==-4&&lsValue.match(regIntegerN)==null){lbCheck=false;}else{if(liType==5&&lsValue.match(regDecimalP)==null){lbCheck=false;}else{if(liType==-5&&lsValue.match(regDecimalN)==null){lbCheck=false;}else{if(liType==6&&lsValue.match(regDigitalP)==null){lbCheck=false;}else{if(liType==-6&&lsValue.match(regDigitalN)==null){lbCheck=false;}else{if(liType==7&&lsValue.match(regIntegerNN)==null){lbCheck=false;}else{if(liType==-7&&lsValue.match(regIntegerNP)==null){lbCheck=false;}else{if(liType==8&&lsValue.match(regDecimalNN)==null){lbCheck=false;}else{if(liType==-8&&lsValue.match(regDecimalNP)==null){lbCheck=false;}else{if(liType==9&&lsValue.match(regDigitalNN)==null){lbCheck=false;}else{if(liType==-9&&lsValue.match(regDigitalNP)==null){lbCheck=false;}}}}}}}}}}}}}}}if(!lbCheck&&lsPrompt!=""){alert(lsPrompt);}return lbCheck;}function bDateTimeValid(){if(bDateTimeValid.arguments.length<1){return false;}var lsDateTime=bDateTimeValid.arguments[0];var liType=(bDateTimeValid.arguments.length>1)?bDateTimeValid.arguments[1]:1;var regDate=/^(\d{1,4})[-/](\d{1,2})[-/](\d{1,2})$/;var regTime=/^(\d{1,2}):(\d{1,2})$/;var regDateTime=/^(\d{1,4})[-/](\d{1,2})[-/](\d{1,2}) (\d{1,2}):(\d{1,2})$/;var d;if(liType==1){var r=lsDateTime.match(regDate);if(r==null){return false;}else{d=new Date(r[1],--r[2],r[3]);if(d.getFullYear()!=r[1]||d.getMonth()!=r[2]||d.getDate()!=r[3]){return false;}}}else{if(liType==2){var r=lsDateTime.match(regTime);if(r==null){return false;}if(r[1]>23||r[1]<0||r[2]>59||r[2]<0){return false;}}else{if(liType==3){var r=lsDateTime.match(regDateTime);if(r==null){return false;}else{d=new Date(r[1],--r[2],r[3],r[4],r[5]);if(d.getFullYear()!=r[1]||d.getMonth()!=r[2]||d.getDate()!=r[3]||d.getHours()!=r[4]||d.getMinutes()!=r[5]){return false;}}}}}return true;}function bCheckUnique(psFieldName,psValue,psCert,psDBPath,psUNID,pbNotPrompt){var lsDBPath=psDBPath;if(lsDBPath==null){lsDBPath=encodeURI(gsCurURL.substr(1)+gsCurDBName);}var lsUNID=psUNID;if(lsUNID==null){lsUNID=gsCurUNID;}var lsValue=psValue;if(lsValue==null){lsValue=eval("goForm."+psFieldName+".value");}if(lsValue.trim()==""){return false;}var lsURL=encodeURI(gsOAURL)+gsSRDBName+"/agtCheckUnique?openagent&DB="+lsDBPath+"&UNID="+lsUNID+"&Name="+psFieldName+"&Value="+encodeURIComponent(lsValue);lsURL+="&Temp="+Math.random();if(psCert!=null&&psCert!=""){lsURL+="&Cert="+encodeURIComponent(psCert);}var xmlhttp=oGetXmlHttpRequest();if(xmlhttp==null){return false;}xmlhttp.open("GET",lsURL,false);xmlhttp.send();var lsText=xmlhttp.responseText;var lbReturn=false;if(lsText.indexOf("<UNIQUE>")!=-1&&lsText.indexOf("</UNIQUE>")!=-1&&lsText.substring(lsText.indexOf("<UNIQUE>")+8,lsText.indexOf("</UNIQUE>"))=="1"){lbReturn=true;}if(pbNotPrompt!=true){if(lbReturn==true){alert(sGetLang("P_CHECK_ISUNIQUE"));}else{alert(sGetLang("P_CHECK_ISNOTUNIQUE"));}}return lbReturn;}function bGetFormModified(){if(top.FormModified==true){return true;}if(bAttachmentsModified()==true){return true;}if(bWordBodyModified()==true){return true;}if(bWebSignatureModified()==true){return true;}if(goForm&&goForm.EditorModified&&goForm.EditorModified()==true){return true;}if(typeof gaPowerList=="object"){for(var i=0;i<gaPowerList.length;i++){if(gaPowerList[i].GetModified()){return true;}}}return false;}function bSetFormModified(pbModified){top.FormModified=pbModified;return true;}function bAttachmentsModified(){if(typeof goAttachManager!="undefined"){return goAttachManager.IsModified();}return false;}function UploadFiles(poUploadControl){if(bValidServerSession(true)==false){return false;}for(var i=0;i<goForm.elements.length;i++){if(typeof(goForm.elements[i].type)=="string"&&goForm.elements[i].type.toLowerCase()=="file"&&goForm.elements[i].value!=""){poUploadControl.DelAll();lsAddList=goForm.elements[i].value.substr(goForm.elements[i].value.lastIndexOf("\\")+1);if(iGetStringByte(lsAddList)>128){alert(sGetLang("P_CONST_FILENAMETOOLONG"));return false;}poUploadControl.AddLocalFile(goForm.elements[i].value);}}if(typeof goAttachManager!="undefined"){if(!goAttachManager.UploadAttachment()){return false;}}return true;}function UploadLocalFile(psFilePath,poUploadControl,pbCallForRTF,psRTFName){var loUploadControl=(poUploadControl==null)?goForm.UploadControl:poUploadControl;if((typeof(loUploadControl)!="object")||(gbIsEdit==false)){return false;}var lsFileName=psFilePath.substr(psFilePath.lastIndexOf("\\")+1);if(iGetStringByte(lsFileName)>128){alert(sGetLang("P_CONST_FILENAMETOOLONG"));return false;}if(pbCallForRTF==true&&goForm.s_RTFFiles){var lsName=(psRTFName!=null)?psRTFName+":"+lsFileName:lsFileName;if(goForm.s_RTFFiles.value==""){goForm.s_RTFFiles.value=lsName;}else{goForm.s_RTFFiles.value+="|"+lsName;}}if(!loUploadControl.UploadFile2(psFilePath)){return false;}if(goForm.s_AddList){if(goForm.s_AddList.value==""){goForm.s_AddList.value=lsFileName;}else{goForm.s_AddList.value+="|"+lsFileName;}}return true;}function AttachRunFunc(psName,psFunc){var lsFunc=(psFunc.lastIndexOf(")")!=(psFunc.length-1))?psFunc+"()":psFunc;var lsFunction="var loAttachList = goAttachManager.CreateAttachList('"+psName+"');loAttachList."+lsFunc+";";eval(lsFunction);}function AttachManager(psAttachList,poUploadControl){var loUploadControl=(poUploadControl!=null)?poUploadControl:goForm.UploadControl;var lsAttachList=(psAttachList!=null)?psAttachList:((window.ID_SpanAttachList==null)?"":window.ID_SpanAttachList.innerText);var lsSplit=":";var gaAttachList=new Array();this.RIGHT_SHOW="ShowAttach";this.RIGHT_ADD="AddAttach";this.RIGHT_DEL="DelAttach";this.RIGHT_SAVE="SaveAttach";this.RIGHT_EDIT="EditAttach";this.RIGHT_HIDE="HideAttach";this.CreateAttachList=function(psName,piType,psRights){var lsName=(psName==null)?"":psName;var liType=(piType==null)?0:piType;var lsRights=(psRights==null)?"":psRights;var loAttachList=GetAttachList(lsName);if(null==loAttachList){if(lsAttachList!=""){var laAttachList=lsAttachList.split(lsSplit);for(var i=0;i<laAttachList.length;i++){if(laAttachList[i].indexOf(lsName+"|")==0){lsName=laAttachList[i];break;}}}if(liType==0){var loAttachList=new AttachmentView(lsName,lsRights);}else{var loAttachList=new AttachmentList(lsName,lsRights);}gaAttachList.push(loAttachList);}return loAttachList;};this.initAttachList=function(){var loSpanList=document.getElementsByName("_SPANATTACH");for(var i=0;i<loSpanList.length;i++){this.CreateAttachList(loSpanList[i].name,0,loSpanList[i].Rights);}if(lsAttachList!=""){var laAttachList=lsAttachList.split(lsSplit);for(var i=0;i<laAttachList.length;i++){this.CreateAttachList(laAttachList[i],1);}}};this.AddAttachment=function(psName,psFileName){var loAttachList=this.CreateAttachList(psName);return loAttachList.AddAttachment(psFileName);};this.DelAttachment=function(psName,psFileName){var loAttachList=this.CreateAttachList(psName);return loAttachList.DelAttachment(psFileName);};this.EmptyAttachment=function(psName){var loAttachList=this.CreateAttachList(psName);return loAttachList.EmptyAttachment();};this.UploadAttachment=function(){if(!this.IsModified()){return true;}if(!this.GetModifiedFiles()){return false;}goForm.s_AttachList.value="";for(var i=0;i<gaAttachList.length;i++){var loAttachList=gaAttachList[i];var lsAttachList=loAttachList.GetAttachString();if(lsAttachList!=""){if(goForm.s_AttachList.value!=""){goForm.s_AttachList.value+=lsSplit;}goForm.s_AttachList.value+=lsAttachList;}var lsDelList=loAttachList.GetDelString();if(lsDelList!=""){if(goForm.s_DelList.value.trim()!=""){goForm.s_DelList.value+="|";}goForm.s_DelList.value+=lsDelList;var lsDetach="";var laDelList=lsDelList.split("|");for(var j=0;j<laDelList.length;j++){if(laDelList[j].trim()!=""){lsDetach=lsDetach+"<input type='text' name='%%Detach' value='"+laDelList[j]+"'>";}}hDetachFile.innerHTML+=lsDetach;}var lsAddList=loAttachList.UploadAttachment();if(lsAddList!=""){if(goForm.s_AddList.value!=""){goForm.s_AddList.value+="|";}goForm.s_AddList.value+=lsAddList;}}return true;};this.GetModifiedFiles=function(){var laEditedFiles=new Array();for(var i=0;i<gaAttachList.length;i++){if(gaAttachList[i].aGetEditedFiles()!=null){if(gaAttachList[i].aGetEditedFiles().join(";")!=""){laEditedFiles=laEditedFiles.concat(gaAttachList[i].aGetEditedFiles());}}}if(laEditedFiles.join(";")!=""){var lsUploaded=sSelectArray("Multiple",sGetLang("UPLOAD_TITLEFILESELECT"),sGetLang("UPLOAD_PROMPTSAVEMODIFIED"),laEditedFiles.join(";"),false);if(typeof lsUploaded!="undefined"){var laModifiedFiles=lsUploaded.split(";");for(var j=0;j<gaAttachList.length;j++){if(gaAttachList[j].aGetEditedFiles()!=null){for(var i=0;i<laModifiedFiles.length;i++){if(gaAttachList[j].aGetEditedFiles().indexOf(laModifiedFiles[i])!=-1){gaAttachList[j].SetModifiedFile(laModifiedFiles[i]);}}}if(i==laModifiedFiles.length){if(gaAttachList[j].aModifiedFiles==null){gaAttachList[j].SetModifiedFile("");}}}}else{return false;}}return true;};this.OpenAttachment=function(psName){var loAttachList=this.CreateAttachList(psName);return loAttachList.OpenAttachment();};this.GetAttachCount=function(psName){var loAttachList=this.CreateAttachList(psName);return loAttachList.GetAttachCount();};function GetAttachList(psName){for(var i=0;i<gaAttachList.length;i++){if(gaAttachList[i].Name.toLowerCase()==psName.toLowerCase()){return gaAttachList[i];}}return null;}this.IsExistAttach=function(psFileName){for(var i=0;i<gaAttachList.length;i++){var loAttachList=gaAttachList[i];if(loAttachList.IsExistAttach(psFileName)){return true;}}return false;};this.IsModified=function(){for(var i=0;i<gaAttachList.length;i++){var loAttachList=gaAttachList[i];if(loAttachList.IsModified()){return true;}}return false;};}function AttachmentList(psName){this.Name=(psName.indexOf("|")==-1)?psName:psName.substr(0,psName.indexOf("|"));this.UploadControl=goForm.UploadControl;this.aAttachment=new Array();this.aAttachmentDel=new Array();this.type=1;if(psName.indexOf("|")!=-1){laAttachTemp=psName.substr(psName.indexOf("|")+1).split("|");for(var j=0;j<laAttachTemp.length;j++){var loAttachment=new Object();loAttachment.FileName=laAttachTemp[j];loAttachment.IsLocal=false;this.aAttachment.push(loAttachment);}}this.AddAttachment=function(psFileName){if(psFileName==null||psFileName==""){var lsAddFiles=this.UploadControl.SelectFiles(true,"");}else{var lsAddFiles=psFileName;}if(lsAddFiles==""){return false;}var laAdd=lsAddFiles.split("|");for(var i=0;i<laAdd.length;i++){if(this.IsExistAttach(laAdd[i].substr(laAdd[i].lastIndexOf("\\")+1))){alert(sGetLang("UPLOAD_ATTACHEXIST",laAdd[i].substr(laAdd[i].lastIndexOf("\\")+1)));continue;}if(iGetStringByte(laAdd[i].substr(laAdd[i].lastIndexOf("\\")+1))>128){alert(sGetLang("P_CONST_FILENAMETOOLONG"));return false;}var loAttachment=new Object();loAttachment.FileName=laAdd[i];loAttachment.IsLocal=true;if(this.aAttachment==null){this.aAttachment=new Array(loAttachment);}else{this.aAttachment.push(loAttachment);}}return true;};this.DelAttachment=function(psFileName){if(this.aAttachment!=null){var lsFileName=(psFileName==null)?"":psFileName;var lbFound=true;if(lsFileName==""){lbFound=false;}else{for(var j=0;j<this.aAttachment.length;j++){if(this.aAttachment[j].FileName.substr(this.aAttachment[j].FileName.indexOf("\\")+1).toLowerCase()==lsFileName.toLowerCase()){break;}}if(j==this.aAttachment.length){lbFound=false;}}if(!lbFound){var lsFileSel="";for(var i=0;i<this.aAttachment.length;i++){var lsFileName=(this.aAttachment[i].IsLocal)?this.aAttachment[i].FileName.substr(this.aAttachment[i].FileName.lastIndexOf("\\")+1):this.aAttachment[i].FileName;var lsIsLocal=(this.aAttachment[i].IsLocal)?"1":"0";if(lsFileSel!=""){lsFileSel+=";";}lsFileSel+=lsFileName+"|"+this.aAttachment[i].FileName+"|"+lsIsLocal;}var lsFileReturn=sSelectArray("Multiple",sGetLang("UPLOAD_TITLEFILESELECT"),sGetLang("UPLOAD_PROMPTFILEDELETE"),lsFileSel);if(lsFileReturn!=null&&lsFileReturn!=""){lsFileName=lsFileReturn;}else{lsFileName="";}}if(lsFileName!=""){var laFileDel=lsFileName.split(";");for(var i=0;i<laFileDel.length;i++){var lsFileDel=(laFileDel[i].indexOf("|")!=-1)?laFileDel[i].substr(0,laFileDel[i].indexOf("|")):laFileDel[i];for(var j=0;j<this.aAttachment.length;j++){if(this.aAttachment[j].FileName.toLowerCase()==lsFileDel.toLowerCase()){if(!this.aAttachment[j].IsLocal){this.aAttachmentDel[this.aAttachmentDel.length]=lsFileDel;}this.aAttachment.splice(j,1);}}}if(this.aAttachment.length==0){this.aAttachment=null;}}}else{alert(sGetLang("UPLOAD_NOATTACHMENT"));}return true;};this.EmptyAttachment=function(){if(this.aAttachment!=null){for(var j=0;j<this.aAttachment.length;j++){if(!this.aAttachment[j].IsLocal){this.aAttachmentDel[this.aAttachmentDel.length]=this.aAttachment[j].FileName;}}this.aAttachment=null;}return true;};this.GetAttachCount=function(){return(this.aAttachment==null)?0:this.aAttachment.length;};this.OpenAttachment=function(){if(this.aAttachment==null||this.aAttachment.length==0){alert(sGetLang("UPLOAD_NOATTACHMENT"));return false;}else{var laAttach=this.aAttachment;var lsURL=this.UploadControl.protocol+"://"+this.UploadControl.domain+":"+this.UploadControl.port+gsCurURL+gsCurDBName+"/all/"+gsCurUNID+"/$File/";if(laAttach.length==1){if(laAttach[0].IsLocal){this.UploadControl.OpenLocalFile(laAttach[0].FileName);}else{this.UploadControl.OpenNetFile(lsURL+laAttach[0].FileName);}}else{var lsFileSel="";for(var i=0;i<laAttach.length;i++){var lsFileName=(laAttach[i].IsLocal)?laAttach[i].FileName.substr(laAttach[i].FileName.lastIndexOf("\\")+1):laAttach[i].FileName;var lsIsLocal=(laAttach[i].IsLocal)?"1":"0";if(lsFileSel!=""){lsFileSel+=";";}lsFileSel+=lsFileName+"|"+laAttach[i].FileName+"|"+lsIsLocal;}var lsFileOpen=sSelectArray("Single",sGetLang("UPLOAD_TITLEFILESELECT"),sGetLang("UPLOAD_PROMPTFILEOPEN"),lsFileSel);if(lsFileOpen!=null){var lsFileName=lsFileOpen.substr(0,lsFileOpen.indexOf("|"));if(lsFileOpen.substr(lsFileOpen.indexOf("|")+1)=="1"){this.UploadControl.OpenLocalFile(lsFileName);}else{this.UploadControl.OpenNetFile(lsURL+lsFileName);}}}}return true;};this.UploadAttachment=function(){if(this.aAttachment==null){return"";}var lsAddList="";for(var i=0;i<this.aAttachment.length;i++){if(this.aAttachment[i].IsLocal){if(this.UploadControl.UploadFile2(this.aAttachment[i].FileName)){if(lsAddList!=""){lsAddList+="|";}lsAddList+="|"+this.aAttachment[i].FileName.substr(this.aAttachment[i].FileName.lastIndexOf("\\")+1);}}}return lsAddList;};this.GetAttachString=function(){if(this.aAttachment==null){return"";}var lsAttachList=this.Name;for(var i=0;i<this.aAttachment.length;i++){if(this.aAttachment[i].IsLocal){lsAttachList+="|"+this.aAttachment[i].FileName.substr(this.aAttachment[i].FileName.lastIndexOf("\\")+1);}else{lsAttachList+="|"+this.aAttachment[i].FileName;}}return lsAttachList;};this.GetDelString=function(){return this.aAttachmentDel.join("|");};this.IsExistAttach=function(psFileName){if(this.aAttachment==null){return false;}for(var i=0;i<this.aAttachment.length;i++){if(this.aAttachment[i].IsLocal){var lsFileName=this.aAttachment[i].FileName.substr(this.aAttachment[i].FileName.lastIndexOf("\\")+1);}else{var lsFileName=this.aAttachment[i].FileName;}if(lsFileName.toLowerCase()==psFileName.toLowerCase()){return true;}}return false;};this.aGetEditedFiles=function(){return null;};this.SetModifiedFile=function(psFileName){return true;};this.IsModified=function(){if(null!=this.aAttachment){for(var i=0;i<this.aAttachment.length;i++){if(this.aAttachment[i].IsLocal){return true;}}}if(null!=this.aAttachmentDel){if(this.aAttachmentDel.join(";")!=""){return true;}}return false;};}function AttachmentView(psName,psRights){this.UploadControl=null;this.type=1;this.Name=psName;this.aAttachment=new Array();this.sSplit="|";this.aRights=(psRights==null||psRights=="")?null:(psRights.split(this.sSplit));this.aEditedFiles=null;this.aModifiedFiles=null;this.parseXML=function(){if(this.Name.indexOf("|")!=-1){this.aAttachment=this.Name.substr(this.Name.indexOf("|")+1).split("|");this.Name=this.Name.substr(0,this.Name.indexOf("|"));}return true;};this.init=function(){if(!this.parseXML()){return false;}if(this.Name==null){return false;}if(this.Name==""){this.UploadControl=goForm.UploadControl;return true;}if(!goForm.UploadControl){return false;}var loNode=document.createElement("<Span>");loNode.CLASSID=goForm.UploadControl.classid;loNode.CODEBASE=goForm.UploadControl.codebase;loNode.width=goForm.UploadControl.width;loNode.height=goForm.UploadControl.height;var laIndex=new Array();for(var i=0;i<goForm.UploadControl.childNodes.length;i++){var loNodeChild=document.createElement(goForm.UploadControl.childNodes[i].outerHTML);if(loNodeChild.name.toLowerCase()=="uploadedfile"){var lsUploadFiles="";var laUploadFiles=window.ID_SpanAttachNames.innerText.split(this.sSplit);for(var j=0;j<laUploadFiles.length;j++){if(laUploadFiles[j]==""){continue;}for(var k=0;k<this.aAttachment.length;k++){if(laUploadFiles[j].toLowerCase()==this.aAttachment[k].toLowerCase()){laIndex.push(j);lsUploadFiles+=laUploadFiles[j]+"|";}}}loNodeChild.value=lsUploadFiles;}else{if(loNodeChild.name.toLowerCase()=="datetime"){var laModified=window.ID_SpanAttachModified.innerText.split(this.sSplit);var lsModified="";for(var j=0;j<laIndex.length;j++){lsModified+=laModified[laIndex[j]]+"|";}loNodeChild.value=lsModified;}else{if(loNodeChild.name.toLowerCase()=="filesize"){var laSize=window.ID_SpanAttachSize.innerText.split(this.sSplit);var lsSize="";for(var j=0;j<laIndex.length;j++){lsSize+=laSize[laIndex[j]]+"|";}loNodeChild.value=lsSize;}else{if(loNodeChild.name.toLowerCase()=="addscript"){loNodeChild.value="AttachRunFunc|"+this.Name+"|AddAttachment";}else{if(loNodeChild.name.toLowerCase()=="pastescript"){loNodeChild.value="AttachRunFunc|"+this.Name+"|PasteAttachment";}else{if(loNodeChild.name.toLowerCase()=="enableoledit"){if(this.aRights!=null&&gbIsEdit){if(this.aRights.indexOf(goAttachManager.RIGHT_EDIT)==-1){loNodeChild.value="0";}else{loNodeChild.value="1";}}else{loNodeChild.value=(gbIsEdit)?"1":"0";}}else{if(loNodeChild.name.toLowerCase()=="enablesaveas"){if(this.aRights!=null){if(this.aRights.indexOf(goAttachManager.RIGHT_SAVE)==-1){loNodeChild.value="0";}else{loNodeChild.value="1";}}else{loNodeChild.value="1";}}else{if(loNodeChild.name.toLowerCase()=="enableadd"||loNodeChild.name.toLowerCase()=="enablepaste"){if(this.aRights!=null&&gbIsEdit){if(this.aRights.indexOf(goAttachManager.RIGHT_ADD)==-1){loNodeChild.value="0";}else{loNodeChild.value="1";}}else{loNodeChild.value=(gbIsEdit)?"1":"0";}}else{if(loNodeChild.name.toLowerCase()=="enabledelitem"||loNodeChild.name.toLowerCase()=="enabledelall"){if(this.aRights!=null&&gbIsEdit){if(this.aRights.indexOf(goAttachManager.RIGHT_DEL)==-1){loNodeChild.value="0";}else{loNodeChild.value="1";}}else{loNodeChild.value=(gbIsEdit)?"1":"0";}}}}}}}}}}loNode.appendChild(loNodeChild);}if(!window._UploadToolBar){return false;}var loNodeToolBar=document.createElement("<Span>");loNodeToolBar.innerHTML=window._UploadToolBar.innerHTML;var lsDisplay="";if(this.aRights!=null){if(this.aRights.length==0){lsDisplay="none";}if(this.aRights.indexOf(goAttachManager.RIGHT_HIDE)!=-1){lsDisplay="none";}}var lsCtrlHTML="<table id='Table_"+this.Name+"' border=1 height=100px cellpadding='0' cellspacing='1' style='width:100%;background-color:#555555;display:"+lsDisplay+"'>";lsCtrlHTML+="<tr><td width=100% height=20px>";lsCtrlHTML+=loNodeToolBar.innerHTML;lsCtrlHTML+="</td></tr>";lsCtrlHTML+="<tr><td width=100% height=70px>";lsCtrlHTML+="<OBJECT name='obj_"+this.Name+"' CLASSID="+loNode.CLASSID+" CODEBASE="+loNode.CODEBASE+" width=100% height=100%>";lsCtrlHTML+=loNode.innerHTML;lsCtrlHTML+="</OBJECT>";lsCtrlHTML+="</td></tr>";lsCtrlHTML+="</table>";var loSpanList=document.getElementsByName("_SPANATTACH");for(var i=0;i<loSpanList.length;i++){if(loSpanList[i].name.toLowerCase()==this.Name.toLowerCase()){loSpanList[i].innerHTML=lsCtrlHTML;break;}}var loCtrlTable=eval("window.Table_"+this.Name);var loToolBarTable=loCtrlTable.rows[0].cells[0].children[0];var lbCellDisplay=true;var lbCellButton=false;for(var i=0;i<loToolBarTable.rows[0].cells.length;i++){var loCell=loToolBarTable.rows[0].cells[i];if(loCell.type=="button"){loCell.onclick=new Function("AttachRunFunc('"+this.Name+"','"+loCell.onclickevent+"')");}else{if(loCell.type=="menu"){loCell.attachEvent("onclick",new Function("showMenu('ID_"+this.Name+"_SHOWTYPE')"));}}if(this.aRights!=null&&loCell.Right!=null){if(this.aRights.indexOf(loCell.Right)==-1){loCell.style.display="none";}else{loCell.style.display="";}}else{loCell.style.display="";}}var loTableToolBar=loCtrlTable.rows[0].cells[0].childNodes[0];for(var i=0;i<loTableToolBar.rows[0].cells.length;i++){if(loTableToolBar.rows[0].cells[i].id=="_UploadMenuBar"){var loMenuBar=loTableToolBar.rows[0].cells[i];for(var j=0;j<loMenuBar.children.length;j++){var loA=loMenuBar.children[j];loA.onclick=new Function("AttachRunFunc('"+this.Name+"','"+loA.onclickevent+"');return false;");loA.id="ID_"+this.Name+"_SHOWTYPE";}break;}}var loMenuBar=eval("window.TR_"+this.Name);this.UploadControl=eval("goForm.obj_"+this.Name);};this.bValidFile=function(psFileName){var lsFileName=psFileName.substr(psFileName.lastIndexOf("\\")+1);if(goAttachManager.IsExistAttach(lsFileName)){alert(sGetLang("UPLOAD_ATTACHEXIST",lsFileName));return false;}if(iGetStringByte(lsFileName)>128){alert(sGetLang("P_CONST_FILENAMETOOLONG"));return false;}if(!this.UploadControl.bValidFile(psFileName)){return false;}return true;};this.AddAttachment=function(){if(this.UploadControl==null){return false;}var lsAddFiles=this.UploadControl.SelectFiles(true,"");if(lsAddFiles==""){return false;}var laAdd=lsAddFiles.split("|");for(var i=0;i<laAdd.length;i++){if(!this.bValidFile(laAdd[i])){continue;}this.UploadControl.AddLocalFile(laAdd[i]);}};this.OpenAttachment=function(){if(this.UploadControl==null){return false;}this.UploadControl.OpenFile();return true;};this.EditAttachment=function(){if(this.UploadControl==null){return false;}this.UploadControl.OnlineEdit();return true;};this.DelAttachment=function(){if(this.UploadControl==null){return false;}this.UploadControl.DelItem();this.UploadControl.focus();return true;};this.SaveAttachment=function(){if(this.UploadControl==null){return false;}this.UploadControl.SaveAs();this.UploadControl.focus();return true;};this.SaveAllAttachment=function(){if(this.UploadControl==null){return false;}this.UploadControl.SaveAllAs();this.UploadControl.focus();return true;};this.PasteAttachment=function(){if(this.UploadControl==null){return false;}var lsFileList=this.UploadControl.GetFileNameFromClip();if(lsFileList!=""){var laFileList=lsFileList.split(this.sSplit);for(var i=0;i<laFileList.length;i++){var lsFileName=laFileList[i].substr(laFileList[i].lastIndexOf("\\")+1);if(!this.bValidFile(laFileList[i])){continue;}this.UploadControl.AddLocalFile(laFileList[i]);}}this.UploadControl.focus();return true;};this.DelAllAttachment=function(){if(this.UploadControl==null){return false;}this.UploadControl.DelAll();this.UploadControl.focus();return true;};this.ChangeView=function(piType){if(this.UploadControl==null){return false;}this.UploadControl.ChangeView(piType);this.UploadControl.focus();return true;};this.RefreshView=function(){if(this.UploadControl==null){return false;}this.UploadControl.RefreshView();this.UploadControl.focus();return true;};this.aGetModifiedFiles=function(){this.aModifiedFiles=new Array();this.aEditedFiles=new Array();if(this.UploadControl.GetModifiedFiles()!=""){this.aEditedFiles=this.UploadControl.GetModifiedFiles().split("|");}if(this.aEditedFiles.join(";")!=""){var lsUploaded=sSelectArray("Multiple",sGetLang("UPLOAD_TITLEFILESELECT"),sGetLang("UPLOAD_PROMPTSAVEMODIFIED"),this.aEditedFiles.join(";"),false);if(typeof lsUploaded!="undefined"){this.aModifiedFiles=lsUploaded.split(";");}}return this.aModifiedFiles;};this.IsExistAttach=function(psFileName){for(var i=0;i<this.UploadControl.GetFileCount();i++){if(this.UploadControl.GetFileName(i)){if(this.UploadControl.GetFileName(i).toLowerCase()==psFileName.toLowerCase()){return true;}}}};this.aGetEditedFiles=function(){return this.UploadControl.GetModifiedFiles().split(this.sSplit);};this.SetModifiedFile=function(psFileName){if(this.aModifiedFiles==null){this.aModifiedFiles=new Array();}this.aModifiedFiles.push(psFileName);};this.UploadAttachment=function(){if(this.UploadControl==null){return"";}var laFileToUpload=new Array();for(var i=0;i<this.UploadControl.GetFileCount();i++){if(!this.UploadControl.IsUploadFile(i)){laFileToUpload[laFileToUpload.length]=this.UploadControl.GetFileNameExt(i);}}var laModifiedFiles=(this.aModifiedFiles==null)?this.aGetModifiedFiles():this.aModifiedFiles;if(null!=laModifiedFiles){for(var i=0;i<laModifiedFiles.length;i++){if(laModifiedFiles[i]==""){continue;}laFileToUpload[laFileToUpload.length]=this.UploadControl.GetTempDir()+laModifiedFiles[i];}}var lsAddList="";for(var i=0;i<laFileToUpload.length;i++){lbValid=this.UploadControl.UploadFile(laFileToUpload[i]);if(!lbValid){if(!confirm(sGetLang("UPLOAD_FILEUPLOADFAIL",laFileToUpload[i].substr(laFileToUpload[i].lastIndexOf("\\")+1)))){return false;}}else{if(lsAddList!=""){lsAddList+="|";}lsAddList+="|"+laFileToUpload[i].substr(laFileToUpload[i].lastIndexOf("\\")+1)+"|";}}return lsAddList;};this.GetAttachString=function(){if(this.UploadControl==null){return"";}if(this.Name==""){return"";}var lsAttachList=this.Name;for(var i=0;i<this.UploadControl.GetFileCount();i++){if(!this.UploadControl.IsUploadFile(i)){lsAttachList+="|"+this.UploadControl.GetFileName(i).substr(this.UploadControl.GetFileName(i).lastIndexOf("\\")+1);}else{lsAttachList+="|"+this.UploadControl.GetFileName(i);}}return lsAttachList;};this.GetDelString=function(){if(this.UploadControl==null){return"";}var lsDelList=this.UploadControl.GetDelList();var laModifiedFiles=(this.aModifiedFiles==null)?this.aGetModifiedFiles():this.aModifiedFiles;if(null!=laModifiedFiles){if(laModifiedFiles.join("|")!=""){if(lsDelList!=""){lsDelList+="|";}lsDelList+=laModifiedFiles.join("|");}}return lsDelList;};this.IsModified=function(){if(this.UploadControl==null){return false;}if(this.UploadControl.GetDelList()!=""){return true;}if(this.UploadControl.GetOnlineEdited()!=""){return true;}for(var i=0;i<this.UploadControl.GetFileCount();i++){if(!this.UploadControl.IsUploadFile(i)){return true;}}return false;};this.init();}function bWordBodyModified(poOffice){if(poOffice==null&&goForm&&goForm.MSOffice){poOffice=goForm.MSOffice;}if(typeof(poOffice)!="object"){return false;}if(poOffice.WordIsOpen()){if(!poOffice.IsSaved()){return true;}else{if(top.LastModify<poOffice.getLastModify()){return true;}else{return false;}}}else{poOffice.CloseWord(3);if(typeof top.LastModify!="undefined"&&top.LastModify<poOffice.getLastModify()){return true;}}return false;}function NewOfficeDocument(poOffice,psFileURL,pbPrompt){if(typeof(poOffice)!="object"){return false;}var lsFileURL=gsOAURL+gsDCDBName+"/viewWordTemplate/0/$file/$WTemplate.doc";var lbPrompt=(pbPrompt==null)?false:pbPrompt;var lsRevisionCanAccept=s_AcceptRevision.innerText;if(psFileURL==null||psFileURL==""){if((window.s_DWordTemplate&&s_DWordTemplate.innerText.trim()!="NULL")&&(lbPrompt==false)){var lsURL=encodeURI(gsOAURL)+gsSRDBName+"/agtNewOffice?OpenAgent&ObjectID="+poOffice.id+"&Template="+escape(s_DWordTemplate.innerText);top.RunAgent.location.replace(lsURL);}else{if(s_DWordTemplate.innerText!="NULL"){var lsURL=encodeURI(gsOAURL)+gsSRDBName+"/agtFileTemplate?OpenAgent&Category="+escape(s_DWordTemplate.innerText);var lvRet=PromptTree(true,"",lsURL,sGetLang("P_SELECTTEMPLATE"),false);if(lvRet==null||lvRet==""){return false;}var lsNO=lvRet.substring(0,lvRet.indexOf("|"));var lsName=lvRet.substring(lvRet.indexOf("|")+1);lsFileURL=gsOAURL+gsDCDBName+"/viewFileTemplateByID/"+lsNO+"/$file/"+lsName;}poOffice.SetIni(lsFileURL,"",1);top.LastModify=poOffice.getLastModify();poOffice.OpenFile(gsCurUser,"0","0",false,"1");if(lsRevisionCanAccept=="1"){BodySignRevisionCanAccept(poOffice);}if(goForm.s_BodySaved){goForm.s_BodySaved.value="";}return true;}}else{lsFileURL=psFileURL;poOffice.SetIni(lsFileURL,"",1);top.LastModify=poOffice.getLastModify();poOffice.OpenFile(gsCurUser,"0","0",false,"1");if(lsRevisionCanAccept=="1"){BodySignRevisionCanAccept(poOffice);}if(goForm.s_BodySaved){goForm.s_BodySaved.value="";}return true;}}function QuerySaveBody(poOffice,pbForce){if(bValidServerSession(true)==false){return false;}if(typeof(poOffice)!="object"||goForm.s_ReadOnly.value=="1"){return true;}var lbForce=(pbForce==null)?false:pbForce;var lsAcceptRevisions=goForm.s_RevisionAccept.value;var liConfirm;if(poOffice.WordIsOpen()){if(!poOffice.IsSaved()){if(goForm.s_BodySaved.value=="1"){liConfirm=4;}else{liConfirm=bConfirm(sGetLang("P_OFFICE_PROMPTQUERYSAVE"),MB_YES+MB_NO+MB_CANCEL+MB_ICONQUESTION,sGetLang("P_OFFICE_TITLE"));}if(liConfirm==4){if(lsAcceptRevisions!="0"){BodyAcceptRevision(poOffice);}poOffice.SaveWord();poOffice.CloseWord(2);goForm.s_BodySaved.value="1";return true;}else{if(liConfirm==8){poOffice.CloseWord(3);return false;}else{return -1;}}}else{poOffice.CloseWord(2);}}if(typeof top.LastModify!="undefined"&&poOffice.GetLocalFile()!=""&&(top.LastModify==""||poOffice.getLastModify()==""||top.LastModify<poOffice.getLastModify())){if(goForm.s_BodySaved.value=="1"){liConfirm=4;}else{if(!lbForce){liConfirm=bConfirm(sGetLang("P_OFFICE_PROMPTQUERYSAVE"),MB_YES+MB_NO+MB_CANCEL+MB_ICONQUESTION,sGetLang("P_OFFICE_TITLE"));}else{liConfirm=4;}}if(liConfirm==4){goForm.s_BodySaved.value="1";return true;}else{if(liConfirm==8){return false;}else{return -1;}}}else{return false;}}function EditBody(poOffice){if(typeof(poOffice)!="object"){return false;}var lsFileURL;var lsFileName="";var lsLocalPath="";var lsRevision=goForm.s_Revision.value;var lsReadOnly=goForm.s_ReadOnly.value;var lsAcceptRevisions=goForm.s_RevisionAccept.value;var lsRevisionCanAccept=s_AcceptRevision.innerText;var lsRevisionEdit=(typeof(s_IsSubmit)!="object"||goForm.s_BodyName.value=="")?"0":(s_IsSubmit.innerText);if(poOffice.GetLocalFile().trim()==""){if(goForm.s_BodyName.value==""){NewOfficeDocument(poOffice);}else{lsFileName=goForm.s_BodyName.value;lsFileURL=gsCurURL+gsCurDBName+"/all/"+gsCurUNID+"/$file/"+lsFileName;if(typeof ID_CopyURLPath=="object"&&ID_CopyURLPath.innerText!=""){lsFileURL=ID_CopyURLPath.innerText+lsFileName;}if(!poOffice.SetIni(lsFileURL,lsFileName,1)){alert(sGetLang("P_OFFICE_PROMPTFILEEXIST"));return false;}if(!poOffice.WordIsOpen()){poOffice.OpenFile(gsCurUser,lsRevisionEdit,lsRevision,lsReadOnly,"1");if(lsAcceptRevisions!="0"){BodySignAccept(poOffice);}if(lsRevisionCanAccept=="1"){BodySignRevisionCanAccept(poOffice);}}else{poOffice.SetWordFocus();}top.LastModify=poOffice.getLastModify();}}else{if(!poOffice.WordIsOpen()){poOffice.OpenFile(gsCurUser,lsRevisionEdit,lsRevision,lsReadOnly,"1");if(lsAcceptRevisions!="0"){BodySignAccept(poOffice);}if(lsRevisionCanAccept=="1"){BodySignRevisionCanAccept(poOffice);}}else{poOffice.SetWordFocus();}}top.IsOpenOffice="1";}function SaveBody(poOffice,pbSaveBody){if(typeof(poOffice)!="object"||goForm.s_ReadOnly.value=="1"){return true;}var lbQuery=(pbSaveBody==null)?QuerySaveBody(poOffice):pbSaveBody;if(lbQuery==-1){return false;}else{if(lbQuery==true){if(poOffice.Upload("")!=""){goForm.s_BodySaved.value="1";var lsFilePath=poOffice.GetFileName("");if(goForm.s_BodyName){goForm.s_BodyName.value=lsFilePath;if(goForm.s_BodyName.value.trim()!=""&&typeof window.hBodyDetachFile=="object"){var lsDetach="<input type='text' name='%%Detach' value='"+goForm.s_BodyName.value+"'>";hBodyDetachFile.innerHTML+=lsDetach;}}}else{goForm.s_BodySaved.value="0";return false;}}}return true;}function EditWordBody(poOffice){goForm.s_Revision.value="1";if(goForm.s_RevisionAccept.value==""&&goForm.s_BodyCreator.value!=""&&goForm.s_BodyCreator.value!=gsCurUser){goForm.s_RevisionAccept.value="0";}if(goForm.s_RevisionAccept.value!="0"){goForm.s_Revision.value="0";}goForm.s_ReadOnly.value="0";EditBody(poOffice);}function ReadWordBody(poOffice){if(goForm.s_BodyName.value==""){return false;}goForm.s_Revision.value="0";goForm.s_ReadOnly.value="1";EditBody(poOffice);}function BodyAcceptRevision(poOffice){BodyRunMacro(poOffice,"OAAcceptAllRevisions");}function BodySignAccept(poOffice){BodyRunMacro(poOffice,"OASignAccept");}function BodySignRevisionCanAccept(poOffice){BodyRunMacro(poOffice,"OASignRevisionCanAccept");}function BodyInvalidButton(poOffice,piInvalid){BodyRunMacro(poOffice,"OAInvalidButton",(piInvalid+""));}function BodyInvalidCommandBars(poOffice,piInvalid){BodyRunMacro(poOffice,"OAInvalidCommandBars",(piInvalid+""));}function BodyRunMacro(poOffice,psMacroName,psArg0,psArg1,psArg2,psArg3,psArg4,psArg5,psArg6,psArg7,psArg8,psArg9){var lsArg0=(psArg0==null)?"":psArg0;var lsArg1=(psArg1==null)?"":psArg1;var lsArg2=(psArg2==null)?"":psArg2;var lsArg3=(psArg3==null)?"":psArg3;var lsArg4=(psArg4==null)?"":psArg4;var lsArg5=(psArg5==null)?"":psArg5;var lsArg6=(psArg6==null)?"":psArg6;var lsArg7=(psArg7==null)?"":psArg7;var lsArg8=(psArg8==null)?"":psArg8;var lsArg9=(psArg9==null)?"":psArg9;poOffice.RunVBA(psMacroName,lsArg0,lsArg1,lsArg2,lsArg3,lsArg4,lsArg5,lsArg6,lsArg7,lsArg8,lsArg9);}function bAutoCloseWPS(poOffice,pbFirst){if(poOffice.GetClientType()!=1){return true;}if(pbFirst==true){if(window.goTimer!=null){window.clearInterval(window.goTimer);}window.goTimer=setInterval("bAutoCloseWPS(goForm.MSOffice)",300);}else{if(typeof poOffice!="object"&&window.goTimer!=null){window.clearInterval(window.goTimer);}if(typeof poOffice=="object"){if(!poOffice.WordIsOpen()){poOffice.CloseWord(2);if(window.goTimer!=null){window.clearInterval(window.goTimer);}}}}}function bCheckRockey(psUserName){var lsUserName=(psUserName==null)?gsCurUser:psUserName;var loRockey=new CRockey();return loRockey.bVertifyUser(lsUserName);}function CRockey(poRockey){var loCRockey=this;this.oRockey=poRockey;if(null==this.oRockey){this.oRockey=document.createElement('<OBJECT ID="ePass" style="display:none" WIDTH=300 HEIGHT=70 CLASSID="clsid:E1D396DC-D064-4846-8B50-A3301BDD6243" codebase="/icons/icons/install.cab#version='+P_CONST_ROCKEYVERSION+'">');document.body.appendChild(this.oRockey);this.oRockey=document.getElementById("ePass");}this.sSerialNum="";this.sRndData="";this.sDigest="";this.sPrvDigest="";this.sGetRandom=function(){var lsRndData="";var liMax="z".charCodeAt(0);var liMin="a".charCodeAt(0);for(i=0;i<20;i++){lsRndData+=String.fromCharCode(Math.floor((liMax-liMin)*Math.random()+liMin));}return(lsRndData);};this.sRndData=this.sGetRandom();this.HexToDec=function(psHex){psHex+="";if(psHex==""){return 0;}var L=psHex.length;var k=0;var r=0;var r1=0;while(k<L){r1=loCRockey.iToDec(psHex.substr(k,1));r1*=Math.pow(2,(L-k-1)<<2);r+=r1;k+=1;}return r;};this.iToDec=function(psSource){if(psSource>="0"&&psSource<="9"){return(psSource-0);}if(psSource.toUpperCase()=="A"){return 10;}if(psSource.toUpperCase()=="B"){return 11;}if(psSource.toUpperCase()=="C"){return 12;}if(psSource.toUpperCase()=="D"){return 13;}if(psSource.toUpperCase()=="E"){return 14;}if(psSource.toUpperCase()=="F"){return 15;}};this.bVertifyPIN=function(psUserName,pbReset){var lbReset=(pbReset==null)?true:pbReset;if(typeof this.oRockey!="object"){return false;}try{this.oRockey.OpenDevice(1,"");}catch(e){return false;}try{this.oRockey.VerifyPIN(0,psUserName.toLowerCase());}catch(e){var lsShort=this.sGetShortName(psUserName);if(lsShort!=psUserName){try{this.oRockey.VerifyPIN(0,lsShort.toLowerCase());}catch(e){this.oRockey.ResetSecurityState(0);this.oRockey.CloseDevice();return false;}}else{this.oRockey.ResetSecurityState(0);this.oRockey.CloseDevice();return false;}}if(lbReset){try{this.oRockey.ResetSecurityState(0);}catch(e){this.oRockey.CloseDevice();return false;}}this.oRockey.CloseDevice();return true;};this.sGetShortName=function(psUserName){var xmlhttp=oGetXmlHttpRequest();if(xmlhttp==null){return psUserName;}var lsURL=encodeURI(gsOAURL)+"zSysRes.nsf/agtCheckRockey?openagent";lsURL+="&t="+((new Date()).valueOf());var lsPara="&Type=1";lsPara+="&UserName="+escape(psUserName);xmlhttp.open("POST",lsURL,false);xmlhttp.send(lsPara);var xmlDoc=xmlhttp.responseXML;if(null==xmlDoc){return psUserName;}var lonode=xmlDoc.selectSingleNode("/root/user");if(null==lonode){return psUserName;}return lonode.text;};this.bInitData=function(psUserName){if(typeof this.oRockey!="object"){return false;}if(!this.bVertifyPIN(psUserName,false)){return false;}try{this.oRockey.OpenDevice(1,"");}catch(e){this.oRockey.CloseDevice();return false;}try{this.sSerialNum=this.oRockey.GetStrProperty(7,0,0);}catch(e){this.oRockey.CloseDevice();return false;}try{this.oRockey.ChangeDir(768,0,"WELLSOFT");}catch(e){this.oRockey.CloseDevice();return false;}try{this.oRockey.OpenFile(0,1);}catch(e){this.oRockey.CloseDevice();return false;}try{this.sDigest=this.oRockey.HashToken(1,2,this.sRndData);}catch(e){this.oRockey.CloseDevice();return false;}try{this.oRockey.OpenFile(0,3);}catch(e){this.oRockey.CloseDevice();return false;}try{this.sPrvDigest=this.oRockey.HashToken(1,4,this.sRndData);}catch(e){this.oRockey.CloseDevice();return false;}try{this.oRockey.ResetSecurityState(0);}catch(e){this.oRockey.CloseDevice();return false;}this.oRockey.CloseDevice();return true;};this.bVertifyUser=function(psUserName){if(typeof this.oRockey!="object"){return false;}var lbAgain=false;do{lbAgain=false;if(!this.bVertifyPIN(psUserName)){if(confirm(sGetLang("SYSRES_CONFIRMINSERTROCKEY"))){lbAgain=true;}else{return false;}}}while(lbAgain);if(!this.bInitData(psUserName)){return false;}return this.bServerVertify(psUserName,2);};this.bServerVertify=function(psUserName,piType){var xmlhttp=oGetXmlHttpRequest();if(xmlhttp==null){return"";}var lsURL=encodeURI(gsOAURL)+"zSysRes.nsf/agtCheckRockey?openagent";lsURL+="&t="+((new Date()).valueOf());var lsPara="";if(piType==1){lsPara+="&Type=2";lsPara+="&SerialNum="+this.sSerialNum;}else{if(piType==4){if(psUserName!=null){lsPara+="&UserName="+escape(psUserName);}lsPara+="&Type=4";}else{if(psUserName!=null){lsPara+="&UserName="+escape(psUserName);}lsPara+="&Type=3";lsPara+="&Random="+this.sRndData;lsPara+="&Digest="+this.sDigest;lsPara+="&PrvDigest="+this.sPrvDigest;lsPara+="&SerialNum="+this.sSerialNum;}}xmlhttp.open("POST",lsURL,false);xmlhttp.send(lsPara);var xmlDoc=xmlhttp.responseXML;if(null==xmlDoc){return false;}var lonode=xmlDoc.selectSingleNode("/root/valid");if(null==lonode){return false;}if(lonode.text=="1"){return true;}else{return false;}};this.oRockeyLogin=function(psUserName,psPassword){var xmlhttp=oGetXmlHttpRequest();if(xmlhttp==null){return"";}var lsURL=encodeURI(gsOAURL)+"zSysRes.nsf/agtCheckRockey?openagent";var lsPara="&Type=5&SerialNum="+this.sSerialNum+"&UserName="+escape(psUserName)+"&Password="+encodeURIComponent(psPassword);lsURL+="&t="+((new Date()).valueOf());xmlhttp.open("POST",lsURL,false);xmlhttp.send(lsPara);return xmlhttp.responseXML;};}function bSaveSignature(){if(typeof gaSignCtrl=="object"){for(i=0;i<gaSignCtrl.length;i++){if(gaSignCtrl[i].Modify){gaSignCtrl[i].SaveSignature();goForm.s_WebSigned.value="1";}}}return true;}function bWebSignatureModified(){if(typeof gaSignCtrl=="object"){for(i=0;i<gaSignCtrl.length;i++){if(gaSignCtrl[i].Modify){return true;}}}return false;}function bWebScan(){if((typeof(goForm.ScanControl)!="object")||(gbIsEdit==false)){return true;}if((typeof(goForm.UploadControl)!="object")||(gbIsEdit==false)){return true;}var lsFileUpload=goForm.ScanControl.AppStart();if(lsFileUpload.trim()==""){return true;}var laFile=lsFileUpload.split("|");for(i=0;i<laFile.length;i++){goForm.UploadControl.AddLocalFile(laFile[i]);}}function bShowTable(psTitle,psInfo,pvValue){var loWin=new Win();loWin.Name="showtable";loWin.Title=(psTitle==null?"":psTitle);loWin.BodyHTML=(pvValue==null?"":pvValue);loWin.IsTip=true;loWin.Width=700;loWin.Height=480;loWin.Init();loWin.Open();}function oGetWorkField(){var lsURL=encodeURI(gsOAURL)+gsSRDBName+"/agtViewField?OpenAgent&DB="+escape(gsCurURL.substr(1)+gsCurDBName)+"&UNID="+gsCurUNID+"&t="+Math.random();var xmlhttp=oGetXmlHttpRequest();if(xmlhttp==null){return null;}xmlhttp.open("GET",lsURL,false);xmlhttp.send();var loXML=xmlhttp.responseXML;delete xmlhttp;xmlhttp=null;if(loXML==null||loXML.xml==""){return null;}return loXML;}function sGetFormatHTML(piApply,psTH,psData,psLineFlag){var lsContent=psData;var lsTH=psTH;var lsLineFlag=(psLineFlag!=null)?psLineFlag:"\r\n";switch(piApply){case 0:lsTH=sGetLang("P_FORMAT_LICENSEHISTORY");break;case 1:lsTH=sGetLang("P_FORMAT_WORKOPINION");lsContent=sReplaceSubstring(lsContent,"-&gt;","->");lsContent=sReplaceSubstring(lsContent,"&lt;-","<-");lsContent=sReplaceSubstring(lsContent,"->"+lsLineFlag+"[[","</td><td>");lsContent=sReplaceSubstring(lsContent,"->"+lsLineFlag+"[","</td><td>");lsContent=sReplaceSubstring(lsContent,lsLineFlag+"[[","</td></tr><tr><td>{NOTASK}</td><td>");lsContent=sReplaceSubstring(lsContent,lsLineFlag+"[","</td></tr><tr><td>{NOTASK}</td><td>");lsContent=sReplaceSubstring(lsContent,"]][","</td><td>");lsContent=sReplaceSubstring(lsContent,"][","</td><td>");lsContent=sReplaceSubstring(lsContent,"]"+lsLineFlag,"</td></tr><tr><td{BLANK}colspan=3>");lsContent=sReplaceSubstring(lsContent,lsLineFlag+"<-","</td></tr><tr><td>");lsContent="<tr><td>"+lsContent.substring(2,lsContent.length-2)+"</td></tr>";var lsFlag="</td></tr><tr><td>{NOTASK}</td><td>";while(lsContent.indexOf(lsFlag)>-1){var lsLeft=lsContent.substring(0,lsContent.indexOf(lsFlag));var lsRight=lsContent.substring(lsContent.indexOf(lsFlag)+lsFlag.length,lsContent.length);var lsTemp=lsLeft.substring(lsLeft.lastIndexOf("<tr><td>")+8,lsLeft.length);lsTemp=lsTemp.substring(0,lsTemp.indexOf("<"));lsContent=lsLeft+"</td></tr><tr><td>"+lsTemp+"</td><td>"+lsRight;}lsContent=sReplaceSubstring(lsContent,"\n","<BR>");lsContent=sReplaceSubstring(lsContent," ","&nbsp;");lsContent=sReplaceSubstring(lsContent,"{BLANK}"," ");break;case 2:lsTH=sGetLang("P_FORMAT_MONITOROPINION");lsContent=sReplaceSubstring(lsContent,"]][","</td><td>");lsContent=sReplaceSubstring(lsContent,"][","</td><td>");lsContent=sReplaceSubstring(lsContent,"]"+lsLineFlag,"</td></tr><tr><td{BLANK}colspan=2>");lsContent=sReplaceSubstring(lsContent,lsLineFlag+"[[","</td></tr><tr><td>");lsContent=sReplaceSubstring(lsContent,lsLineFlag+"[","</td></tr><tr><td>");if(lsContent.substring(0,2)=="[["){lsContent="<tr><td>"+lsContent.substring(2,lsContent.length)+"</td></tr>";}else{lsContent="<tr><td>"+lsContent.substring(1,lsContent.length)+"</td></tr>";}lsContent=sReplaceSubstring(lsContent,"\n","<BR>");lsContent=sReplaceSubstring(lsContent," ","&nbsp;");lsContent=sReplaceSubstring(lsContent,"{BLANK}"," ");break;case 3:lsContent=sReplaceSubstring(lsContent,lsLineFlag,"</td></tr><tr><td>");lsContent="<tr><td>"+lsContent+"</td></tr>";break;default:return psData;}return"<table style='margin-top:10px;margin-bottom:10px;'>"+lsTH+lsContent+"</table>";}function bPromptField(psFieldName){var loXML=oGetWorkField();if(loXML==null){return false;}var loNode=loXML.selectSingleNode("/Document/Doing");var lsDoings=(loNode!=null)?loNode.text:"";loNode=loXML.selectSingleNode("/Document/Done");var lsDones=(loNode!=null)?loNode.text:"";var lsUser="";if(lsDoings!=""||lsDones!=""){var laUser=new Array();laUser[laUser.length]=lsDoings;laUser[laUser.length]=lsDones;lsUser="\n"+sGetLang("ENGINE_CURTASKUSERS",laUser);}switch(psFieldName.toLowerCase()){case"s_opinions":var lsTitle=sGetLang("ENGINE_UOPINION");loNode=loXML.selectSingleNode("/Document/Opinion");var lsText=(loNode!=null)?loNode.text:"";if(lsText!=""){lsText=lsText.substring(1,lsText.length-1);}lsText=sGetFormatHTML(1,"",lsText,"\n");break;case"s_mopinions":var lsTitle=sGetLang("ENGINE_MOPINION");loNode=loXML.selectSingleNode("/Document/MOpinion");var lsText=(loNode!=null)?loNode.text:"";if(lsText!=""){lsText=lsText.substring(1,lsText.length-1);}lsText=sGetFormatHTML(2,"",lsText,"\n");break;case"s_activities":var lsTitle=sGetLang("ENGINE_HISTORY");loNode=loXML.selectSingleNode("/Document/History");var lsText=(loNode!=null)?loNode.text:"";if(lsText!=""){lsText=lsText.substring(1,lsText.length-1);}lsText+=lsUser;lsText=sGetFormatHTML(3,"",lsText,"\n");break;case"s_process":var lsTitle=sGetLang("ENGINE_PROCESS");loNode=loXML.selectSingleNode("/Document/Opinion");var lsText=(loNode!=null)?loNode.text:"";if(lsText!=""){lsText=lsText.substring(1,lsText.length-1);}var lsOpinion=sGetFormatHTML(1,"",lsText,"\n");loNode=loXML.selectSingleNode("/Document/History");var lsText=(loNode!=null)?loNode.text:"";if(lsText!=""){lsText=lsText.substring(1,lsText.length-1);}lsText+=lsUser;var lsHistory=sGetFormatHTML(3,"",lsText,"\n");lsOpinion=lsOpinion.substring(lsOpinion.indexOf("<tr><td>")+8,lsOpinion.lastIndexOf("</td></tr></table>"));if(lsOpinion!=""){var laValue=lsOpinion.split("</td></tr><tr><td>");var lsSeparator="</td></tr><tr><td colspan=3>";for(var i=0;i<laValue.length;i++){var lsHead=laValue[i].substring(0,laValue[i].indexOf(lsSeparator));var lsCurOpinion=laValue[i].substring(laValue[i].indexOf(lsSeparator)+lsSeparator.length,laValue[i].length);var laHead=lsHead.split("</td><td>");var lsTime=sReplaceSubstring(laHead[2],"&nbsp;"," ");var lsDoUser=(laHead[1].indexOf("&nbsp;")!=-1)?laHead[1].substring(0,laHead[1].indexOf("&nbsp;")):laHead[1];lsHead=lsDoUser+" "+lsTime;if(lsHistory.indexOf(lsHead)==-1){for(var j=1;j<=60;j++){lsHead=lsDoUser+" "+sAdjustDateTime(lsTime,0,0,0,0,0,j);if(lsHistory.indexOf(lsHead)!=-1){break;}lsHead=lsDoUser+" "+sAdjustDateTime(lsTime,0,0,0,0,0,-j);if(lsHistory.indexOf(lsHead)!=-1){break;}}if(j>60){continue;}}var lsBefore=lsHistory.substring(0,lsHistory.indexOf(lsHead));lsBefore=lsBefore.substring(0,lsBefore.lastIndexOf(">")+1);var lsAfter=lsHistory.substring(lsHistory.indexOf(lsHead)+lsHead.length,lsHistory.length);lsAfter=lsAfter.substring(lsAfter.indexOf("<"),lsAfter.length);var lsTemp=lsHistory.substring(lsBefore.length,lsHistory.length-lsAfter.length);lsHistory=lsBefore+"<u>"+lsTemp+"</u><p style='margin-top:-4;margin-bottom:-1;padding-left:2em;line-height:150%;'>"+lsCurOpinion+"</p>"+lsAfter;}}lsText=lsHistory;break;}bShowTable(lsTitle,"",lsText);}var gsCurRtfName="";function EditControl(rtfName,height,width,template,pbInitTemplate,style,firstLine,secondLine,showWidth,showPrintBtn,pbNoCopy,pbIsEdit,pbMultiple){if(rtfName==null){return null;}if(height==null){height=screen.height*0.6;}else{if(height<1){height=screen.height*height;}}if(width==null){width="100%";}if(window.rtfEditor==null){window.rtfEditor=new Object();}var loObject=window.rtfEditor;var lbIsEdit=(pbIsEdit==true||pbIsEdit==false)?pbIsEdit:gbIsEdit;if(lbIsEdit==false){if(showPrintBtn==true){bCreatePrintButton();}var lsURL="/servlet/ShowRtf?open&DB="+gsCurURL.substr(1)+gsCurDBName+"&UNID="+gsCurUNID+"&Rtf="+rtfName;if(style!=null&&style!=""){lsURL+="&style="+style;}if(pbNoCopy==true){lsURL+="&nocopy=1";}if(showWidth!=null&&showWidth!=""){eval("loObject."+rtfName+"_showWidth=showWidth;");}document.write('<IFrame name="h'+rtfName+'Iframe" id="h'+rtfName+'Iframe" src="'+lsURL+'" border=0 Frameborder=0 Scrolling="auto" style="width:'+width+";height:"+height+'"></IFrame>');}else{var lsURL="/icons/icons/Editor/Editor.htm?open&fieldName="+rtfName+((pbMultiple==true)?"&IsMultiple=1":"")+"&Temp="+Math.random();if(style!=null&&style!=""){lsURL+="&style="+style;}if(template!=null&&template!=""){eval("loObject."+rtfName+"_template=template;");}if(pbInitTemplate==true){eval("loObject."+rtfName+"_initTemplate=true;");}if(firstLine!=null&&firstLine!=""){eval("loObject."+rtfName+"_firstLine=firstLine;");}if(secondLine!=null&&secondLine!=""){eval("loObject."+rtfName+"_secondLine=secondLine;");}document.write('<IFrame name="'+rtfName+'EditCtl" id="'+rtfName+'EditCtl" src="'+lsURL+'" border=0 Frameborder=0 Scrolling="no" style="width:'+width+";height:"+height+'"></IFrame>');}if(gsCurRtfName==""){gsCurRtfName=rtfName;}}function PrintView(piAction){if(piAction==0){var lsHTML=eval(gsCurRtfName+"EditCtl.getHTML()");var newwin=window.open("","","status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+screen.width+",height="+screen.height+"'");newwin.document.write(lsHTML);newwin.document.close();newwin.document.title=sGetLang("P_RTF_PRINTVIEW");newwin.status=sGetLang("P_RTF_PRINTSTATUS");}else{var lsURL=eval("h"+gsCurRtfName+"Iframe.location.href");var newwin=window.open(lsURL,"","status=yes,menubar=yes,scrollbars=yes,resizable=yes, width="+screen.width+",height="+screen.height+"'");}}function bSetFontName(fontName,rtfName){var lsName=(rtfName!=null&&rtfName!="")?rtfName:gsCurRtfName;var loRtf=eval(lsName+"EditCtl");loRtf.format("fontname",fontName);}function bSetFontSize(fontSize,rtfName){var lsName=(rtfName!=null&&rtfName!="")?rtfName:gsCurRtfName;var loRtf=eval(lsName+"EditCtl");loRtf.format("fontsize",fontSize);}function bCreatePrintButton(){var lsButton="<td class=MenuInterval nowrap>&nbsp;</td>";lsButton+='<td class=MenuBtn nowrap onMouseDown=\'this.className="MenuBtnInset"\' onMouseUp=\'this.className="MenuBtn"\' onMouseOver=\'this.className="MenuBtnOutset"\' onMouseOut=\'this.className="MenuBtn"\' onclick="top.ContentBody.PrintView(1); return false;"><img src=\''+gsImgURL+"act_print.gif' align='absmiddle'>"+sGetLang("P_RTF_PRINTBODY")+"</td>\n";var lsHTML=top.document.all.ID_Form_MenuBar.innerHTML;var liTemp=lsHTML.toLowerCase().lastIndexOf("<td");lsHTML=lsHTML.substring(0,liTemp)+lsButton+lsHTML.substring(liTemp);top.document.all.ID_Form_MenuBar.innerHTML=lsHTML;}function bShowRtf(rtfName){if(rtfName==""){return false;}var loIframe=eval("window.parent.document.all.h"+rtfName+"Iframe");var hRtfBody=hViewBody;if(typeof hViewBody.offsetHeight=="undefined"){hRtfBody=document.all.hViewBody[0];}if(typeof loIframe=="object"&&typeof hRtfBody.offsetHeight!="undefined"){if(hRtfBody.offsetHeight-(loIframe.offsetHeight-0)>0){loIframe.style.height=hRtfBody.offsetHeight+100;}if(document.body.offsetHeight<=loIframe.offsetHeight-0){var lsWidth=eval("parent.rtfEditor."+rtfName+"_showWidth");if(lsWidth!=null){lsWidth=lsWidth+"";if(lsWidth.indexOf("%")!=-1){var liWidth=(lsWidth.substring(0,lsWidth.indexOf("%"))-0)/100;}else{var liWidth=lsWidth-0;}if(liWidth<1){hRtfBody.style.width=loIframe.offsetWidth*liWidth;}else{hRtfBody.style.width=liWidth;}}else{if(loIframe.offsetWidth!=0){hRtfBody.style.width=loIframe.offsetWidth-20;}}}}var loObject=hRtfBody.children[0].children[0].children[0];if(loObject.children.length>1&&loObject.children[1].tagName=="TABLE"){loObject=loObject.children[1].children[0].children[0].children[0];var lsColor=loObject.bgColor;if((lsColor==null||lsColor=="")&&loObject.style.backgroundColor!=""){lsColor=loObject.style.backgroundColor;}document.body.style.backgroundColor=lsColor;}return true;}function bUpdateImgUrl(poDocument,psURLPath,psFileNames,paCopyPath,paCopyFile){var lodoc=(poDocument==null)?window.document:poDocument;var lsUrlPath=(psURLPath==null)?hImgUrlPath.innerText:psURLPath;var lsFileNames=(psFileNames==null)?hImgNames.innerText:"|"+sReplaceSubstring(psFileNames," ","%20")+"|";for(i=0;i<lodoc.images.length;i++){var lsName="/"+lodoc.images[i].src;lsName=lsName.substr(lsName.lastIndexOf("/")+1);var lsCopyPath=sGetCopyURLPath(sReplaceSubstring(lsName,"%20"," "),paCopyPath,paCopyFile);if(lsCopyPath!=null&&lsCopyPath!=""){lodoc.images[i].src=lsCopyPath+lsName;}else{if(lsFileNames.indexOf("|"+lsName+"|")!=-1){lodoc.images[i].src=lsUrlPath+lsName;}}}var attFiles=lodoc.getElementsByName("D_attFiles");if(attFiles!=null){for(i=0;i<attFiles.length;i++){var lsName=attFiles[i].href.substr(attFiles[i].href.lastIndexOf("/")+1);var lsCopyPath=sGetCopyURLPath(sReplaceSubstring(lsName,"%20"," "),paCopyPath,paCopyFile);if(lsCopyPath!=null&&lsCopyPath!=""){attFiles[i].href=lsCopyPath+lsName;}else{if(lsFileNames.indexOf("|"+lsName+"|")!=-1){attFiles[i].href=lsUrlPath+lsName;}}}}var embFiles=lodoc.getElementsByName("D_embFiles");if(embFiles!=null){for(i=0;i<embFiles.length;i++){var lsName=embFiles[i].src.substr(embFiles[i].src.lastIndexOf("/")+1);var lsCopyPath=sGetCopyURLPath(lsName,paCopyPath,paCopyFile);if(lsCopyPath!=null&&lsCopyPath!=""){embFiles[i].src=lsCopyPath+lsName;}else{if(lsFileNames.indexOf("|"+sReplaceSubstring(lsName," ","%20")+"|")!=-1){embFiles[i].src=lsUrlPath+lsName;}}}}var flashFiles=lodoc.getElementsByName("D_flashFiles");if(flashFiles!=null){for(i=0;i<flashFiles.length;i++){var lsName=flashFiles[i].movie;if(lsName.indexOf(lsUrlPath)==-1){var lsHTML=flashFiles[i].outerHTML;var lsCopyPath=sGetCopyURLPath(lsName,paCopyPath,paCopyFile);if(lsCopyPath!=null&&lsCopyPath!=""){flashFiles[i].outerHTML=sReplaceSubstring(lsHTML,lsName,lsCopyPath+lsName);}else{if(lsFileNames.indexOf("|"+sReplaceSubstring(lsName," ","%20")+"|")!=-1){flashFiles[i].outerHTML=sReplaceSubstring(lsHTML,lsName,lsUrlPath+lsName);}}}}}}function sGetCopyURLPath(psName,paCopyPath,paCopyFile){if(paCopyFile==null){return null;}for(var i=0;i<paCopyFile.length;i++){if(paCopyFile[i].toLowerCase()==psName.toLowerCase()){return paCopyPath[i];}}return null;}function sGetMultipleRtfPath(poObj,psName){if(poObj==null){return null;}while(poObj=poObj.parentElement){if(poObj.UNID!=null&&poObj.UNID!=""&&poObj.URLPath!=null&&poObj.URLPath!=""&&poObj.attachNames!=null&&poObj.attachNames.indexOf("|"+psName+"|")!=-1){return poObj.URLPath;}}return null;}function bIsMultipleRtfObj(poObj){if(poObj==null){return null;}while(poObj=poObj.parentElement){if(poObj.UNID!=null&&poObj.UNID!=""&&poObj.URLPath!=null&&poObj.URLPath!=""){return true;}}return false;}function bUpdateMultipleRtf(){var lsName,lsPath;var lodoc=window.document;for(i=0;i<lodoc.images.length;i++){lsName="/"+lodoc.images[i].src;lsName=lsName.substr(lsName.lastIndexOf("/")+1);lsPath=sGetMultipleRtfPath(lodoc.images[i],lsName);if(lsPath!=null){lodoc.images[i].src=lsPath+lsName;}}var attFiles=lodoc.getElementsByName("D_attFiles");if(attFiles!=null){for(i=0;i<attFiles.length;i++){lsName=attFiles[i].href.substr(attFiles[i].href.lastIndexOf("/")+1);lsPath=sGetMultipleRtfPath(attFiles[i],lsName);if(lsPath!=null){attFiles[i].href=lsPath+lsName;}}}var embFiles=lodoc.getElementsByName("D_embFiles");if(embFiles!=null){for(i=0;i<embFiles.length;i++){lsName=embFiles[i].src.substr(embFiles[i].src.lastIndexOf("/")+1);lsPath=sGetMultipleRtfPath(embFiles[i],lsName);if(lsPath!=null){embFiles[i].src=lsPath+lsName;}}}var flashFiles=lodoc.getElementsByName("D_flashFiles");if(flashFiles!=null){for(i=0;i<flashFiles.length;i++){lsName=flashFiles[i].movie;lsPath=sGetMultipleRtfPath(flashFiles[i],lsName);if(lsPath!=null&&lsName.indexOf(lsPath)==-1){var lsHTML=flashFiles[i].outerHTML;flashFiles[i].outerHTML=sReplaceSubstring(lsHTML,lsName,lsPath+lsName);}}}for(i=0;i<lodoc.links.length;i++){if(lodoc.links[i].href!=""&&lodoc.links[i].href!="#"&&lodoc.links[i].onclick==null&&lodoc.links[i].target!="_blank"&&bIsMultipleRtfObj(lodoc.links[i])==true){lodoc.links[i].target="_blank";}}}var goComment=new Object();goComment.CMPageCur=1;goComment.CMPageTotal=1;goComment.CMCountPerPage=5;goComment.CMPCount=7;goComment.CMCountDisplay=0;goComment.CMCount=0;goComment.CMHeightDsp=100;goComment.CMHeight=205;goComment.CMWidth="100%";goComment.CMShow=true;function CM_hide(psID){var loObject=document.getElementById(psID);if(null!=loObject){loObject.style.display=(loObject.style.display=="none")?"":"none";}}function CM_swap(psID,psItem,psSource,psTarget){var loObject=document.getElementById(psID);if(null!=loObject){loObject[psItem]=(loObject[psItem]==psSource)?psTarget:psSource;}}function Comment(piWidth,piHeightDsp,piHeight,piCountPerPage,piPageCount,pbShowCM){if(piWidth!=null){if(piWidth>1){goComment.CMWidth=piWidth+"px";}else{goComment.CMWidth=(piWidth*100)+"%";}}if(piHeightDsp!=null){goComment.CMHeightDsp=piHeightDsp;}if(piHeight!=null){goComment.CMHeight=piHeight;}if(piCountPerPage!=null){goComment.CMCountPerPage=piCountPerPage;}if(piPageCount!=null){goComment.CMPCount=piPageCount;}if(pbShowCM!=null){goComment.CMShow=pbShowCM;}var lsSearch=document.location.search;if(document.location.search.toLowerCase().indexOf("?openform")!=-1){return false;}var lsCssLink='<link rel="Stylesheet" type="text/css" media="all" href="'+gsImgURL+'comment.css">';document.write(lsCssLink);document.write('<div style="width:'+goComment.CMWidth+";"+((!goComment.CMShow)?"display:none;":"")+'" id="cm'+gsCurUNID+'">');document.write('<table align="center" border="0" cellpadding="0" cellspacing="0" class="dashed"><tr><td></td></tr></table>');document.write('<table align="center" border="0" cellpadding="0" cellspacing="0" class="cmfunction"><tr><td><span id=cmpoint'+gsCurUNID+'></span><a href="javascript:;" onclick="CM_hide(\'comment'+gsCurUNID+'\')" title="'+sGetLang("CM_COMMENTHINT")+'">'+sGetLang("CM_COMMENT")+"(<font id=cmcc"+gsCurUNID+">0</font>)</a>"+sGetLang("CM_SEP")+sGetLang("CM_READ")+"(<font id=cmrc"+gsCurUNID+">0</font>)"+sGetLang("CM_SEP")+'<a href="javascript:;" onclick="ReadComment();" title="'+sGetLang("CM_REFRESHHINT")+'">'+sGetLang("CM_REFRESH")+"</a></td></tr></table>");document.write('<table align="center" border="0" cellpadding="0" cellspacing="0" class="comment"><tr><td class="bordernone"><div id="comment'+gsCurUNID+'">');document.write("</div></td></tr></table>");document.write("</div>");document.write('<iframe id="RunComment" src="" style="display:none" width=100 height=100  Frameborder=No Border=1 Marginwidth=0 Marginheight=0 Scrolling=no></iframe>');document.write('<iframe id="RunEditComment" src="" style="display:none" width=100 height=100  Frameborder=No Border=1 Marginwidth=0 Marginheight=0 Scrolling=no></iframe>');var lbRead=(top.ReadComment=="1")?false:true;if(!lbRead&&gbIsEdit){window.attachEvent("onbeforeunload",LockArticle);LockArticle(true);}else{ReadComment(false,lbRead);}top.ReadComment="1";return this;}function LockArticle(pbLock){var lbLock=(pbLock==true)?true:false;var lsLink="&UNID="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;var lsURL=gsOAURL+sGetLang("DB_NAME_CM")+"/agtReadArticle?OpenAgent&Action=";if(lbLock){lsURL+="Lock";lsURL+=lsLink;RunEditComment.location.replace(lsURL);}else{lsURL+="unLock";lsURL+=lsLink;var xmlhttp=oGetXmlHttpRequest();xmlhttp.open("GET",lsURL,false);xmlhttp.send("");}}function ReadComment(pbLast,pbFirstTimes){if(pbLast){goComment.CMPageCur=Math.ceil((goComment.CMCount+1)/goComment.CMCountPerPage);}var lsLink="&UNID="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;if(pbFirstTimes&&gbIsEdit){var lsURL=gsOAURL+sGetLang("DB_NAME_CM")+"/agtReadArticle?OpenAgent&Action=Read"+lsLink;RunEditComment.location.replace(lsURL);}else{var lsURL="/servlet/Comment?open&Action=Show&User="+gsCurUser+lsLink;if(pbFirstTimes){lsURL+="&Read=1";}else{if(gbIsEdit){lsURL+="&Edit=1";}}lsURL+="&Page="+goComment.CMPageCur+"&Count="+goComment.CMCountPerPage;RunComment.location.replace(lsURL);}}function DelComment(psUNID){if(psUNID==null||psUNID==""){return false;}if(!confirm(sGetLang("CM_DELCONFIRM"))){return false;}var lsLink="&ArticleUNID="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;if(gbIsEdit){var lsURL=gsOAURL+sGetLang("DB_NAME_CM")+"/agtReadArticle?OpenAgent&Action=Del&UNID="+psUNID+lsLink;RunEditComment.location.replace(lsURL);}else{var lsURL="/servlet/Comment?open&Action=Del&User="+((gbIsEdit)?"":gsCurUser)+"&UNID="+psUNID+lsLink;RunComment.location.replace(lsURL);}}function ModifyComment(psUNID){if(psUNID==null||psUNID==""){return false;}var lsLink=psUNID;var lsDBName=lsLink.substr(0,lsLink.lastIndexOf("-"));var lsUNID=lsLink.substr(lsLink.lastIndexOf("-")+1);var lsURL=lsDBName+"/0/"+lsUNID+"?EditDocument&ArticleLink="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;if(gbIsEdit){lsURL+="&Edit=1";}CommentBodyFrame.location.replace(lsURL);}function ShowComment(psXML){if(!goComment.CMShow){return false;}var lsXML=(psXML==null)?RunComment.ResultXML.innerHTML:psXML;var xmlDoc=new ActiveXObject("Msxml2.DOMDocument");xmlDoc.async=false;xmlDoc.loadXML(lsXML);var loNode=xmlDoc.selectSingleNode("/COMMENT/ReadCount");if(loNode!=null){var loNodeReadCount=document.getElementById("cmrc"+gsCurUNID);loNodeReadCount.innerText=loNode.text;}var loNode=xmlDoc.selectSingleNode("/COMMENT/CMCount");if(loNode!=null){goComment.CMCount=loNode.text-0;var loNodeCommentCount=document.getElementById("cmcc"+gsCurUNID);loNodeCommentCount.innerText=goComment.CMCount;}var loNode=xmlDoc.selectSingleNode("/COMMENT/CMDBName");if(loNode!=null){var lsCMDB=loNode.text;var lsDBName=(loNode.text.indexOf("\\")==-1&&loNode.text.indexOf("/")==-1)?(gsOAURL+loNode.text):sReplaceSubstring(loNode.text,"\\","/");if(lsDBName.indexOf("/")!=0){lsDBName="/"+lsDBName;}}var loNode=xmlDoc.selectSingleNode("/COMMENT/CMForm");if(loNode!=null){var lsFormName=loNode.text;}var loNodePTable=xmlDoc.selectSingleNode("/COMMENT/CMPoint");if(loNodePTable!=null&&loNodePTable.text!=""){var loNodePoint=xmlDoc.selectSingleNode("/COMMENT/APoint");var lfPoint=(loNodePoint!=null&&loNodePoint.text!="")?(loNodePoint.text-0):0;var liPoint=Math.round(lfPoint);var laTable=loNodePTable.text.split("$$");var lsPointHTML="";var liPointMax=0;for(var i=0;i<laTable.length;i++){var lsKey=laTable[i].substr(0,laTable[i].indexOf("||"));var lsPointValue=laTable[i].substr(laTable[i].indexOf("||")+2);if((lsPointValue-0)>liPointMax){liPointMax=lsPointValue-0;}if(lsPointValue==liPoint){lsPointHTML+='<input type="radio" name="DPointItem" value="'+lsPointValue+'" checked class="radio">'+lsKey;}else{lsPointHTML+='<input type="radio" name="DPointItem" value="'+lsPointValue+'" class="radio">'+lsKey;}}lsPointHTML+=" ("+lfPoint+"/"+liPointMax+sGetLang("CM_DISPLAYPOINT")+")"+sGetLang("CM_SEP");var loNodePointDisplay=document.getElementById("cmpoint"+gsCurUNID);loNodePointDisplay.innerHTML=lsPointHTML;}if(lsDBName==null||lsFormName==null){return false;}lsHTML='<table class="comment sysHand" align="center" cellpadding="0" cellspacing="0" border=0><tr onclick="CM_hide(\'commentBody'+gsCurUNID+"');CM_swap('commentTitle"+gsCurUNID+"','className','upright','downright');\" class=\"title\"><td class=\"left\"></td><td class=\"mid\">"+sGetLang("CM_DOCCOMMENT")+'</td><td id="commentTitle'+gsCurUNID+'" class="upright"></td></tr></table>';lsHTML+='<div id="commentBody'+gsCurUNID+'">';lsHTML+='<table width=100% class=bordernone style="margin-top:0px;"><tr height="12"><td></td></tr></table>';var loNode=xmlDoc.selectSingleNode("/COMMENT/COMMENTCOLLECTION");if(null!=loNode){goComment.CMCountDisplay=loNode.childNodes.length;for(var i=0;i<loNode.childNodes.length;i++){var loNodeUNID=loNode.childNodes[i].selectSingleNode("commentUNID");lsUNID=(loNodeUNID==null)?"":loNodeUNID.text;var lsUserName=loNode.childNodes[i].selectSingleNode("commentUser").text;var lsPubTime=loNode.childNodes[i].selectSingleNode("commentDate").text+" "+loNode.childNodes[i].selectSingleNode("commentTime").text;var loNodeBody=loNode.childNodes[i].selectSingleNode("commentBody");lsBody=(loNodeBody==null)?"":loNodeBody.text;lsHTML+='<div id="commentItem'+gsCurUNID+'">';lsHTML+='<table class="sysHand item" align="center" cellpadding="0" cellspacing="0"><tr onclick="CM_hide(\'commentItemBody'+gsCurUNID+(i+1)+"');CM_swap('commentItemTitle"+gsCurUNID+(i+1)+"','className','iupright','idownright')\" class=\"iTitle\"><td class=\"ileft\"></td><td class=\"imid\">"+lsUserName+'</td><td id="commentItemTitle'+gsCurUNID+(i+1)+'" class="iupright"></td></tr></table>';lsHTML+='<div id="commentItemBody'+gsCurUNID+(i+1)+'">';lsHTML+='<table class="item" align="center" cellpadding="0" cellspacing="0"><tr><td align="center">';var loNodeRight=loNode.childNodes[i].selectSingleNode("commentRight");var lsRight=(loNodeRight==null)?"":loNodeRight.text;var lsMTD=(lsRight.indexOf("M")!=-1)?('&nbsp;<a href="#FSComment" onclick="ModifyComment(\''+lsDBName+"-"+lsUNID+'\');" title="'+sGetLang("CM_MODIFYHINT")+'"><img src="'+gsImgURL+'cm_modify.gif"></a>'):"";var lsDTD=(lsRight.indexOf("D")!=-1)?('&nbsp;<a href="#comment" onclick="DelComment(\''+sReplaceSubstring(lsCMDB,"\\","/")+"-"+lsUNID+'\');return false;" title="'+sGetLang("CM_DELETEHINT")+'"><img src="'+gsImgURL+'cm_del.gif"></a>'):"";lsHTML+='<table class="itemBody" align="center" border="0" cellpadding="0" cellspacing="0"><tr><td class="iPubdate" style="padding-right: 21px;">'+lsPubTime+lsMTD+lsDTD+'</td></tr><tr><td class="iText">';var lsURL=lsDBName+"/0/"+lsUNID+"?OpenDocument&ArticleLink="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;lsHTML+='<iframe src="'+lsURL+'" id="Body'+(i+1)+'" width=100% height='+goComment.CMHeightDsp+'px style="overflow : visible;" Frameborder=No Border=0 Marginwidth=0 Marginheight=0 Scrolling=auto></iframe>';lsHTML+="</td></tr></table></td></tr></table>";lsHTML+="</div>";lsHTML+="</div>";lsHTML+='<table class="item" align="center" cellpadding="0" cellspacing="0"><tr><td class="iBottom"></td></tr></table><table width=100% class=bordernone style="margin-top:0px;"><tr height="12"><td></td></tr></table>';}}goComment.CMPageTotal=(goComment.CMCount!=0)?Math.ceil(goComment.CMCount/goComment.CMCountPerPage):goComment.CMPageTotal;var liEnd=goComment.CMPageCur+((goComment.CMPCount%2==0)?(goComment.CMPCount-1-Math.ceil(goComment.CMPCount/2)):(goComment.CMPCount-Math.ceil(goComment.CMPCount/2)));liEnd=(liEnd>goComment.CMPageTotal)?goComment.CMPageTotal:liEnd;if(liEnd<goComment.CMPCount&&goComment.CMPageTotal>=goComment.CMPCount){liEnd=goComment.CMPCount;}var liStart=liEnd-goComment.CMPCount+1;if(liStart<1){liStart=1;}lsHTML+='<div class="dashed"></div>';lsHTML+='<div class="page" align="center">';lsHTML+="<a>"+sGetLang("CM_PAGESTART")+" ("+goComment.CMPageCur+"/"+goComment.CMPageTotal+") "+sGetLang("CM_PAGE")+"</a>";if(goComment.CMPageCur>1){lsHTML+='<a href="#comment" onClick="goComment.CMPageCur--;ReadComment();return false;">&lt;&lt;</a>';}for(var j=liStart;j<=liEnd;j++){if(j==goComment.CMPageCur){lsHTML+="<span>"+j+"</span>";}else{lsHTML+='<a href="#comment" onClick="goComment.CMPageCur='+j+';ReadComment();return false;">'+j+"</a>";}}if(goComment.CMPageCur<goComment.CMPageTotal){lsHTML+='<a href="#comment" onClick="goComment.CMPageCur++;ReadComment();return false;">&gt;&gt;</a>';}lsHTML+="</div>";lsHTML+='<a name="FSComment">&nbsp;</a>';lsHTML+='<fieldset class="postFSet"><legend>'+sGetLang("CM_POSTCOMMENT")+"</legend>";var lsURL=lsDBName+"/"+lsFormName+"?OpenForm&ArticleLink="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;if(gbIsEdit){lsURL+="&Edit=1";}lsHTML+='<iframe src="'+lsURL+'" id="CommentBodyFrame" width=100% height='+goComment.CMHeight+"px Frameborder=No Border=1 Marginwidth=0 Marginheight=0 Scrolling=Auto></iframe>";lsHTML+="</fieldset>";lsHTML+="</div>";var loNodeComment=document.getElementById("comment"+gsCurUNID);loNodeComment.innerHTML=lsHTML;}function Correlate(psRuleID,piWidth,piCountPerPage,piPageCount){this.liCOPageCur=1;this.liCOPageTotal=1;this.liCOCountPerPage=5;this.liCOPCount=7;this.liCOCountDisplay=0;this.liCOCount=0;this.lsCOWidth="100%";this.lsCORuleID="";this.liCStyle=1;this.xmlhttp=null;this.SourceView=new Array();this.ReadCorrelate=ReadCorrelate;this.ShowCorrelate=ShowCorrelate;this.AddCorrelate=AddCorrelate;this.DelCorrelate=DelCorrelate;if(document.location.search.toLowerCase().indexOf("?openform")!=-1){return false;}if(psRuleID==null||psRuleID==""){return false;}else{this.lsCORuleID=psRuleID;}if(piWidth!=null){if(piWidth>1){this.lsCOWidth=piWidth+"px";}else{this.lsCOWidth=(piWidth*100)+"%";}}if(piCountPerPage!=null){this.liCOCountPerPage=piCountPerPage;}if(piPageCount!=null){this.liCOPCount=piPageCount;}var lsCssLink='<link rel="Stylesheet" type="text/css" media="all"  href="'+gsImgURL+'correlate.css">';document.write(lsCssLink);document.write('<div style="width:'+this.lsCOWidth+';" id="co'+this.lsCORuleID+'">');document.write('<table align="center" cellpadding="0" cellspacing="0"><tr><td style="padding:0px">');document.write('<table style="width:100%" border=0 class=BorderNone><tr><td width="31" height="24" class="crTitle"><img src="'+gsImgURL+'ico_area.gif"></td><td class="crTitle" id=coTitle'+this.lsCORuleID+"></td></tr></table>");document.write("</td></tr>");document.write('<tr><td id="coBody'+this.lsCORuleID+'" class=clsBody></td></tr>');document.write("<tr><td id=coPage"+this.lsCORuleID+"></td></tr>");document.write("</table></div>");this.ReadCorrelate();eval("CORelate_"+this.lsCORuleID+"=this;");function ReadCorrelate(piCountAdd){if(piCountAdd!=null){if(piCountAdd>=0){this.liCOPageCur=Math.ceil((this.liCOCount+piCountAdd)/this.liCOCountPerPage);}else{if(this.liCOPageCur==this.liCOPageTotal&&(this.liCOCountDisplay+piCountAdd)<=0&&this.liCOPageCur!=1){this.liCOPageCur--;}}}this.xmlhttp=oGetXmlHttpRequest();if(this.xmlhttp!=null){var lsLink="&UNID="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;var lsRuleID="&RuleID="+this.lsCORuleID;var lsURL=gsOAURL+"zCM.nsf/agtReadCoDocument?OpenAgent"+lsLink+lsRuleID+"&t="+((new Date()).valueOf());lsURL+="&Page="+this.liCOPageCur+"&Count="+this.liCOCountPerPage;this.xmlhttp.open("GET",lsURL,false);this.xmlhttp.send("");this.ShowCorrelate();}}function AddCorrelate(){var lsSourceView="";if(this.SourceView.length==1){lsSourceView=this.SourceView[0].substring(this.SourceView[0].indexOf("|")+1);}else{var lsViews="";for(var i=0;i<this.SourceView.length;i++){if(lsViews==""){lsViews=this.SourceView[i];}else{lsViews+=";"+this.SourceView[i];}}lsSourceView=sSelectArray("Single",sGetLang("CM_TITLETVIEWNAME"),sGetLang("CM_PROMPTVIEWNAME"),lsViews,false);if(lsSourceView==null){lsSourceView="";}}if(lsSourceView!=""){var lsDBPath=lsSourceView.substring(0,lsSourceView.indexOf("|"));var lsViewForm=lsSourceView.substring(lsSourceView.indexOf("|")+1);var lsResult=PromptView(true,"",gsOAURL+lsDBPath+"/"+lsViewForm+"?OpenForm","",true);if(lsResult==null||lsResult==""){return false;}var liCountAdd=lsResult.split(";").length;var lsLink="&UNID="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;var lsRuleID="&RuleID="+this.lsCORuleID;var lsURL=gsOAURL+"zCM.nsf/agtSetCoDocument?OpenAgent"+lsLink+lsRuleID+"&COAdd="+lsResult+"&t="+((new Date()).valueOf());if(this.xmlhttp!=null){this.xmlhttp.open("GET",lsURL,false);this.xmlhttp.send("");this.ReadCorrelate(liCountAdd);}}}function DelCorrelate(){var lsIDs="";for(var i=0;i<goForm.elements.length;i++){if(goForm.elements[i].type!="checkbox"){continue;}if(goForm.elements[i].name!="$$CoSelectDoc"){continue;}if(goForm.elements[i].checked!=true){continue;}if(lsIDs==""){lsIDs=goForm.elements[i].value;}else{lsIDs+=";"+goForm.elements[i].value;}}var lsLink="&UNID="+sReplaceSubstring(gsCurURL,"/","\\").substr(1)+gsCurDBName+"-"+gsCurUNID;var lsRuleID="&RuleID="+this.lsCORuleID;var lsURL=gsOAURL+"zCM.nsf/agtSetCoDocument?OpenAgent"+lsLink+lsRuleID+"&CODel="+lsIDs+"&t="+((new Date()).valueOf());var liCountAdd=0-lsIDs.split(";").length;if(this.xmlhttp!=null){this.xmlhttp.open("GET",lsURL,false);this.xmlhttp.send("");this.ReadCorrelate(liCountAdd);}}function ShowCorrelate(){if(this.xmlhttp.readyState!=4||this.xmlhttp.status!=200){return false;}var lsXML=this.xmlhttp.responseText;var xmlDoc=new ActiveXObject("Msxml2.DOMDocument");xmlDoc.async=false;xmlDoc.loadXML(lsXML);var loNode=xmlDoc.selectSingleNode("/CORRELATE/CStyle");if(loNode!=null){this.liCStyle=loNode.text-0;}var loNode=xmlDoc.selectSingleNode("/CORRELATE/Title");if(loNode!=null){var loTitleNode=document.getElementById("coTitle"+this.lsCORuleID);loTitleNode.innerText=loNode.text;}var loNode=xmlDoc.selectSingleNode("/CORRELATE/Count");if(loNode!=null){this.liCOCount=loNode.text-0;}var loNode=xmlDoc.selectSingleNode("/CORRELATE/CoRules");if(loNode!=null){for(var i=0;i<loNode.childNodes.length;i++){var loNodeDB=loNode.childNodes[i].selectSingleNode("SourceDB");var loNodeForm=loNode.childNodes[i].selectSingleNode("SourceViewForm");var loNodeMemo=loNode.childNodes[i].selectSingleNode("SourceMemo");this.SourceView[i]=loNodeMemo.text+"|"+loNodeDB.text+"|"+loNodeForm.text;}}var lsHTML='<table border=0 style="width:100%;" class="bordernone">';if(this.liCStyle!=1&&gbIsEdit){lsHTML+="<tr><td colspan=3>";lsHTML+='<input type=button class=Control value="'+sGetLang("CM_ACTIONADD")+'" onclick="CORelate_'+this.lsCORuleID+'.AddCorrelate();return false;">';lsHTML+='&nbsp;<input type=button class=Control value="'+sGetLang("CM_ACTIONDEL")+'" onclick="CORelate_'+this.lsCORuleID+'.DelCorrelate();return false;">';lsHTML+="</td></tr>";}var loNode=xmlDoc.selectSingleNode("/CORRELATE/CORRELATECOLLECTION");if(null!=loNode){this.liCOCountDisplay=loNode.childNodes.length;for(var i=0;i<loNode.childNodes.length;i++){var loNodeSubject=loNode.childNodes[i].selectSingleNode("Subject");var lsSubject=(loNodeSubject==null)?"":loNodeSubject.text;var loNodePath=loNode.childNodes[i].selectSingleNode("DBPath");var lsDBPath=(loNodePath==null)?"":sReplaceSubstring(loNodePath.text,"\\","/");var loNodeUNID=loNode.childNodes[i].selectSingleNode("UNID");var lsUNID=(loNodeUNID==null)?"":loNodeUNID.text;var loNodeNoteID=loNode.childNodes[i].selectSingleNode("NoteID");var lsNoteID=(loNodeNoteID==null)?"":loNodeNoteID.text;var loNodeLinkUNID=loNode.childNodes[i].selectSingleNode("LinkUNID");var lsLinkUNID=(loNodeLinkUNID==null)?"":loNodeLinkUNID.text;var loNodeAction=loNode.childNodes[i].selectSingleNode("Action");var lsAction=(loNodeAction==null)?"":loNodeAction.text;var loNodeDateType=loNode.childNodes[i].selectSingleNode("DateType");var lsDateType=(loNodeDateType==null)?"":loNodeDateType.text;var loNodeArgument=loNode.childNodes[i].selectSingleNode("Argument");var lsArgument=(loNodeArgument==null)?"":loNodeArgument.text;lsHTML+="<tr style='width:100%;'>";if(this.liCStyle!=1&&gbIsEdit){lsHTML+="<td style='width:14px'><INPUT TYPE=checkbox NAME='$$CoSelectDoc' VALUE='"+lsDBPath+"|"+lsUNID+"-"+lsNoteID+"-"+lsLinkUNID+"|"+lsArgument+"' style='width:14px'></td>";}lsHTML+="<td width=12 class=Entry_TD><img src='"+gsImgURL+"ico_list_red.gif'></td><td class=Entry_TD style='width:100%'><a href='#' DataType='2' eDB='"+lsDBPath+"' eUNID='"+lsUNID+"' NTID='"+lsNoteID+"' eLinkUNID='"+lsLinkUNID+"' "+lsArgument+" onClick='bOpenViewEntry(this);return false;'>"+lsSubject+"</a></td>";lsHTML+="</tr>";}}lsHTML+="</table>";var loNodeCoBody=document.getElementById("coBody"+this.lsCORuleID);loNodeCoBody.innerHTML=lsHTML;this.liCOPageTotal=(this.liCOCount!=0)?Math.ceil(this.liCOCount/this.liCOCountPerPage):this.liCOPageTotal;var liEnd=this.liCOPageCur+((this.liCOPCount%2==0)?(this.liCOPCount-1-Math.ceil(this.liCOPCount/2)):(this.liCOPCount-Math.ceil(this.liCOPCount/2)));liEnd=(liEnd>this.liCOPageTotal)?this.liCOPageTotal:liEnd;if(liEnd<this.liCOPCount&&this.liCOPageTotal>=this.liCOPCount){liEnd=this.liCOPCount;}var liStart=liEnd-this.liCOPCount+1;if(liStart<1){liStart=1;}var lsPageHTML='<div class="page" align="center">';lsPageHTML+="<a>"+sGetLang("CM_PAGESTART")+" ("+this.liCOPageCur+"/"+this.liCOPageTotal+") "+sGetLang("CM_PAGE")+"</a>";if(this.liCOPageCur>1){lsPageHTML+='<a href="#comment" onClick="CORelate_'+this.lsCORuleID+".liCOPageCur--;CORelate_"+this.lsCORuleID+'.ReadCorrelate();return false;">&lt;&lt;</a>';}for(var j=liStart;j<=liEnd;j++){if(j==this.liCOPageCur){lsPageHTML+="<span>"+j+"</span>";}else{lsPageHTML+='<a href="#comment" onClick="CORelate_'+this.lsCORuleID+".liCOPageCur="+j+";CORelate_"+this.lsCORuleID+'.ReadCorrelate();return false;">'+j+"</a>";}}if(this.liCOPageCur<this.liCOPageTotal){lsPageHTML+='<a href="#comment" onClick="CORelate_'+this.lsCORuleID+".liCOPageCur++;CORelate_"+this.lsCORuleID+'.ReadCorrelate();return false;">&gt;&gt;</a>';}lsPageHTML+="</div>";var loNodeCoPage=document.getElementById("coPage"+this.lsCORuleID);loNodeCoPage.innerHTML=lsPageHTML;}}
