////////////////////////////// // Browser ////////////////////////////// function Browser(){ app = navigator.appName.charAt(0); ver = navigator.appVersion.charAt(0); if(app == "N"){ return "NC"; }else if(app == "M"){ return "IE"; } } function brInfo() { var agt=navigator.userAgent.toLowerCase(); this.major = parseInt(navigator.appVersion); this.minor = parseFloat(navigator.appVersion); this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); this.ie3 = (this.ie && (this.major < 4)); this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) ); this.ie4up = (this.ie && (this.major >= 4)); this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) ); this.ie5_5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1)); this.ie5up = (this.ie && !this.ie3 && !this.ie4); this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5); this.ie6 = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) ); this.ie6up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5); return this.ie6up; } function LangCode() { app = navigator.appName.charAt(0); ver = navigator.appVersion.charAt(0); if(app == "N"){ SelectLang=navigator.language.substr(0,2); return SelectLang; }else if(app == "M"){ SelectLang=navigator.browserLanguage; return SelectLang; } } ////////////////////////////// // get_Length ////////////////////////////// function get_Length(str){ var n=0; if(Browser()=="IE"){ var len = str.length; var i; for(i = 0; i < len; i++){ n += is_ie_zenkaku(str.charAt(i)) ? 2 : 1; } } else{ n = str.length; } return n; } function is_ie_zenkaku(c){ return (escape(c).charAt(1) == "u"); } ///////////////////////////// // chk_Empty ///////////////////////////// function chk_Empty(str){ var n = 0; var len = str.length; var i; for(i = 0; i < len; i++){ if(str.charAt(i)!=" ") return false; } return true; } ////////////////////////////// // checkNumberI(num,minI,maxI) ////////////////////////////// function checkNumberI(num,minI,maxI){ if(num==""){ alert(loadLangString("L_Err_EffectiveValue",false)+"("+minI+"~"+maxI+")"); return false; } var val=num.match(/[^0-9]/g); if(val){ alert(loadLangString("L_Err_EffectiveValue",false)+"("+minI+"~"+maxI+")"); return false; } var N=Number(num); if(isNaN(N)){ alert(loadLangString("L_Err_EffectiveValue",false)+"("+minI+"~"+maxI+")"); return false; } if((N>maxI)||(NmaxI)||(N0){ for(i=0;i=0) form.sch[j].checked=true; } } else{ return false; } return true; } ////////////////////////////// // do_schedule ////////////////////////////// function do_schedule(form){ var strData=""; for(i=0;i<6;i++){ if(form.sch[i].checked==true){ if(strData=="") strData=String(i+1); else strData=strData+","+String(i+1); } } return strData; } ////////////////////////////// // checkIsKana ////////////////////////////// function checkIsKana(value) { for (var i = 0; i < value.length; ++i) { var c = value.charCodeAt(i); //Do not use Hankaku if (c < 256 || (c >= 0xff61 && c <= 0xff9f)) { return false; } } return true; } ////////////////////////////// // getByteCount ////////////////////////////// function getByteCount(value) { var count = 0; for ( var i = 0; i < value.length; ++i ) { var sub = value.substring(i, i + 1); //Kana +2 byte if( checkIsKana(sub) ){ count += 2; }else{ count += 1; } } return count; } function isHankaku(str) { var esc_str = escape(str); var ms = navigator.appVersion.indexOf("MSIE"); var nesc = navigator.appName.lastIndexOf("Netscape"); if(nesc >= 0){ if( (esc_str.indexOf('%A') == 0) || (esc_str.indexOf('%B') == 0) || (esc_str.indexOf('%C') == 0) || (esc_str.indexOf('%D') == 0) ){ return(true); } }else if(ms > 0){ if( (esc_str.indexOf('%uFF6') == 0) || (esc_str.indexOf('%uFF7') == 0) || (esc_str.indexOf('%uFF8') == 0) || (esc_str.indexOf('%uFF9') == 0) ) { return(true); } } return(false); } ////////////////////////////// // chk_IPaddress(pform,flg) ////////////////////////////// function chk_IPaddress(a0,a1,a2,a3){ var adr = new Array(4); adr[0] = a0; adr[1] = a1; adr[2] = a2; adr[3] = a3; for(i=0; i<4; i++){ intIP= parseInt(adr[i].value,10); if(isNaN(intIP)){ alert(loadLangString("L_Warn_InputWrong",false)); adr[i].select(); return false; } if((intIP <0) || (intIP > 255)){ alert(loadLangString("L_Warn_InputWrong",false)); adr[i].select(); return false; } } return true; } ////////////////////////////// // chk_IPaddressText(pform,flg) copy from 8120. ////////////////////////////// function chk_IPaddressText(pform,flg){ var IP_adr = pform.value; var str = IP_adr; var wkIP; var index; if((flg == true) && (IP_adr == "")){ alert(loadLangString("L_Warn_IP",false)); pform.select(); return false; } for(i=0; i<4; i++){ index = str.indexOf("."); if(i == 3){ wkIP = str; if(wkIP.indexOf(".") != -1){ alert(loadLangString("L_Warn_InputWrong",false)); pform.select(); return false; } }else{ if(index == -1){ alert(loadLangString("L_Warn_InputWrong",false)); pform.select(); return false; } wkIP = str.substr(0, index); } intIP= parseInt(wkIP,10); if((isNaN(Number(wkIP))) || isNaN(intIP)){ alert(loadLangString("L_Warn_InputWrong",false)); pform.select(); return false; } if((intIP <0) || (intIP > 255)){ alert(loadLangString("L_Warn_InputWrong",false)); pform.select(); return false; } str = str.substr(index+1, str.length-index-1); } return true; } ////////////////////////////// // chk_IPaddressByValue(pform,flg) parameters are value, not object ////////////////////////////// function chk_IPaddressByValue(a0,a1,a2,a3){ var adr = new Array(4); adr[0] = a0; adr[1] = a1; adr[2] = a2; adr[3] = a3; for(i=0; i<4; i++){ intIP= parseInt(adr[i],10); if(isNaN(intIP)){ alert(loadLangString("L_Warn_InputWrong",false)); return false; } if((intIP <0) || (intIP > 255)){ alert(loadLangString("L_Warn_InputWrong",false)); return false; } } return true; } ////////////////////////////// // chk_McIpaddress(pform,flg) ////////////////////////////// function chk_McIpAddress(pform) { var str = pform.value var wkStr; var intIP = 0; var index; for(i=0; i<4; i++){ index = str.indexOf(".") if(i==3){ if (index != -1) { alert(loadLangString("L_Warn_InputWrong",false)); } wkStr = str; } else { if(index == -1) { alert(loadLangString("L_Warn_InputWrong",false)); return 0; } wkStr = str.substr(0, index); } //Qmik add start, Scott Chang, 2008/9/6 var value = parseInt(wkStr,10); if(value < 0 || value > 255) { alert(loadLangString("L_Warn_InputWrong",false)); return 0; } intIP = (intIP * 256) + value; //Qmik add start, Scott Chang, 2008/9/6 if(isNaN(intIP)){ alert(loadLangString("L_Warn_InputWrong",false)); return 0; } str = str.substr(index+1, str.length-index-1); } if(intIP < 3758096640 || intIP > 4026531839){//Multicast form 224.0.0.0~239.255.255.255, but 224.0.0.1~224.0.0.255 just used in local network alert(loadLangString("L_Warn_InputWrong",false)+" (224.0.1.0 ~ 239.255.255.255)"); return 0; } } ////////////////////////////// // chk_SubnetMask ////////////////////////////// function chk_SubnetMask(Maskarea){ var MaskStr = Maskarea.value; var str = MaskStr; var wkMask; var index; var intMask = new Array(4); var TotalintMask; var position; var tempMask; var maskflg; for(i=0; i<4; i++){ index = str.indexOf("."); if(i == 3){ wkMask = str; } else{ if(index == -1){ alert(loadLangString("L_Err_Submask",false)); return 0; } wkMask = str.substr(0, index); } intMask[i] = parseInt(wkMask,10); if(isNaN(intMask[i])){ alert(loadLangString("L_Warn_InputWrong",false)); return 0; } if(intMask[i] < 0 || intMask[0] > 255){ alert(loadLangString("L_Warn_InputWrong",false)); return 0; } str = str.substr(index+1, str.length-index-1); } TotalintMask = intMask[3] + intMask[2]*256 + intMask[1]*256*256 + intMask[0]*256*256*256; if((TotalintMask&1) == 1){ alert(loadLangString("L_Err_Submask",false)); return 0; } maskflg = 2; for(i=2; i<33; i++){ if((TotalintMask&maskflg) == maskflg){ position = i; break; } maskflg = maskflg<<1; } maskflg = maskflg<<1; for(i=position+1; i<33; i++){ if((TotalintMask&maskflg) == 0){ alert(loadLangString("L_Err_Submask",false)); return 0; } maskflg = maskflg<<1; } return 1; } ////////////////////////////// // chk_SubnetMask with ip ////////////////////////////// function chk_subnetmask_with_ip(i0,i1,i2,i3,m0,m1,m2,m3){ ipStr=parseInt(i0<<24)+parseInt(i1<<16)+parseInt(i2<<8)+parseInt(i3); maskStr=parseInt(m0<<24)+parseInt(m1<<16)+parseInt(m2<<8)+parseInt(m3); if((ipStr&(~maskStr))==0){ alert(loadLangString("L_Warn_InputWrong",false)); return false; } if((ipStr&(~maskStr))==(0xffffffff&(~maskStr))){ alert(loadLangString("L_Warn_InputWrong",false)); return false; } return true; } ////////////////////////////// // chk_SubnetMaskvalue ////////////////////////////// function chk_SubnetMaskValue(smValue){ var str=smValue; var wkMask; var index; var intMask=new Array(4); var TotalintMask; var position; var tempMask; var maskflg; if(str == ""){ alert(loadLangString("L_Err_Submask",false)); return false; } for(i=0;i<4;i++){ index=str.indexOf("."); if(i==3){ wkMask=str; } else{ if(index==-1){ alert(loadLangString("L_Warn_InputWrong",false)); return false; } wkMask=str.substr(0,index); } intMask[i]=parseInt(wkMask,10); if(isNaN(intMask[i])){ alert(loadLangString("L_Warn_InputWrong",false)); return false; } if(intMask[i]<0||intMask[i]>255){ alert(loadLangString("L_Warn_InputWrong",false)); return false; } if(((i==0)&&(intMask[0]!=255)) || ((i==3)&&(intMask[0]==255)&&(intMask[3]>252))){ alert(loadLangString("L_Err_Submask",false)); return false; } str=str.substr(index+1,str.length-index-1); } TotalintMask=intMask[3]+intMask[2]*256+intMask[1]*256*256+intMask[0]*256*256*256; if((TotalintMask&1)==1){ alert(loadLangString("L_Err_Submask",false)); return false; } maskflg=2; for(i=2;i<33;i++){ if((TotalintMask&maskflg)==maskflg){ position=i; break; } maskflg=maskflg<<1; } maskflg=maskflg<<1; for(i=position+1;i<33;i++){ if((TotalintMask&maskflg) == 0){ alert(loadLangString("L_Err_Submask",false)); return false; } maskflg=maskflg<<1; } return true; } ////////////////////////////// // chk_gateway_address ////////////////////////////// function chk_gateway_addr(ipValue,smValue,gwValue){ var str1,str2,str3; var wkIP; var index; var intMask=new Array(4); var intIp=new Array(4); var intGateWay=new Array(4); var gw_addr0=0; var tmp1,tmp2; str1=smValue; str2=ipValue; str3=gwValue; for(i=0;i<4;i++){ index=str1.indexOf("."); if(i==3) wkIP=str1; else wkIP=str1.substr(0,index); intMask[i]=parseInt(wkIP,10); str1=str1.substr(index+1,str1.length-index-1); } for(i=0;i<4;i++){ index=str2.indexOf("."); if(i==3) wkIP=str2; else wkIP=str2.substr(0,index); intIp[i]=parseInt(wkIP,10); str2=str2.substr(index+1,str2.length-index-1); } for(i=0;i<4;i++){ index=str3.indexOf("."); if(i==3) wkIP=str3; else wkIP=str3.substr(0,index); intGateWay[i]=parseInt(wkIP,10); str3=str3.substr(index+1,str3.length-index-1); } if(!gw_addr0){ tmp1=intIp[0]&intMask[0]; tmp2=intGateWay[0]&intMask[0]; if(tmp1!=tmp2) gw_addr0=1; } if(!gw_addr0){ tmp1=intIp[1]&intMask[1]; tmp2=intGateWay[1]&intMask[1]; if(tmp1!=tmp2) gw_addr0=1; } if(!gw_addr0){ tmp1=intIp[2]&intMask[2]; tmp2=intGateWay[2]&intMask[2]; if(tmp1!=tmp2) gw_addr0=1; } if(!gw_addr0){ tmp1=intIp[3]&intMask[3]; tmp2=intGateWay[3]&intMask[3]; if(tmp1!=tmp2) gw_addr0=1; } if(gw_addr0){ alert(loadLangString("L_Err_Gateway",false)); return false; } return true; } ///////////////////////////////// // Effective Period Schedule No ///////////////////////////////// function Check_BaseFileName(Suffix_form,BFN){ if((BFN.value=="")&&(Suffix_form[0].checked==true)){ alert(loadLangString("L_WarnImageFile",false)); Suffix_form.focus; return false; } return true; } ///////////////////////////////// // SMTP POP server name ///////////////////////////////// function Check_PopServerName(PopServerName_form,BFN){ if((BFN.value=="")&&(PopServerName_form[2].checked==true)){ alert(loadLangString("L_Warn_POPServerName",false)); PopServerName_form.focus; return false; } if(PopServerName_form[2].checked==true) return false; return true; } ///////////////////////////////// // SMTP User name ///////////////////////////////// function Check_UserName(UserName_form,BFN){ if((BFN.value=="")&&(UserName_form[1].checked==true)){ alert(loadLangString("L_Warn_UserName",false)); UserName_form.focus; return false; } if((BFN.value=="")&&(UserName_form[2].checked==true)){ alert(loadLangString("L_Warn_UserName",false)); UserName_form.focus; return false; } if(get_Length(BFN.value)>64){ alert(loadLangString("L_Err_UserNameLength",false)); BFN.select(); return false; } if(UserName_form[1].checked==true) return false; if(UserName_form[2].checked==true) return false; return true; } ///////////////////////////////// // SMTP Password ///////////////////////////////// function Check_Password(Password_form,BFN){ if((BFN.value=="")&&(Password_form[1].checked==true)){ alert(loadLangString("L_Warn_Pass",false)); Password_form.focus; return false; } if((BFN.value=="")&&(Password_form[2].checked==true)){ alert(loadLangString("L_Warn_Pass",false)); Password_form.focus; return false; } if(get_Length(BFN.value)>64){ alert(loadLangString("L_Err_PassLength",false)); BFN.select(); return false; } if(Password_form[1].checked==true) return false; if(Password_form[2].checked==true) return false; return true; } ////////////////////////////// // chk_None(cOBJ) ////////////////////////////// function chk_None(cOBJ) { if(cOBJ.value==""){ cOBJ.focus(); alert(loadLangString("L_WarnImageFile",false)); } } ////////////////////////////// // chk_AdminMail(cOBJ) ////////////////////////////// function chk_AdminMail(cOBJ) { if(cOBJ.value==""){ cOBJ.focus(); alert(loadLangString("L_Warn_AdminEMail",false)); return false; } return true; } ////////////////////////////// // chk_ServarName(cOBJ) ////////////////////////////// function chk_ServarName(cOBJ){ if(cOBJ.value==""){ cOBJ.focus(); alert(loadLangString("L_Warn_SMTPServerName",false)); return false; } return true; } ////////////////////////////// // chk_FTPName(cOBJ) ////////////////////////////// function chk_FTPName(cOBJ){ if(cOBJ.value==""){ cOBJ.focus(); alert(loadLangString("L_Warn_FTPServerName",false)); return false; } if(cOBJ.value.indexOf('\\')>=0){ cOBJ.focus(); alert(loadLangString("L_Warn_FTPServerName",false)); return false; } if(checkUnicode(cOBJ.value)){ cOBJ.focus(); alert(loadLangString("L_Warn_InputValidChar2",false)); return false; } return true; } ////////////////////////////// // chk_RcptAddr(cOBJ) ////////////////////////////// function chk_RcptAddr(cOBJ){ return true; } ////////////////////////////// // chk_ProxyName(cOBJ) ////////////////////////////// function chk_ProxyName(cOBJ){ return true; } ///////////////////////////////////////////////// // Check_CapWarnSmtp(CapWarnSmtp_form,BFN) ///////////////////////////////////////////////// function Check_CapWarnSmtp(CapWarnSmtp_form,BFN){ if(CapWarnSmtp_form[0].checked==true){ return chk_ServarName(BFN); } return true; } /////////////////////////////////////////////////// // Check_CapWarnAdmin(CapWarnAdmin_form,BFN) /////////////////////////////////////////////////// function Check_CapWarnAdmin(CapWarnAdmin_form,BFN){ if(CapWarnAdmin_form[0].checked==true){ return chk_AdminMail(BFN); } return true; } ////////////////////////////// // chk_ManualAssignedName ////////////////////////////// function chk_ManualAssignedName(checkString){ var len=0; var newString = ""; var count = 0; for(i = 0; i = "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || (ch >= "0" && ch <= "9") || (ch == "-")||( ch == "_")){ if((ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || (ch >= "0" && ch <= "9") || (ch == "-")||( ch == "_")||( ch == "/")||( ch == ".")){ //Qmik modify end, Cyrus Yeh, 2007/1/1 newString += ch; len++; } else{ //alert(ch); //Qmik modify by Cyrus Yeh, 2007/3/26 alert('['+ch+']'); alert(loadLangString("L_ErrImageFile",false)); return false; } } //Qmik remove start, Cyrus Yeh, 2007/1/1, filename includes path length //if(len>10){ // alert("Image file name length error."); // return false; //} //Qmik remove end, Cyrus Yeh, 2007/1/1 return true; } ////////////////////////////// // chk_ValidString(cObj,no) ////////////////////////////// function chk_ValidInput(cObj,no) { switch(no){ case 0: msg=loadLangString("L_Err_UserName",false); break; case 1: msg=loadLangString("L_Err_Pass",false); break; case 2: msg=loadLangString("L_Err_RetypePass",false); break; case 3: msg=loadLangString("L_Administrator",false)+" "+loadLangString("L_Err_UserName",false); break; case 4: msg=loadLangString("L_Administrator",false)+" "+loadLangString("L_Err_Pass",false); break; case 5: msg=loadLangString("L_Administrator",false)+" "+loadLangString("L_Err_RetypePass",false); break; default: msg=""; break; } return checkValidString(cObj.value,cObj,msg); } ////////////////////////////// // hasZenKaku(str) ////////////////////////////// function hasZenKaku(str){ var code; for (var i = 0; i < str.length; ++i) { code = str.charCodeAt(i); if (code > 256 && (code < 0xff61 || code > 0xff9f)) { return true; } } return false; } ////////////////////////////// // hasHankakuKana(str) ////////////////////////////// function hasHankakuKana(str){ var code; for (var i = 0; i < str.length; ++i) { code = str.charCodeAt(i); if (code >= 0xff61 && code <= 0xff9f) { return true; } } return false; } ////////////////////////////// // checkHankakuNoKana(str,cObj,strMsg) ////////////////////////////// function checkHankakuNoKana(str,cObj,strMsg){ var tmp; if (hasZenKaku(str) == true || hasHankakuKana(str) == true){ if (strMsg==null || strMsg=='' ) alert(loadLangString("L_Err_EffectiveValue",false)); else alert(strMsg); cObj.select(); return false; } return true; } ////////////////////////////// // checkValidString(str,cObj,strMsg) ////////////////////////////// function checkValidString(str,cObj,strMsg){ //Qmik modify start, Cyrus Yeh, 2007/4/18 //var tmp = str.match(/[0-9a-zA-Z ]+/g); var tmp = str.match(/[0-9a-zA-Z]+/g); //" ", space character is invalid //Qmik modify end, Cyrus Yeh, 2007/4/18 if (str.length==0) return true; if (tmp == str){ } else{ if (strMsg==null || strMsg=='' ) alert(loadLangString("L_Err_EffectiveValue",false)); else alert(strMsg); cObj.select(); return false; } return true; } ////////////////////////////// // checkProhibitedCharacter ////////////////////////////// function checkProhibitedCharacter ( string ) { if( string.search(/[^a-zA-Z0-9_\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\`\{\|\}\~\s]/) == -1 ) { return true; } else { return false; } } //Qmik add, Scott Chang, 2007/5/10 function checkProhibitedCharacter1( string ) { var tmp = string.match(/[0-9a-zA-Z_/.,@-]+/g); //" ", space character is invalid if (string.length==0) return true; if (tmp == string) return true; else return false; } //Qmik end, Scott Chang, 2007/5/10 ///////////////////////////////////////////////////////////////////// function doCheckMax(strTxt,nLen) { var ch=getByteCount(strTxt); if(ch > nLen){ return false; } return true; } function doCheckSmServerName(wform) { if(wform.SmServerName.value==""){ alert(loadLangString("L_Warn_SMTPServerName",false)); return false; } if(!doCheckMax(wform.SmServerName.value,64)){ alert(loadLangString("L_Err_SMTPServerLength",false)); return false; } return true; } function doCheckSmAthPopServerName(wform) { if(wform.SmAthPopServerName.value==""){ alert(loadLangString("L_Warn_POPServerName",false)); return false; } if(!doCheckMax(wform.SmAthPopServerName.value,64)){ alert(loadLangString("L_Err_POPServerLength",false)); return false; } return true; } function doCheckSmAthUserName(wform) { if(wform.SmAthUserName.value==""){ alert(loadLangString("L_Warn_UserName",false)); return false; } if(!doCheckMax(wform.SmAthUserName.value,64)){ alert(loadLangString("L_Err_UserNameLength",false)); return false; } return true; } function doCheckSmAthPassword(wform) { if(wform.SmAthPassword.value==""){ alert(loadLangString("L_Warn_Pass",false)); return false; } if(!doCheckMax(wform.SmAthPassword.value,64)){ alert(loadLangString("L_Err_PassLength",false)); return false; } return true; } function doCheckAddrVal(objAddr) { if(!doCheckMax(objAddr.value,64)){ alert(loadLangString("L_Err_RecipientEMailLength",false)); return false; } return true; } function doCheckSmRcptToAddr(wform, dform) { if(wform.SmRcptToAddr1.value==""){ if(wform.SmRcptToAddr2.value==""){ if(wform.SmRcptToAddr3.value==""){ alert(loadLangString("L_Warn_RecipientEMail",false)); dform.SmRcptToAddr1.focus(); return false; }else{ wform.SmRcptToAddr1.value=wform.SmRcptToAddr3.value; wform.SmRcptToAddr3.value=""; } }else{ wform.SmRcptToAddr1.value=wform.SmRcptToAddr2.value; wform.SmRcptToAddr2.value=""; } } if(wform.SmRcptToAddr2.value==""){ if(wform.SmRcptToAddr3.value!=""){ wform.SmRcptToAddr2.value=wform.SmRcptToAddr3.value; wform.SmRcptToAddr3.value=""; } } doUpdateForm(); if(!doCheckAddrVal(wform.SmRcptToAddr1)){ dform.SmRcptToAddr1.select(); return false; } if(!doCheckAddrVal(wform.SmRcptToAddr2)){ dform.SmRcptToAddr2.select(); return false; } if(!doCheckAddrVal(wform.SmRcptToAddr3)){ dform.SmRcptToAddr3.select(); return false; } } function doCheckSmSubject(wform) { if(!doCheckMax(wform.SmSubject.value,64)){ alert(loadLangString("L_Err_SubjecLength",false)); return false; } else if(wform.SmSubject.value==""){ alert(loadLangString("L_Err_SubjecLength",false)); return false; } return true; } function doCheckSmMessage(wform) { if(!doCheckMax(wform.SmMessage.value,384)){ alert(loadLangString("L_Err_MsgLength",false)); return false; } else if(wform.SmMessage.value==""){ alert(loadLangString("L_Err_MsgLength",false)); return false; } return true; } function doCheckSmAdminAddr(wform) { if(wform.SmAdminAddr.value==""){ alert(loadLangString("L_Warn_AdminEMail",false)); return false; } if(!doCheckMax(wform.SmAdminAddr.value,64)){ alert(loadLangString("L_Err_AdminEMailLength",false)); return false; } return true; } function doCheckAssignedName(valSuffix,valAssignedName) { if(valSuffix=="none"){ if(valAssignedName==""){ alert(loadLangString("L_WarnImageFile",false)); return false; } } if(!chk_ManualAssignedName(valAssignedName)){ return false; } return true; } function isMotionEnable(valImageCodec, valAreaSelect, valImageSize) { var valTmp = valImageSize.substr(0,3); if((valImageCodec=="jpeg")||(valAreaSelect=="on"&&valTmp=="640")) return false; else return true; } function checkUnicode(str){ var code; for (var i = 0; i < str.length; ++i) { code = str.charCodeAt(i); if (code >= 256) { return true; } } return false; } function padLeft(str,len, padChar){ if(str.length >= len) return str; else return padLeft(padChar +str,len, padChar); } function padRight(str,len, padChar){ if(str.length >= len) return str; else return padRight(str+padChar,len, padChar); } var dirty = false; function EnableDirty() { //alert("dirty"); dirty = true; } function DisableDirty() { dirty = false; }