__mg_IsAuth = '-1'; function GolfSEPasswordValidator(strClientId, strErrorText) { this.clientId = strClientId; this.errorText = strErrorText; } GolfSEPasswordValidator.prototype.validate = function() { /* * Valid format: 4 digits * Valid format: min. 6 characters, letters a-z, upper and lower case + 0-9. * must contain at least two digits * Example: aBc03F */ var pwd = jQuery.trim(jQuery('#' + this.clientId).val()); var iPwd = 0; if (_regExp(this, /^\d{4}$/)) return true; if (_regExp(this, /^[a-zA-Z0-9]{6,}$/)) { // The RegExp format was valid now test if the password // contains at least two digits for (var i = 0; i < pwd.length; i++) { if (!isNaN(pwd.substr(i, 1))) { iPwd++; } } if (iPwd >= 2) return true; } return false; }; function getObj(id) { if (document.getElementById) return (document.getElementById(id)) ? document.getElementById(id) : null; else if (document.all) return (document.all[id]) ? document.all[id] : null; else if (document.layers) return (document.layers[id]) ? document.layers[id] : null; else return null; } _GolfId_allowCursorMove = true function GolfId_moveCursor(objTxt1, objTxt2, stringLength){ objUrs1 = getObj(objTxt1) objUrs2 = getObj(objTxt2) if(objUrs1.value.length == stringLength){ if (_GolfId_allowCursorMove) { try { objUrs2.focus(); } catch (e){} } } if(objUrs1.value.length == 1){ _GolfId_allowCursorMove = true } } function GolfId_allowFocus(){ _GolfId_allowCursorMove = false } function onbeforepostback() { return true; } // event function onbeforeredirect() { return true; } // event function _validatePostBack(strCommand){ if(arguments[2]){ // a browser comp. hack var theValidatorObject = eval(arguments[2]) } else { if (typeof(cv) == 'object'){ var theValidatorObject = cv } else { var theValidatorObject = eval('cv') } } theValidatorObject.validate() if (!theValidatorObject.isValid) { theValidatorObject.render() } else { // use the .net framework postback functions //(arguments[1]) ? __doPostBack(strCommand,arguments[1]) : __doPostBack(strCommand); if(onbeforepostback(strCommand, arguments[1])){ (arguments[1]) ? _postBack(strCommand,arguments[1]) : _postBack(strCommand); } } } function _postBack(cmd) { _postBackTriggered = true; var form = document.forms['aspnetForm']; if (!form) form = document.aspnetForm; form.__EVENTTARGET.value = cmd; if (arguments[1]) form.__EVENTARGUMENT.value = arguments[1]; if (onbeforepostback(cmd, arguments[1])) form.submit(); }