function LoadString(name) { // nextDay.setTime(now.getTime() + 24 * 60 * 60 * 1000) // document.cookie = name + "=" + value + "; path=/col/$currentRep/doc; expires=" + nextDay.toGMTString() var pattern = name + "=" if (document.cookie.length > 0) { i = document.cookie.indexOf(pattern) if (i != -1) { i += pattern.length end = document.cookie.indexOf(";", i) if (end == -1) end = document.cookie.length return document.cookie.substring(i, end) } } } function CodeKey(value) { string1 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; string2 = "uYqbALReBN8cEUjfzQWXOJv3Zlmr5s7PSDGoFx9Kg0a2n6CwkHVMi4yT1Idpht" valueLength = value.length newValue = "" for (var i = 0; i < valueLength; i++) { index = string1.indexOf(value.charAt(i)) if (index == -1) { newValue = newValue + value.charAt(i) } else { newValue = newValue + string2.charAt(index) } } return newValue } function ProcessKey(name, value, update, store, restrictedSubmission, currentPassword) { if (update) { var password1 = LoadString(name) if (password1 == null) { newValue = CodeKey(value) document.update.password1.value = newValue // codedpassword1 is necessary because some browsers don't accept changing the password field document.update.codedpassword1.value = newValue if (store) {StoreString(name, newValue)} } else { if (store) {StoreString(name, value)} } } else { // submit newValue = CodeKey(value) document.submit.password1.value = newValue document.submit.codedpassword1.value = newValue if (!restrictedSubmission) { newValue = CodeKey(document.submit.password2.value) document.submit.password2.value = newValue document.submit.codedpassword2.value = newValue } if (currentPassword) { newValue = CodeKey(document.submit.currentpassword.value) document.submit.currentpassword.value = newValue document.submit.codedcurrentpassword.value = newValue } } // history.back() /* doesn't work */ }