/*---------------------------------------------------------------------------- Purpose : Encode Password 함수 Param. : Encoding할 문자열, 암호화키 ----------------------------------------------------------------------------*/ Ref = "`1234567890-=~!@#$%^&*()_+qwertyuiop[]QWERTYUIOP{}|asdfghjkl;ASDFGHJKL:zxcvbnm,./ZXCVBNM<>?"; function encode (OrigString, CipherVal) { CipherVal = parseInt(CipherVal); var Temp="" for (Count=0; Count < OrigString.length; Count++) { var TempChar = OrigString.substring (Count, Count+1) var Conv = cton(TempChar) var Cipher=Conv^CipherVal Cipher=ntoc(Cipher) Temp += Cipher } return (Temp) } function decode (OrigString, CipherVal) { CipherVal = parseInt(CipherVal); var Temp="" for (Count=0; Count < OrigString.length; Count++) { var TempChar = OrigString.substring (Count, Count+1) var Conv = cton(TempChar) var Cipher=Conv^CipherVal Cipher=ntoc(Cipher) Temp += Cipher } return (Temp) } function cton (Char) { return (Ref.indexOf(Char)); } function ntoc (Val) { return (Ref.substring(Val, Val+1)) } var expdate = new Date(); expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); function getCookieVal (offset){ // (ver 1.0) var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name){ // (ver 1.0) var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen){ var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value){ // (ver 1.0) var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (2 < argc) ? argv[2] : null; var path = (3 < argc) ? argv[3] : null; var domain = (4 < argc) ? argv[4] : null; var secure = (5 < argc) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function delCookie (name) { // (ver 1.0) var expireNow = new Date(); document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/;domain=vmsclub.com"; } function checkIn(){ // (ver 1.0) if(!document.forms[0].Username.value){ alert("ID를 입력해 주세요!! "); document.forms[0].Username.focus(); return; } if(!document.forms[0].Password.value){ alert("PASSWORD를 입력해 주세요!! "); document.forms[0].Password.focus(); return; } FormSubmit(); //document.forms[0].submit(); } function FormSubmit() { // (ver 1.0) var f = document.forms[0]; var UserName = f.Username.value; var Password = f.Password.value; var expire = new Date(); var randNum = expire.getSeconds(); cipherVal = (randNum % 10) + 1; var cookieVal = "id=" + f.Username.value + "&pw=" + f.Password.value; SetCookie("LoginInfo", encode(cookieVal, cipherVal), null,"/","vmsclub.com",false); SetCookie("CipherVal", cipherVal, null, "/","vmsclub.com",false); document.forms[0].submit(); }