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.form1.locale.value = ''; doTallerLogin(0,0); } function doLoginAccessible() { document.form1.locale.value = 'en_ACCESSIBLE'; doTallerLogin(0,1); } function doTallerLogin( extra,scrollable ) { if ( ! checkBrowser() ) { alert("You need IE 6.0 or above."); return; } 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. if (lms_win != null && typeof(lms_win.doLogout) != "undefined") lms_win.doLogout = false; setTimeout( "clearPasswordField()", 3000 ); } document.form1.action = fixExtension( document.form1.action ); document.form1.submit(); } } function checkBrowser() { if (navigator.appName.indexOf("Microsoft") != -1) { var version= navigator.appVersion; var msie = version.indexOf("MSIE"); var msieStr = version.substring(msie); var endIndex = msieStr.indexOf(";"); var realStr = msieStr.substring(4, endIndex); var realVersion = parseFloat(realStr); if ( realVersion >= 5.5 ) { return true; } } return (thisPage.getPassedParm("browser") != "") ? true : false; } 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.form1.password.value = ""; } function checkFields() { if(EmptyField("ID", document.form1.userid.value) || !ValidField("ID", document.form1.userid.value, 255, badSIDchars)) { document.form1.userid.focus(); document.form1.userid.select(); return false; } if(document.form1.userid.value != "") { if(!ValidPassword(document.form1.password.value)) { document.form1.password.focus(); document.form1.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