var sScreenWidth = screen.availWidth; var sScreenHeight = screen.availHeight; var sDefaultDialogStyle= "dialogWidth="+sScreenWidth+"px;dialogHeight="+sScreenHeight+"px;resizable=yes;maximize:yes;help:no;status:no;"; var OpenStyle="width="+sScreenWidth+"px,height="+sScreenHeight+"px,top=0,left=0,toolbar=no,scrollbars=yes,resizable=yes,status=no,menubar=no"; var sDefaultModelessDialogStyle = "dialogLeft="+(sScreenWidth*0.6)+";dialogWidth="+(sScreenWidth*0.4)+"px;dialogHeight="+(sScreenHeight)+"px;resizable=yes;status:yes;maximize:yes;help:no;"; function over_change(index,src,clrOver){ if (!src.contains(event.fromElement)){ src.style.cursor = 'pointer'; src.background = clrOver; } } function out_change(index,src,clrIn){ if (!src.contains(event.toElement)){ src.style.cursor = 'default'; src.background = clrIn; } } bIsLocked=false; function checkIfLocked(){ if(bIsLocked){ if(!confirm("您已经用弹出方式打开了一个新页面,离开本页面将可能导致出错。\n该错误将不会影响系统正常运行。\n您确定要离开本页面吗?")) return true; else return false; }else return true; } //日期检查函数 function isDate(value,separator){ if(typeof separator != "string" || typeof value != "string" || value.length<10) return false; if(separator != "." && value.indexOf(".") > -1) return false; var sItems = value.split(separator); // value.split("/"); if (sItems.length!=3) return false; if (isNaN(sItems[0])) return false; if (isNaN(sItems[1])) return false; if (isNaN(sItems[2])) return false; //年份必须为4位,月份和日必须为2位 if (sItems[0].length!=4) return false; if (sItems[1].length!=2) return false; if (sItems[2].length!=2) return false; if (parseInt(sItems[0],10)<1900 || parseInt(sItems[0],10)>2150) return false; if (parseInt(sItems[1],10)<1 || parseInt(sItems[1],10)>12) return false; if (parseInt(sItems[2],10)<1 || parseInt(sItems[2],10)>31) return false; if ((sItems[1]<=7) && ((sItems[1] % 2)==0) && (sItems[2]>=31)) return false; if ((sItems[1]>=8) && ((sItems[1] % 2)==1) && (sItems[2]>=31)) return false; //本年不是闰年 if (!((sItems[0] % 4)==0) && (sItems[1]==2) && (sItems[2]==29)){ if ((sItems[1]==2) && (sItems[2]==29)) return false; }else{ if ((sItems[1]==2) && (sItems[2]==30)) return false; } return true; } //改变工作区大小 function resizeLeft(){ try{ if(myleft.width==1){ myleft.width=myleftwidth; }else{ myleftwidth=myleft.width; myleft.width=1; } }catch(e){ } } function resizeTop(){ if(mytop.height==25) { mytop.height=mytopheight; } else { mytopheight=top.mytop.height; mytop.height=25; } } function maximizeWindow(){ window.moveTo(0,0); if (document.all){ top.window.resizeTo(screen.availWidth,screen.availHeight); } else if (document.layers||document.getElementById){ if (top.window.outerHeight progressEnd) progress_clear(); else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor; progressTimer = setTimeout('progress_update()',progressInterval); } function progress_stop() { clearTimeout(progressTimer); progress_clear(); } //*******************************end********************************* function checkPrimaryKey(sTable,sColumnString){ if(typeof(sTable)=="undefined" || sTable=="") return false; if(typeof(sColumnString)=="undefined" || sColumnString=="") return false; var sParameters = "Type=PRIMARYKEY&TableName="+sTable+""; var sColumns=sColumnString.split("@"); for(var i=0;i"); var txt=document.createElement("p"); txt.style.margin="1em 0"; txt.setAttribute("id","msgTxt"); txt.innerHTML=str; document.getElementById("msgDiv").appendChild(txt); } //*******************************end********************************* //*************************begin************************************* //脚本编辑器及saveParaToComp方法,非Datawindow相关,因此从as_dz.js移植过来。 var oTempObj; // 用于临时中转对象句柄 function editObjectValueWithScriptEditor(oObject,sScriptLanguage){ var sTempLanguage; if(typeof(sScriptLanguage)!="undefined" && sScriptLanguage!="") sTempLanguage = sScriptLanguage; else sTempLanguage = "AmarScript"; sInput = oObject.value; sInput = real2Amarsoft(sInput); sInput = replaceAll(sInput,"~","$[wave]"); oTempObj = oObject; if(sTempLanguage=="AFS") saveParaToComp("ScriptText="+sInput+"&ScriptLanguage="+sTempLanguage,"openScriptEditorForAFSAndSetText()"); else saveParaToComp("ScriptText="+sInput+"&ScriptLanguage="+sTempLanguage,"openScriptEditorAndSetText()"); } function editObjectValueWithScriptEditorForAFS(oObject,sModelNo){ var sTempModelNo; if(typeof(sModelNo)!="undefined" && sModelNo!="") sTempModelNo = sModelNo; else sTempModelNo = ""; sInput = oObject.value; sInput = real2Amarsoft(sInput); sInput = replaceAll(sInput,"~","$[wave]"); oTempObj = oObject; saveParaToComp("ScriptText="+sInput+"&ModelNo="+sTempModelNo,"openScriptEditorForAFSAndSetText()"); } function editObjectValueWithScriptEditorForASScript(oObject){ sInput = oObject.value; sInput = real2Amarsoft(sInput); sInput = replaceAll(sInput,"~","$[wave]"); oTempObj = oObject; saveParaToComp("ScriptText="+sInput,"openScriptEditorForASScriptAndSetText()"); } function openScriptEditorAndSetText(){ var oMyobj = oTempObj; AsDialog.PopView("/Common/ScriptEditor/ScriptEditor.jsp","","",function(sOutPut){ if(typeof(sOutPut)!="undefined" && sOutPut!="_CANCEL_"){ oMyobj.value = amarsoft2Real(sOutPut); } }); } function openScriptEditorForAFSAndSetText(){ var oMyobj = oTempObj; AsDialog.PopView("/Common/ScriptEditor/ScriptEditorForAFS.jsp","","",function(sOutPut){ if(typeof(sOutPut)!="undefined" && sOutPut!="_CANCEL_"){ oMyobj.value = amarsoft2Real(sOutPut); } }); } function openScriptEditorForASScriptAndSetText(){ var oMyobj = oTempObj; AsDialog.PopView("/Common/ScriptEditor/ScriptEditorForASScript.jsp","","",function(sOutPut){ if(typeof(sOutPut)!="undefined" && sOutPut!="_CANCEL_"){ oMyobj.value = amarsoft2Real(sOutPut); } }); } //用于动态生成iframe并通过post将数据传递至模态窗口 function generateIframe(){ iframeName=randomNumber().toString(); iframeName = "frame"+iframeName.substring(2); //modify in 2008/04/10,2008/02/14 for https //var sHTML="