function clearFields() { frm1.Username.value = ""; frm1.Password.value = ""; } function write_it(status_text) { window.status=status_text; } function setFormAction(selObj){ location.href = selObj.value; } function switchDivision(name) { if (prev == '') { eval("document.all." + name + ".style.display = ''"); prev = 'home'; eval("document.all." + prev + ".style.display = 'none'"); } else { eval("document.all." + name + ".style.display = ''"); eval("document.all." + prev + ".style.display = 'none'"); } prev = name; } function toggleDivision(id) { if (eval("document.getElementById('" + id + "').style.display == 'none'")) { eval("document.getElementById('" + id + "').style.display = ''"); } else { eval("document.getElementById('" + id + "').style.display = 'none'"); } } function showDivision(which_division) { document.getElementById(which_division).style.display = ""; } function hideDivision(which_division) { document.getElementById(which_division).style.display = "none"; } function displaySubs(the_sub) { if (document.getElementById(the_sub).style.display=="") { document.getElementById(the_sub).style.display = "none"; return; } for (i=0;i\/?]{3,40}$/ var StringMatches = myUsername.match(pattern); if (!StringMatches) { alert("The username should be 3 - 40 characters in length."); el.focus(); return false; } } if (el.type == "password" && el.name == "Password" && compulsory == "true") { myPassword = el.value; if (el.value == "") { alert("Please supply a password."); el.focus(); return false; } var pattern = /^[a-zA-Z0-9! @#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{6,20}$/ var StringMatches = myPassword.match(pattern); if (!StringMatches) { alert("The password should be 6 - 20 characters in length."); el.focus(); return false; } } } return true; } function clearAllRegFields() { if (document.getElementById("FirstName")) document.getElementById('FirstName').value = ""; if (document.getElementById("FirstNameValidation")) document.getElementById('FirstNameValidation').innerText = ""; if (document.getElementById("Cellphone")) document.getElementById('Cellphone').value = ""; if (document.getElementById("CellphoneValidation")) document.getElementById('CellphoneValidation').innerText = ""; if (document.getElementById('Email')) document.getElementById('Email').innerText = ""; if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } function validateQuickRegisterForm(form) { for (var e = 0; e < form.elements.length; e++) { var el = form.elements[e]; if (el.type == "text" && el.name == "Email") { email = el.value; if (el.value == "") { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Required"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; el.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } var splitted = email.match("^(.+)@(.+)$"); if(splitted == null) { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Invalid"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; el.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } if(splitted[1] != null) { var regexp_user=/^\"?[\w-_\.]*\"?$/; if(splitted[1].match(regexp_user) == null) { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Invalid"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; el.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } } if(splitted[2] != null) { var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/; if(splitted[2].match(regexp_domain) == null) { var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/; if(splitted[2].match(regexp_ip) == null) { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Invalid"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; el.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } } } } if (el.type == "text" && el.name == "FirstName") { if (el.value == "") { if (document.getElementById("FirstNameValidation")) document.getElementById('FirstNameValidation').innerText = "Required"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; el.focus(); return false; } else { if (document.getElementById("FirstNameValidation")) document.getElementById('FirstNameValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } } if (el.type == "text" && el.name == "Cellphone") { if (el.value == "") { if (document.getElementById("CellphoneValidation")) document.getElementById('CellphoneValidation').innerText = "Required"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; el.focus(); return false; } else { if (document.getElementById("CellphoneValidation")) document.getElementById('CellphoneValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } } } if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; return true; } function checkFirstName(input) { if (document.getElementById('FirstName') && (input = "document.getElementById('FirstName')") && input.value == "") { if (document.getElementById('FirstNameValidation')) document.getElementById('FirstNameValidation').innerText = "Required"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById("SendButton")) document.getElementById("SendButton").disabled = true; } else { if (document.getElementById('FirstNameValidation')) document.getElementById('FirstNameValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } } function checkEmail() { var email = document.getElementById('Email'); if (document.getElementById('Email') && email.value == "" ) { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Required"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; email.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } var splitted = email.value.match("^(.+)@(.+)$"); if(splitted == null) { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Invalid"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; email.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } if(splitted[1] != null) { var regexp_user=/^\"?[\w-_\.]*\"?$/; if(splitted[1].match(regexp_user) == null) { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Invalid"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; email.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } } if(splitted[2] != null) { var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/; if(splitted[2].match(regexp_domain) == null) { var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/; if(splitted[2].match(regexp_ip) == null) { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = "Invalid"; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; email.focus(); return false; } else { if (document.getElementById('EmailValidation')) document.getElementById('EmailValidation').innerText = ""; if (document.getElementById('RegisterButton'))document.getElementById('RegisterButton').disabled = false; } } } } function checkCellphone(input) { if (document.getElementById('Cellphone') && (input = "document.getElementById('Cellphone')") && input.value == "" ) { if (document.getElementById('CellphoneValidation')) document.getElementById('CellphoneValidation').innerText = "Required"; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = true; if (document.getElementById('Confirmation')) document.getElementById('Confirmation').innerText = ""; } else { if (document.getElementById('CellphoneValidation')) document.getElementById('CellphoneValidation').innerText = ""; if (document.getElementById('RegisterButton')) document.getElementById('RegisterButton').disabled = false; } } function validateEmail(form, compulsory) { for (var e = 0; e < form.elements.length; e++) { var el = form.elements[e]; if (el.type == 'text' && el.name == 'Email' && (el.value != "" || compulsory == 'True')) { email = el.value; var splitted = email.match("^(.+)@(.+)$"); if(splitted == null) { alert("Please supply a valid e-mail address"); el.focus(); return false; } if(splitted[1] != null) { var regexp_user=/^\"?[\w-_\.]*\"?$/; if(splitted[1].match(regexp_user) == null) { alert("Please supply a valid e-mail address"); el.focus(); return false; } } if(splitted[2] != null) { var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/; if(splitted[2].match(regexp_domain) == null) { var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/; if(splitted[2].match(regexp_ip) == null) { alert("Please supply a valid e-mail address"); el.focus(); return false; } } } } } return true; } function confirmEmail(emailsupplied,goDiv,stopDiv) { emailconfirmed = document.getElementById("EConfirm").value; if (emailsupplied != emailconfirmed) { hideDivision(goDiv); showDivision(stopDiv); } else { var n = window.location.href.includes("quick_registration_confirm.asp"); var m = window.location.href.includes("query_check.asp"); showDivision(goDiv); hideDivision(stopDiv); hideDivision('Testing'); if (n) { document.getElementById("addClient").action = "quick_registration_accepted.asp"; document.getElementById("addClient").submit(); } else if (m) { document.getElementById("frmQuerySend").action = "query_send.asp"; document.getElementById("frmQuerySend").submit(); } } } function checkClicked(form) { for (var e = 0; e < form.elements.length; e++) { var el = form.elements[e]; if (el.type == 'checkbox') { var group = form[el.name]; if (group.length) { var checked = false; for (var r = 0; r < group.length; r++) if ((checked = group[r].checked)) break; if (!checked) { alert("Please check one of the checkboxes"); el.focus(); return false; } } } } return true; } function ValidDate(dateStr, e) { var datePat = /^(\d{4})(\/)(\d{2})\2(\d{2})$/; var DateArray = dateStr.match(datePat); if (DateArray == null) { alert("Date is not in a valid format."); eval("document.all.txtDate" + e + ".value = ''"); eval("document.all.txtDate" + e + ".focus()"); return false; } return true; } function isValidDate(dateStr, e) { // Checks for the following valid date formats: // MM/DD/YY MM/DD/YYYY MM-DD-YY MM-DD-YYYY // Also separates date into month, day, and year variables var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/; var matchArray = dateStr.match(datePat); // is the format ok? if (matchArray == null) { alert("Date is not in a valid format."); eval("document.all.txtDate" + e + ".value = ''"); eval("document.all.txtDate" + e + ".focus()"); return false; } day = matchArray[1]; // parse date into variables month = matchArray[3]; year = matchArray[4]; if (month < 1 || month > 12) { // check month range alert("Month must be between 1 and 12."); return false; } if (day < 1 || day > 31) { alert("Day must be between 1 and 31."); return false; } if ((month==4 || month==6 || month==9 || month==11) && day==31) { alert("Month "+month+" doesn\'t have 31 days!"); return false } if (month == 2) { // check for february 29th var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day>29 || (day==29 && !isleap)) { alert("February " + year + " doesn\'t have " + day + " days!"); return false; } } return true; // date is valid } var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December") function getthedate(){ var mydate=new Date() var year=mydate.getYear() if (year < 1000) year+=1900 var day=mydate.getDay() var month=mydate.getMonth() var daym=mydate.getDate() if (daym<10) daym="0"+daym var hours=mydate.getHours() var minutes=mydate.getMinutes() var seconds=mydate.getSeconds() var dn="AM" if (hours>=12) dn="PM" if (hours>12){ hours=hours-12 } if (hours==0) hours=12 if (minutes<=9) minutes="0"+minutes if (seconds<=9) seconds="0"+seconds //change font size here var cdate=""+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"" if (document.all) document.all.clock.innerHTML=cdate else if (document.getElementById) document.getElementById("clock").innerHTML=cdate else document.write(cdate) } if (!document.all&&!document.getElementById) getthedate() function timeDisplay(){ if (document.all||document.getElementById) setInterval("getthedate()",1000) } function newWindow(href,w,h) { window.open(href,"","toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width="+w+",height="+h+""); } function downloadInstructions() { alert("Save the zip file that will open next, to your hard drive.\n\r" + "Unzip the file to a new folder.\n\r" + "Open the .htm file."); } function myVoid() { ; } // do nothing function deleteThis(what,location) { question = "Are you sure that you want to delete this "+what+"?"; if (confirm(question)) { document.location.href = location; } } function deleteAll(what,location) { question = "Are you sure that you want to delete this "+what+", together with all data associated with it?"; if (confirm(question)) { document.location.href = location; } } function quickDelete(what,formname,location) { question = "Are you sure that you want to delete this "+what+", together with all data associated with it?"; if (confirm(question)) { var whatform = document.getElementById(formname); whatform.Status.value = "ScreenDisplay"; whatform.method = "get"; whatform.action = location; whatform.submit(); } } function NumberFormat(num, inputDecimal, decimalPlaces) { this.VERSION = 'Number Format v1.5.4'; this.COMMA = ','; this.PERIOD = '.'; this.DASH = '-'; this.LEFT_PAREN = '('; this.RIGHT_PAREN = ')'; this.LEFT_OUTSIDE = 0; this.LEFT_INSIDE = 1; this.RIGHT_INSIDE = 2; this.RIGHT_OUTSIDE = 3; this.LEFT_DASH = 0; this.RIGHT_DASH = 1; this.PARENTHESIS = 2; this.NO_ROUNDING = -1 this.num; this.numOriginal; this.hasSeparators = false; this.separatorValue; this.inputDecimalValue; this.decimalValue; this.negativeFormat; this.negativeRed; this.hasCurrency; this.currencyPosition; this.currencyValue; this.places; this.roundToPlaces; this.truncate; this.setNumber = setNumberNF; this.toUnformatted = toUnformattedNF; this.setInputDecimal = setInputDecimalNF; this.setSeparators = setSeparatorsNF; this.setCommas = setCommasNF; this.setNegativeFormat = setNegativeFormatNF; this.setNegativeRed = setNegativeRedNF; this.setCurrency = setCurrencyNF; this.setCurrencyPrefix = setCurrencyPrefixNF; this.setCurrencyValue = setCurrencyValueNF; this.setCurrencyPosition = setCurrencyPositionNF; this.setPlaces = setPlacesNF; this.toFormatted = toFormattedNF; this.toPercentage = toPercentageNF; this.getOriginal = getOriginalNF; this.moveDecimalRight = moveDecimalRightNF; this.moveDecimalLeft = moveDecimalLeftNF; this.getRounded = getRoundedNF; this.preserveZeros = preserveZerosNF; this.justNumber = justNumberNF; this.expandExponential = expandExponentialNF; this.getZeros = getZerosNF; this.moveDecimalAsString = moveDecimalAsStringNF; this.moveDecimal = moveDecimalNF; this.addSeparators = addSeparatorsNF; if (inputDecimal == null) { this.setNumber(num, this.PERIOD); } else { this.setNumber(num, inputDecimal); } this.setCommas(true); this.setNegativeFormat(this.LEFT_DASH); this.setNegativeRed(false); this.setCurrency(false); this.setCurrencyPrefix('$'); this.setPlaces(decimalPlaces); } function setInputDecimalNF(val) { this.inputDecimalValue = val; } function setNumberNF(num, inputDecimal) { if (inputDecimal != null) { this.setInputDecimal(inputDecimal); } this.numOriginal = num; this.num = this.justNumber(num); } function toUnformattedNF() { return (this.num); } function getOriginalNF() { return (this.numOriginal); } function setNegativeFormatNF(format) { this.negativeFormat = format; } function setNegativeRedNF(isRed) { this.negativeRed = isRed; } function setSeparatorsNF(isC, separator, decimal) { this.hasSeparators = isC; if (separator == null) separator = this.COMMA; if (decimal == null) decimal = this.PERIOD; if (separator == decimal) { this.decimalValue = (decimal == this.PERIOD) ? this.COMMA : this.PERIOD; } else { this.decimalValue = decimal; } this.separatorValue = separator; } function setCommasNF(isC) { this.setSeparators(isC, this.COMMA, this.PERIOD); } function setCurrencyNF(isC) { this.hasCurrency = isC; } function setCurrencyValueNF(val) { this.currencyValue = val; } function setCurrencyPrefixNF(cp) { this.setCurrencyValue(cp); this.setCurrencyPosition(this.LEFT_OUTSIDE); } function setCurrencyPositionNF(cp) { this.currencyPosition = cp } function setPlacesNF(p, tr) { this.roundToPlaces = !(p == this.NO_ROUNDING); this.truncate = (tr != null && tr); this.places = (p < 0) ? 0 : p; } function addSeparatorsNF(nStr, inD, outD, sep) { nStr += ''; var dpos = nStr.indexOf(inD); var nStrEnd = ''; if (dpos != -1) { nStrEnd = outD + nStr.substring(dpos + 1, nStr.length); nStr = nStr.substring(0, dpos); } var rgx = /(\d+)(\d{3})/; while (rgx.test(nStr)) { nStr = nStr.replace(rgx, '$1' + sep + '$2'); } return nStr + nStrEnd; } function toFormattedNF() { var pos; var nNum = this.num; var nStr; var splitString = new Array(2); if (this.roundToPlaces) { nNum = this.getRounded(nNum); nStr = this.preserveZeros(Math.abs(nNum)); } else { nStr = this.expandExponential(Math.abs(nNum)); } if (this.hasSeparators) { nStr = this.addSeparators(nStr, this.PERIOD, this.decimalValue, this.separatorValue); } else { nStr = nStr.replace(new RegExp('\\' + this.PERIOD), this.decimalValue); } var c0 = ''; var n0 = ''; var c1 = ''; var n1 = ''; var n2 = ''; var c2 = ''; var n3 = ''; var c3 = ''; var negSignL = (this.negativeFormat == this.PARENTHESIS) ? this.LEFT_PAREN : this.DASH; var negSignR = (this.negativeFormat == this.PARENTHESIS) ? this.RIGHT_PAREN : this.DASH; if (this.currencyPosition == this.LEFT_OUTSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR; } if (this.hasCurrency) c0 = this.currencyValue; } else if (this.currencyPosition == this.LEFT_INSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR; } if (this.hasCurrency) c1 = this.currencyValue; } else if (this.currencyPosition == this.RIGHT_INSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n0 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n3 = negSignR; } if (this.hasCurrency) c2 = this.currencyValue; } else if (this.currencyPosition == this.RIGHT_OUTSIDE) { if (nNum < 0) { if (this.negativeFormat == this.LEFT_DASH || this.negativeFormat == this.PARENTHESIS) n1 = negSignL; if (this.negativeFormat == this.RIGHT_DASH || this.negativeFormat == this.PARENTHESIS) n2 = negSignR; } if (this.hasCurrency) c3 = this.currencyValue; } nStr = c0 + n0 + c1 + n1 + nStr + n2 + c2 + n3 + c3; if (this.negativeRed && nNum < 0) { nStr = '' + nStr + ''; } return (nStr); } function toPercentageNF() { nNum = this.num * 100; nNum = this.getRounded(nNum); return nNum + '%'; } function getZerosNF(places) { var extraZ = ''; var i; for (i=0; i= 0 ? Math.floor(val) : Math.ceil(val); } else { val = Math.round(val); } val = this.moveDecimalLeft(val); return val; } function preserveZerosNF(val) { var i; val = this.expandExponential(val); if (this.places <= 0) return val; var decimalPos = val.indexOf('.'); if (decimalPos == -1) { val += '.'; for (i=0; i