var badSIDchars = new String(" \"/\\[]:|=,+*?<>()"); // same as "nogood" array in CGI code. var badFieldchars = new String("\"\\"); var alphabet = new String("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); // same as decrypt.c but no '*' var isOnline = true; function doLogin() { document.forms["form1"].locale.value = ''; doTallerLogin(0,0); } function doLoginAccessible() { document.forms["form1"].locale.value = 'en_ACCESSIBLE'; doTallerLogin(0,1); } function doTallerLogin( extra,scrollable ) { if (!checkCookies()) { lmsPopup.open("/dpec/NoCookies.htm"); return; } if (checkFields()) { if (isOnline) { if (extra > 0) lmsPopup.extraHeight = extra; var lms_win = lmsPopup.open("", scrollable); // if the LMS window is already open, // prevent the unload handler from logging out. try { if (lms_win != null && typeof(lms_win.doLogout) != "undefined") lms_win.doLogout = false; } catch(e) {} setTimeout( "clearPasswordField()", 3000 ); } document.forms["form1"].action = fixExtension( document.forms["form1"].action ); document.forms["form1"].submit(); } } function checkCookies() { thisPage.setCookie("test","123"); if (thisPage.getCookie("test") != "123") return false; thisPage.setCookie("test","",-1000); thisPage.setCookie("test","123",1000); if (thisPage.getCookie("test") != "123") return false; thisPage.setCookie("test","",-1000); return true; } // allow for ASP/JSP flexibility function fixExtension( url ) { var result = new String(url); var pos = result.lastIndexOf("."); if (pos != -1) { result = result.substr(0, pos + 1); result += "jsp"; } return result; } function clearPasswordField() { // Netscape 4.x needs this to be separated from the submit() document.forms["form1"].password.value = ""; } function checkFields() { if(EmptyField("ID", document.forms["form1"].elements["userid"].value) || !ValidField("ID", document.forms["form1"].elements["userid"].value, 255, badSIDchars)) { document.forms["form1"].elements["userid"].focus(); document.forms["form1"].elements["userid"].select(); return false; } if(document.forms["form1"].elements["userid"].value != "") { if(!ValidPassword(document.forms["form1"].elements["password"].value)) { document.forms["form1"].elements["password"].focus(); document.forms["form1"].elements["password"].select(); return false; } } return true; } // COMMON HTML PAGE FUNCTIONS >>>>>>>>>>>>>>>>>> function ValidField(fieldName, fieldValue, maxLength, badChars) { if(ValidLength(fieldName, fieldValue.length, maxLength)) if(ValidChars(fieldName, fieldValue, badChars)) return true; return false; } function ValidLength(fieldName, fieldLength, maxLength) { if(fieldLength <= maxLength) return true; else { alert(fieldName.toUpperCase() + " exceeds " + maxLength + " characters"); return false; } } function ValidChars(fieldName, fieldValue, badChars) { for (var i=0; i