var badUserName='Invalid Username'; var shortUserName='Username must be at least 2 characters'; var longUserName='Username must be no more than |MAX_USERNAME_LENGTH| characters'; var noPassMatch='Passwords do not match'; var shortPass='Password is too short'; var shortDomain='Domain is too short'; var domainNeedsDot='Domain needs a dot'; var invalidDomain='Invalid Domain'; var badIP='Invalid IP'; var badEmail='Invalid E-Mail Address'; function nameOK(name) { var ch; var i; if (name.length < 2) return false; if (name.length > |MAX_USERNAME_LENGTH|) return false; for (i=0; i= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9')) || ch==' ' ) return false; else if (!((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || (ch=='_') || (ch=='-')) || ch==' ') return false; } return true; } function checkName() { with (document.reseller) { if (username.value.length < 2) { username.focus(); username.select(); alert(shortUserName); return false; } else if (username.value.length > |MAX_USERNAME_LENGTH|) { username.focus(); username.select(); alert(longUserName); return false; } else if (nameOK(username.value)) return true; else { username.focus(); username.select(); alert(badUserName); return false; } } return false; } function passOK() { with (document.reseller) { if (passwd.value.length < 5) { alert(shortPass); return 0; } if (passwd.value != passwd2.value) { alert(noPassMatch); return 0; } } return 1; } function checkPass() { with (document.reseller) { if (passOK()) return true; else { passwd2.value=""; passwd.focus(); passwd.select(); } } } function ipOK(ip) { var ch; var i; var dotCount = 0; if (ip.length < 7) return 0; if (ip.charAt(0) == '.' || ip.charAt(ip.length-1) == '.') return 0; for (i=0; i= 0 && ch <= 9) ) return 0; } if (dotCount < 3) return 0; return 1; } function checkDomainIP() { with (document.reseller) { if (sharedip.checked) return 1; if (!ipOK(ip.value)) { alert(badIP) ip.focus(); ip.select(); return 0; } } return 1; } function domainOK(domain) { var ch; var i; var dotCount = 0; if (domain.length < 3) { alert(shortDomain); return 0; } if (domain.charAt(domain.length-1) == '.') { alert(invalidDomain); return 0; } for (i=0; i= 20) { alert("Unable to generate a password with a number in it. Tried 20 times"); return "error1"; } var length = |RANDOM_PASSWORD_LENGTH|; |*if SPECIAL_CHARACTERS_IN_RANDOM_PASSWORDS="1"| var chars = ''; for (i=33; i<=126; i++) { if (i == 47) continue; if (i == 92) continue; chars = chars + String.fromCharCode(i); } |*else| var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; |*endif| var pass = ""; var i=0; for (i=0; i