如何能将标记,循环累加的值存住

在xml中写的代码

 var strSpace = "";
//用来标记交际费用弹出的次数 默认是0
var CosttimeNo=0;
alert("当前弹出提示的次数是"+CosttimeNo);
//当前时间大于(交际费)申请时间,并且是交际费,走的是交际费用
  if(editorTo.getValue() != "S10" && "${Request.checkBeginDateFlag}" == "1")
        {
        if(CosttimeNo==0){
        //当点击的按钮是同意审批 
           alert("${Resource.process.PROC_SUBMIT_AGREE_MESSAGE}");
           //显示在审批意见文本对话框中自动添加下面一条语句
           document.getElementById("editorCommentContent").innerHTML = document.getElementById("editorCommentContent").innerHTML + "${Resource.process.PROC_SUBMIT_AGREE_TEXT}";
           datasetComment.setValue("commentContent",document.getElementById("editorCommentContent").innerHTML);
         }
         CosttimeNo++;
        }

        if(editorTo.getValue()== "S10" ){ 
            document.getElementById("editorCommentContent").innerHTML = document.getElementById("editorCommentContent").innerHTML.replace("${Resource.process.PROC_SUBMIT_AGREE_TEXT}","");
            datasetComment.setValue("commentContent",document.getElementById("editorCommentContent").innerHTML);
            CosttimeNo=0; 
        }     
        alert("CosttimeNo"+CosttimeNo);

图片说明
关闭这个页面或者退出这一级审批人 登录下一个审批人 标记又是0;如何能存住 当累加 请各位大神帮帮忙 代码怎么改动一下

http://www.thinksaas.cn/group/topic/285393/