function chk_quotes(str) { re = /(\'.*\")|(\".*\')/; return str.search(re) == -1; } function chk_pd_name(dir) { re = /^[0-9a-zA-Z-_.\/]+$/; // forbid /../ and // and ^./ and ^../ and /./ and /..$ and /.$ and ^.$ re1 = /(\/\.\.\/|\/\/|^\.\/|^\.\.\/|\/\.\/|\/\.\.$|\/\.$|^\.$)/; return (dir.search(re) != -1) && (dir.search(re1) == -1); } function chk_db_name(db) { re = /^[a-zA-Z]{1}[A-Za-z0-9-_]{0,31}$/; return db.search(re) != -1; } function chk_db_usr_name(usr) { re = /^[a-zA-Z]{1}[A-Za-z0-9_]{0,15}$/; return usr.search(re) != -1; } function chk_pos_int(pos_int) { re = /^\s*[1-9]{1}[0-9]*\s*$/; return pos_int.search(re) != -1; } function chk_sys_login(nm) { re = /^[a-z]{1}[a-z0-9_-]{0,15}$/; return nm.search(re) != -1; } function chk_mn(mail_name) { re = /^[\w-\+]+((\.)[\w-\+]+)*$/; return mail_name.search(re) != -1; } function chk_resp_name(resp_name) { return ((resp_name.length > 0) && (resp_name.length <= 245)); } function chk_login(login) { re = /^[a-zA-Z0-9]{1}[A-Za-z0-9_.-]{0,19}$/; return login.search(re) != -1; } function chk_realm(realm) { re = /^[^\"]*$/; return realm.search(re) != -1; } function chk_dom(dom_name) { if ('localhost.rev' == dom_name) return false; inaddr = /\.in-addr.arpa$/; if (dom_name.search(inaddr) != -1) return false; if (chk_ip(dom_name)) // no domain name like IP address return false; return true; // IDN support /* nore = /\.$/; re = /^[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9]){0,1}(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9]){0,1}){1,}$/; return (dom_name.search(nore) == -1) && dom_name.match(re); */ } function chk_subdom(dom_name) { return true; // IDN support /* re = /^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*$/; return dom_name.search(re) != -1; */ } function chk_email(email) { re = /^([^\@]+){1}\@([^\@]+){1}$/; found = email.match(re); if (!found) return false; return chk_mn(found[1]) && chk_dom(found[2]); } function chk_url(url) { re = /^((http[s]?|ftp):\/\/)?([^\/:]+)(:\d{1,5})?(\/[^\s\"\'`]*)?$/i; found = re.exec(url); if (!found) return false; return chk_dom(found[3]); } function chk_ip(ip) { re = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/; found = ip.match(re); if (!found) return false; for (i = found.length; i-- > 1;) { if ((found[i] < 0) || (found[i] > 255)) return false; } return true; } function chk_mask(mask) { re = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/; found = mask.match(re); if (!found) return false; i = found.length - 1; while (i && (found[i] == 0)) i--; if (!i) return true; if ( (found[i] != 128) && (found[i] != 192) && (found[i] != 224) && (found[i] != 240) && (found[i] != 248) && (found[i] != 252) && (found[i] != 254) && (found[i] != 255) ) return false; i--; while (i && (found[i] == 255)) i--; return i == 0; } function dot_to_num(str) { var num = 0; var re = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/; found = str.match(re); if (!found) return null; for (i = 0; ++i < found.length; ) { num <<= 8; num |= found[i]; } return num; } function chk_ip_mask(ip, mask) { if (!chk_ip(ip) || !chk_mask(mask)) return false; var num_ip; var num_mask; if ((num_ip = dot_to_num(ip)) == null) return false; if ((num_mask = dot_to_num(mask)) == null) return false; // check ip/mask combination for interface: // 1) mask not null // 2) host part not null (num_ip & ~num_mask) // 3) host part not all 1 ~((num_ip & ~num_mask) | num_mask) return num_mask && (((num_ip & ~num_mask) && ~((num_ip & ~num_mask) | num_mask)) || (mask == '255.255.255.255')); } function chk_net_mask(net, mask) { if (!chk_ip(net) || !chk_mask(mask)) return false; var num_net; var num_mask; if ((num_net = dot_to_num(net)) == null) return false; if ((num_mask = dot_to_num(mask)) == null) return false; return num_mask && (num_net & num_mask) && ((num_net & num_mask) == num_net); } function chk_sys_passwd(username, passwd) { if ((passwd.length < 5) || (passwd.length > 14)) return false; if (passwd.length >= username.length) { if (passwd.indexOf(username, 0) != -1) return false; } if ((passwd.indexOf('\'') != -1) || (passwd.indexOf(' ') != -1)) return false; for (i = passwd.length; i-- > 0;) { if (passwd.charCodeAt(i) > 127) return false; } return true; } function chk_filename(filename) { re = /^[^\']*$/; return filename.search(re) != -1; } function chk_uint(uint) { re = /^[0-9]+$/; found = uint.match(re); if (!found) { return false; } return true; } //########################################################### MM_menu function MM_menuMouseOver(menuid,submenuid){ if(submenuid != null && document.getElementById(submenuid).style.visibility == "visible"){ document.getElementById(menuid).style.backgroundColor='#FFFFFF'; document.getElementById(menuid).style.cursor="pointer"; }else{ document.getElementById(menuid).style.backgroundColor='#40B6B6'; document.getElementById(menuid).style.cursor="pointer"; } } function MM_menuMouseOut(menuid,submenuid){ if(submenuid != null && document.getElementById(submenuid).style.visibility == "visible"){ document.getElementById(menuid).style.backgroundColor='#FFFFFF'; document.getElementById(menuid).style.cursor="pointer"; }else{ document.getElementById(menuid).style.backgroundColor=''; } } //########################################################### MM_submenu function MM_submenuShow(e,menuid,submenuid,menupotop,menupoleft){ if(document.getElementById(submenuid).style.visibility == "visible"){ MM_submenuHide('MenuEmployee','SubmenuEmployee'); }else{ var top=left=0; menuidPosition=findPos(document.getElementById(menuid)); left=menuidPosition[0]; top=menuidPosition[1]; document.getElementById(menuid).style.backgroundColor='#FFFFFF'; document.getElementById(menuid+"TDL").style.backgroundColor='#015858'; document.getElementById(menuid+"Text").style.color='#000000'; document.getElementById(menuid+"Icon").src='/_img/n_desc_b.gif'; document.getElementById(submenuid).style.visibility="visible"; document.getElementById(submenuid).style.top=top+menupotop+"px"; document.getElementById(submenuid).style.left=left-menupoleft+"px"; } } function MM_submenuHold(menuid,submenuid){ document.getElementById(menuid).style.backgroundColor='#FFFFFF'; document.getElementById(menuid+"TDL").style.backgroundColor='#015858'; document.getElementById(menuid+"Text").style.color='#000000'; document.getElementById(menuid+"Icon").src='/_img/n_desc_b.gif'; document.getElementById(submenuid).style.visibility="visible"; } function MM_submenuHide(menuid,submenuid){ document.getElementById(menuid).style.backgroundColor=''; document.getElementById(menuid+"TDL").style.backgroundColor=''; document.getElementById(menuid+"Text").style.color=''; document.getElementById(menuid+"Icon").src='/_img/n_desc_w.gif'; document.getElementById(submenuid).style.visibility="hidden"; } function MM_submenuMouseOver(submenuid){ document.getElementById(submenuid+"T").style.backgroundColor='#149C9C'; document.getElementById(submenuid+"M").style.backgroundColor='#40B6B6'; document.getElementById(submenuid+"B").style.backgroundColor='#149C9C'; document.getElementById(submenuid+"M").style.cursor="pointer"; document.getElementById(submenuid+"Text").style.color='#FFFFFF'; } function MM_submenuMouseOut(submenuid){ document.getElementById(submenuid+"T").style.backgroundColor='#FFFFFF'; document.getElementById(submenuid+"M").style.backgroundColor='#FFFFFF'; document.getElementById(submenuid+"B").style.backgroundColor='#FFFFFF'; document.getElementById(submenuid+"Text").style.color='#015858'; } //########################################################### MM_MouseClick function MM_MouseClick(url){ document.location=url; } //########################################################### MM_openBrWindow function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //########################################################### MM_jumpMenu function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //########################################################### findPos function findPos(obj){ var curleft=curtop=0; if(obj.offsetParent){ curleft=obj.offsetLeft; curtop=obj.offsetTop; while(obj=obj.offsetParent){ curleft+=obj.offsetLeft; curtop+=obj.offsetTop; } } return [curleft,curtop]; } //########################################################### ShowDivPop function ShowDivPop(divid){ document.getElementById(divid).style.display="block"; /* document.getElementById(divid).style.top="0px"; document.getElementById(divid).style.left="0px"; alert("document.body.clientHeight="+document.body.clientHeight +"\r\n"+ "document.body.clientWidth="+document.body.clientWidth +"\r\n"+ "document.body.offsetHeight="+document.body.offsetHeight +"\r\n"+ "document.body.offsetWidth="+document.body.offsetWidth +"\r\n"+ "document.body.scrollTop="+document.body.scrollTop +"\r\n"+ "document.body.scrollLeft="+document.body.scrollLeft +"\r\n"+ "document.getElementById(divid).offsetHeight="+document.getElementById(divid).offsetHeight +"\r\n"+ "document.getElementById(divid).offsetWidth="+document.getElementById(divid).offsetWidth ); */ HaftScreenW=parseInt(document.documentElement.clientWidth)/2; HaftDivW=parseInt(document.getElementById(divid).offsetWidth)/2; HaftScreenH=parseInt(document.documentElement.clientHeight)/2; HaftDivH=parseInt(document.getElementById(divid).offsetHeight)/2; SCTW=document.documentElement.scrollLeft; SCTH=document.documentElement.scrollTop+document.body.scrollTop; DivLeft=HaftScreenW-HaftDivW+SCTW; DivHeight=HaftScreenH-HaftDivH+SCTH; // alert(HaftScreenW+"-"+HaftDivW+"+"+SCTW+"="+DivLeft); // alert(HaftScreenH+"-"+HaftDivH+"+"+SCTH+"="+DivHeight); document.getElementById(divid).style.left=DivLeft+"px"; document.getElementById(divid).style.top=DivHeight+"px"; OvlW=document.body.clientWidth+SCTW; if(OvlW < 1250){OvlW=1250;} OvlH=document.body.clientHeight; document.getElementById("DivOverlay").style.height=OvlH+"px"; document.getElementById("DivOverlay").style.width=OvlW+"px"; document.getElementById("DivOverlay").style.display="block"; } //########################################################### CloseDivPop function CloseDivPop(divid){ document.getElementById(divid).style.display="none"; document.getElementById("DivOverlay").style.height="100%"; document.getElementById("DivOverlay").style.width="100%"; document.getElementById("DivOverlay").style.display="none"; } //########################################################### ShowDivInfo function ShowDivInfo(divid,textinfo){ document.getElementById("TextAlertOk").innerHTML=textinfo; document.getElementById(divid).style.display="block"; HaftScreenW=parseInt(document.documentElement.clientWidth)/2; HaftDivW=parseInt(document.getElementById(divid).offsetWidth)/2; HaftScreenH=parseInt(document.documentElement.clientHeight)/2; HaftDivH=parseInt(document.getElementById(divid).offsetHeight)/2; SCTW=document.documentElement.scrollLeft; SCTH=document.documentElement.scrollTop+document.body.scrollTop; DivLeft=HaftScreenW-HaftDivW+SCTW; DivHeight=HaftScreenH-HaftDivH+SCTH; document.getElementById(divid).style.left=DivLeft+"px"; document.getElementById(divid).style.top=DivHeight+"px"; OvlW=document.body.clientWidth+SCTW; if(OvlW < 1250){OvlW=1250;} OvlH=document.body.clientHeight; document.getElementById("DivOverlay").style.height=OvlH+"px"; document.getElementById("DivOverlay").style.width=OvlW+"px"; document.getElementById("DivOverlay").style.display="block"; } //########################################################### CloseDivInfo function CloseDivInfo(divid){ document.getElementById("TextAlertOk").innerHTML=""; document.getElementById(divid).style.display="none"; document.getElementById("DivOverlay").style.height="100%"; document.getElementById("DivOverlay").style.width="100%"; document.getElementById("DivOverlay").style.display="none"; } //########################################################### ShowDivInfo2 function ShowDivInfo2(divid,textinfo){ document.getElementById("TextAlertOk2").innerHTML=textinfo; document.getElementById(divid).style.display="block"; HaftScreenW=parseInt(document.documentElement.clientWidth)/2; HaftDivW=parseInt(document.getElementById(divid).offsetWidth)/2; HaftScreenH=parseInt(document.documentElement.clientHeight)/2; HaftDivH=parseInt(document.getElementById(divid).offsetHeight)/2; SCTW=document.documentElement.scrollLeft; SCTH=document.documentElement.scrollTop+document.body.scrollTop; DivLeft=HaftScreenW-HaftDivW+SCTW; DivHeight=HaftScreenH-HaftDivH+SCTH; document.getElementById(divid).style.left=DivLeft+"px"; document.getElementById(divid).style.top=DivHeight+"px"; OvlW=document.body.clientWidth+SCTW; if(OvlW < 1250){OvlW=1250;} OvlH=document.body.clientHeight; document.getElementById("DivOverlay2").style.height=OvlH+"px"; document.getElementById("DivOverlay2").style.width=OvlW+"px"; document.getElementById("DivOverlay2").style.display="block"; } //########################################################### CloseDivInfo2 function CloseDivInfo2(divid){ document.getElementById("TextAlertOk2").innerHTML=""; document.getElementById(divid).style.display="none"; document.getElementById("DivOverlay2").style.height="100%"; document.getElementById("DivOverlay2").style.width="100%"; document.getElementById("DivOverlay2").style.display="none"; } //########################################################### ShowDivInfo2 function ShowDivAlertFinish(divid,textinfo){ document.getElementById("TextAlertFinish").innerHTML=textinfo; document.getElementById(divid).style.display="block"; HaftScreenW=parseInt(document.documentElement.clientWidth)/2; HaftDivW=parseInt(document.getElementById(divid).offsetWidth)/2; HaftScreenH=parseInt(document.documentElement.clientHeight)/2; HaftDivH=parseInt(document.getElementById(divid).offsetHeight)/2; SCTW=document.documentElement.scrollLeft; SCTH=document.documentElement.scrollTop+document.body.scrollTop; DivLeft=HaftScreenW-HaftDivW+SCTW; DivHeight=HaftScreenH-HaftDivH+SCTH; document.getElementById(divid).style.left=DivLeft+"px"; document.getElementById(divid).style.top=DivHeight+"px"; OvlW=document.body.clientWidth+SCTW; if(OvlW < 1250){OvlW=1250;} OvlH=document.body.clientHeight; document.getElementById("DivOverlay2").style.height=OvlH+"px"; document.getElementById("DivOverlay2").style.width=OvlW+"px"; document.getElementById("DivOverlay2").style.display="block"; } //########################################################### CloseDivInfo2 function CloseDivAlertFinish(divid,nexturl){ document.getElementById("TextAlertFinish").innerHTML=""; document.getElementById(divid).style.display="none"; document.getElementById("DivOverlay2").style.height="100%"; document.getElementById("DivOverlay2").style.width="100%"; document.getElementById("DivOverlay2").style.display="none"; top.location=nexturl; } //########################################################### ShowDivQuestion function ShowDivQuestion(divid,textquestion){ document.getElementById("TextAlertQuestion").innerHTML=textquestion; document.getElementById(divid).style.display="block"; HaftScreenW=parseInt(document.documentElement.clientWidth)/2; HaftDivW=parseInt(document.getElementById(divid).offsetWidth)/2; HaftScreenH=parseInt(document.documentElement.clientHeight)/2; HaftDivH=parseInt(document.getElementById(divid).offsetHeight)/2; SCTW=document.documentElement.scrollLeft; SCTH=document.documentElement.scrollTop+document.body.scrollTop; DivLeft=HaftScreenW-HaftDivW+SCTW; DivHeight=HaftScreenH-HaftDivH+SCTH; document.getElementById(divid).style.left=DivLeft+"px"; document.getElementById(divid).style.top=DivHeight+"px"; OvlW=document.body.clientWidth+SCTW; if(OvlW < 1250){OvlW=1250;} OvlH=document.body.clientHeight; document.getElementById("DivOverlay").style.height=OvlH+"px"; document.getElementById("DivOverlay").style.width=OvlW+"px"; document.getElementById("DivOverlay").style.display="block"; } //########################################################### CloseDivQuestion function CloseDivQuestion(divid){ document.getElementById("TextAlertQuestion").innerHTML=""; document.getElementById(divid).style.display="none"; document.getElementById("DivOverlay").style.height="100%"; document.getElementById("DivOverlay").style.width="100%"; document.getElementById("DivOverlay").style.display="none"; } //########################################################### ETC window.onload=function(){ setInterval('blinkIt()',500); } function blinkIt(){ if(!document.all){ return; }else{ for(i=0;i"){ uch=uch+"%3E"; }else if(ch[i] == "?"){ uch=uch+"%3F"; }else if(ch[i] == "@"){ uch=uch+"%40"; }else if(ch[i] == "A"){ uch=uch+"%41"; }else if(ch[i] == "B"){ uch=uch+"%42"; }else if(ch[i] == "C"){ uch=uch+"%43"; }else if(ch[i] == "D"){ uch=uch+"%44"; }else if(ch[i] == "E"){ uch=uch+"%45"; }else if(ch[i] == "F"){ uch=uch+"%46"; }else if(ch[i] == "G"){ uch=uch+"%47"; }else if(ch[i] == "H"){ uch=uch+"%48"; }else if(ch[i] == "I"){ uch=uch+"%49"; }else if(ch[i] == "J"){ uch=uch+"%4A"; }else if(ch[i] == "K"){ uch=uch+"%4B"; }else if(ch[i] == "L"){ uch=uch+"%4C"; }else if(ch[i] == "M"){ uch=uch+"%4D"; }else if(ch[i] == "N"){ uch=uch+"%4E"; }else if(ch[i] == "O"){ uch=uch+"%4F"; }else if(ch[i] == "P"){ uch=uch+"%50"; }else if(ch[i] == "Q"){ uch=uch+"%51"; }else if(ch[i] == "R"){ uch=uch+"%52"; }else if(ch[i] == "S"){ uch=uch+"%53"; }else if(ch[i] == "T"){ uch=uch+"%54"; }else if(ch[i] == "U"){ uch=uch+"%55"; }else if(ch[i] == "V"){ uch=uch+"%56"; }else if(ch[i] == "W"){ uch=uch+"%57"; }else if(ch[i] == "X"){ uch=uch+"%58"; }else if(ch[i] == "Y"){ uch=uch+"%59"; }else if(ch[i] == "Z"){ uch=uch+"%5A"; }else if(ch[i] == "["){ uch=uch+"%5B"; }else if(ch[i] == "\\"){ uch=uch+"%5C"; }else if(ch[i] == "]"){ uch=uch+"%5D"; }else if(ch[i] == "^"){ uch=uch+"%5E"; }else if(ch[i] == "_"){ uch=uch+"%5F"; }else if(ch[i] == "`"){ uch=uch+"%60"; }else if(ch[i] == "a"){ uch=uch+"%61"; }else if(ch[i] == "b"){ uch=uch+"%62"; }else if(ch[i] == "c"){ uch=uch+"%63"; }else if(ch[i] == "d"){ uch=uch+"%64"; }else if(ch[i] == "e"){ uch=uch+"%65"; }else if(ch[i] == "f"){ uch=uch+"%66"; }else if(ch[i] == "g"){ uch=uch+"%67"; }else if(ch[i] == "h"){ uch=uch+"%68"; }else if(ch[i] == "i"){ uch=uch+"%69"; }else if(ch[i] == "j"){ uch=uch+"%6A"; }else if(ch[i] == "k"){ uch=uch+"%6B"; }else if(ch[i] == "l"){ uch=uch+"%6C"; }else if(ch[i] == "m"){ uch=uch+"%6D"; }else if(ch[i] == "n"){ uch=uch+"%6E"; }else if(ch[i] == "o"){ uch=uch+"%6F"; }else if(ch[i] == "p"){ uch=uch+"%70"; }else if(ch[i] == "q"){ uch=uch+"%71"; }else if(ch[i] == "r"){ uch=uch+"%72"; }else if(ch[i] == "s"){ uch=uch+"%73"; }else if(ch[i] == "t"){ uch=uch+"%74"; }else if(ch[i] == "u"){ uch=uch+"%75"; }else if(ch[i] == "v"){ uch=uch+"%76"; }else if(ch[i] == "w"){ uch=uch+"%77"; }else if(ch[i] == "x"){ uch=uch+"%78"; }else if(ch[i] == "y"){ uch=uch+"%79"; }else if(ch[i] == "z"){ uch=uch+"%7A"; }else if(ch[i] == "{"){ uch=uch+"%7B"; }else if(ch[i] == "|"){ uch=uch+"%7C"; }else if(ch[i] == "}"){ uch=uch+"%7D"; }else if(ch[i] == "~"){ uch=uch+"%7E"; }else if(ch[i] == "'"){ uch=uch+"%20%18"; }else if(ch[i] == "'"){ uch=uch+"%20%19"; }else if(ch[i] == "\""){ uch=uch+"%20%1C"; }else if(ch[i] == "\""){ uch=uch+"%20%1D"; }else if(ch[i] == "•"){ uch=uch+"%20%22"; }else if(ch[i] == "–"){ uch=uch+"%20%13"; }else if(ch[i] == "—"){ uch=uch+"%20%14"; }else if(ch[i] == "¡"){ uch=uch+"%E0%B8%81"; }else if(ch[i] == "¢"){ uch=uch+"%E0%B8%82"; }else if(ch[i] == "£"){ uch=uch+"%E0%B8%83"; }else if(ch[i] == "¤"){ uch=uch+"%E0%B8%84"; }else if(ch[i] == "¥"){ uch=uch+"%E0%B8%85"; }else if(ch[i] == "¦"){ uch=uch+"%E0%B8%86"; }else if(ch[i] == "§"){ uch=uch+"%E0%B8%87"; }else if(ch[i] == "¨"){ uch=uch+"%E0%B8%88"; }else if(ch[i] == "©"){ uch=uch+"%E0%B8%89"; }else if(ch[i] == "ª"){ uch=uch+"%E0%B8%8A"; }else if(ch[i] == "«"){ uch=uch+"%E0%B8%8B"; }else if(ch[i] == "¬"){ uch=uch+"%E0%B8%8C"; }else if(ch[i] == "­"){ uch=uch+"%E0%B8%8D"; }else if(ch[i] == "®"){ uch=uch+"%E0%B8%8E"; }else if(ch[i] == "¯"){ uch=uch+"%E0%B8%8F"; }else if(ch[i] == "°"){ uch=uch+"%E0%B8%90"; }else if(ch[i] == "±"){ uch=uch+"%E0%B8%91"; }else if(ch[i] == "²"){ uch=uch+"%E0%B8%92"; }else if(ch[i] == "³"){ uch=uch+"%E0%B8%93"; }else if(ch[i] == "´"){ uch=uch+"%E0%B8%94"; }else if(ch[i] == "µ"){ uch=uch+"%E0%B8%95"; }else if(ch[i] == "¶"){ uch=uch+"%E0%B8%96"; }else if(ch[i] == "·"){ uch=uch+"%E0%B8%97"; }else if(ch[i] == "¸"){ uch=uch+"%E0%B8%98"; }else if(ch[i] == "¹"){ uch=uch+"%E0%B8%99"; }else if(ch[i] == "º"){ uch=uch+"%E0%B8%9A"; }else if(ch[i] == "»"){ uch=uch+"%E0%B8%9B"; }else if(ch[i] == "¼"){ uch=uch+"%E0%B8%9C"; }else if(ch[i] == "½"){ uch=uch+"%E0%B8%9D"; }else if(ch[i] == "¾"){ uch=uch+"%E0%B8%9E"; }else if(ch[i] == "¿"){ uch=uch+"%E0%B8%9F"; }else if(ch[i] == "À"){ uch=uch+"%E0%B8%A0"; }else if(ch[i] == "Á"){ uch=uch+"%E0%B8%A1"; }else if(ch[i] == "Â"){ uch=uch+"%E0%B8%A2"; }else if(ch[i] == "Ã"){ uch=uch+"%E0%B8%A3"; }else if(ch[i] == "Ä"){ uch=uch+"%E0%B8%A4"; }else if(ch[i] == "Å"){ uch=uch+"%E0%B8%A5"; }else if(ch[i] == "Æ"){ uch=uch+"%E0%B8%A6"; }else if(ch[i] == "Ç"){ uch=uch+"%E0%B8%A7"; }else if(ch[i] == "È"){ uch=uch+"%E0%B8%A8"; }else if(ch[i] == "É"){ uch=uch+"%E0%B8%A9"; }else if(ch[i] == "Ê"){ uch=uch+"%E0%B8%AA"; }else if(ch[i] == "Ë"){ uch=uch+"%E0%B8%AB"; }else if(ch[i] == "Ì"){ uch=uch+"%E0%B8%AC"; }else if(ch[i] == "Í"){ uch=uch+"%E0%B8%AD"; }else if(ch[i] == "Î"){ uch=uch+"%E0%B8%AE"; }else if(ch[i] == "Ï"){ uch=uch+"%E0%B8%AF"; }else if(ch[i] == "Ð"){ uch=uch+"%E0%B8%B0"; }else if(ch[i] == "Ñ"){ uch=uch+"%E0%B8%B1"; }else if(ch[i] == "Ò"){ uch=uch+"%E0%B8%B2"; }else if(ch[i] == "Ó"){ uch=uch+"%E0%B8%B3"; }else if(ch[i] == "Ô"){ uch=uch+"%E0%B8%B4"; }else if(ch[i] == "Õ"){ uch=uch+"%E0%B8%B5"; }else if(ch[i] == "Ö"){ uch=uch+"%E0%B8%B6"; }else if(ch[i] == "×"){ uch=uch+"%E0%B8%B7"; }else if(ch[i] == "Ø"){ uch=uch+"%E0%B8%B8"; }else if(ch[i] == "Ù"){ uch=uch+"%E0%B8%B9"; }else if(ch[i] == "Ú"){ uch=uch+"%E0%B8%BA"; }else if(ch[i] == "ß"){ uch=uch+"%E0%B8%BF"; }else if(ch[i] == "à"){ uch=uch+"%E0%B9%80"; }else if(ch[i] == "á"){ uch=uch+"%E0%B9%81"; }else if(ch[i] == "â"){ uch=uch+"%E0%B9%82"; }else if(ch[i] == "ã"){ uch=uch+"%E0%B9%83"; }else if(ch[i] == "ä"){ uch=uch+"%E0%B9%84"; }else if(ch[i] == "Ò"){ uch=uch+"%E0%B9%85"; }else if(ch[i] == "æ"){ uch=uch+"%E0%B9%86"; }else if(ch[i] == "ç"){ uch=uch+"%E0%B9%87"; }else if(ch[i] == "è"){ uch=uch+"%E0%B9%88"; }else if(ch[i] == "é"){ uch=uch+"%E0%B9%89"; }else if(ch[i] == "ê"){ uch=uch+"%E0%B9%8A"; }else if(ch[i] == "ë"){ uch=uch+"%E0%B9%8B"; }else if(ch[i] == "ì"){ uch=uch+"%E0%B9%8C"; }else if(ch[i] == "í"){ uch=uch+"%E0%B9%8D"; }else if(ch[i] == "î"){ uch=uch+"%E0%B9%8E"; }else if(ch[i] == "ï"){ uch=uch+"%E0%B9%8F"; }else if(ch[i] == "ð"){ uch=uch+"%E0%B9%90"; }else if(ch[i] == "ñ"){ uch=uch+"%E0%B9%91"; }else if(ch[i] == "ò"){ uch=uch+"%E0%B9%92"; }else if(ch[i] == "ó"){ uch=uch+"%E0%B9%93"; }else if(ch[i] == "ô"){ uch=uch+"%E0%B9%94"; }else if(ch[i] == "õ"){ uch=uch+"%E0%B9%95"; }else if(ch[i] == "ö"){ uch=uch+"%E0%B9%96"; }else if(ch[i] == "÷"){ uch=uch+"%E0%B9%97"; }else if(ch[i] == "ø"){ uch=uch+"%E0%B9%98"; }else if(ch[i] == "ù"){ uch=uch+"%E0%B9%99"; }else if(ch[i] == "ú"){ uch=uch+"%E0%B9%9A"; }else if(ch[i] == "û"){ uch=uch+"%E0%B9%9B"; }else{ uch=uch+"%3F"; } } //alert(uch); return uch; } //########################################################### µÃǨÊͺ¤ÇÒÁ¶Ù¡µéͧ¢Í§¢éÍÁÙÅ function ValidThaiId(CId){ if(CId.length != 13){ return false; } var sum = 0; var numbers = "1234567890"; for(var i = 0 ; i < 12 ; i++){ if(numbers.indexOf(CId.charAt(i)) == -1){ return false; } sum+=CId.charAt(i) * (13 - i); } var lastDigit = 11 - sum%11; if(lastDigit >= 10) lastDigit -= 10; if(CId.charAt(12) != lastDigit){ return false; }else{ return true; } } function echeck(str){ var at="@"; var dot="."; var lat=str.indexOf(at); var lstr=str.length; var ldot=str.indexOf(dot); if(str.indexOf(at)==-1){ return false;} if(str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false;} if(str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false;} if(str.indexOf(at,(lat+1))!=-1){ return false;} if(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false;} if(str.indexOf(dot,(lat+2))==-1){ return false;} if(str.indexOf(" ")!=-1){ return false;} var emailRegEx= /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i; if(str.search(emailRegEx) == -1) { return false;} return true; } function mcheck(str){ //123456789012 //012345678901 //081-807-9880 if(str.length != 12 || !str.search("-") || str.charAt(0) != "0" || (str.charAt(1) != "8" && str.charAt(1) != "9") || str.charAt(3) != "-" || str.charAt(7) != "-"){ return false; } s=str.split(""); patt=/[0-9]/; if(patt.test(s[0]) && patt.test(s[1]) && patt.test(s[2]) && patt.test(s[4]) && patt.test(s[5]) && patt.test(s[6]) && patt.test(s[8]) && patt.test(s[9]) && patt.test(s[10]) && patt.test(s[11])){ return true; } } function pcheck(str){ //12345678901 //01234567890 //01-345-7890 if(str.length != 11 || !str.search("-") || str.charAt(0) != "0" || str.charAt(2) != "-" || str.charAt(6) != "-"){ return false; } s=str.split(""); patt=/[0-9]/; if(patt.test(s[0]) && patt.test(s[1]) && patt.test(s[3]) && patt.test(s[4]) && patt.test(s[5]) && patt.test(s[7]) && patt.test(s[8]) && patt.test(s[9]) && patt.test(s[10])){ return true; } } function Urlcheck(strUrl){ var RegexUrl = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ return RegexUrl.test(strUrl); } function CharCheckName(str){ var checkOK1="\""; var checkOK2="\\"; var checkOK="!@#$%^&*()_+|=-{}[];:?/.<>ßð'"+checkOK1+checkOK2+" ,"; var allValid=false; for(i=0;i