addEvent(window, "load", initForm); var highlight_array = []; function trim(a) { return a.replace(/^\s+|\s+$/g, "") } function ltrim(a) { return a.replace(/^\s+/, "") } function rtrim(a) { return a.replace(/\s+$/, "") } function clientValidate(a, c) { clientValidateSubs(a, c, !0) } function customRequiredValidate(a, c) { customRequiredValidateSubs(a, c, !0) } function checkBoxRequiredValidate(a, c) { var d = document.getElementById(a.id.replace("vcusreq", "")); c.IsValid = !0 == d.checked }
function checkedListRequiredValidate(a, c) { checkedListRequiredValidateSubs(a, c, !0) }
function checkedListRequiredValidateSubs(a, c, d) { var e = !1, b = document.getElementById(a.id.replace("vcusreq", "")); if (null != b) for (var f = b.getElementsByTagName("input"), b = 0; b < f.length; b++) f[b].checked && (e = !0); b = a.getAttribute("subs"); a = null; if (null != b && (a = b.split("|"), d)) for (b = 0; b < a.length; b++) null != document.getElementById(a[b] + "cusreq") && "none" != document.getElementById(a[b] + "cusreq").style.display && document.getElementById(a[b] + "cusreq"); c.IsValid = e }
function customRequiredValidateSubs(a, c, d) { var e = a.getAttribute("subs"), b = null, f = !0; if (null != e && (b = e.split("|"), d)) for (i = 0; i < b.length; i++) null != document.getElementById(b[i] + "cusreq") && "none" != document.getElementById(b[i] + "cusreq").style.display && document.getElementById(b[i] + "cusreq").innerText == a.innerText && (f = !1); a = document.getElementById(a.controltovalidate); null != a && (c.IsValid = !f || "none" == a.style.display || null != a.value && "" != trim(a.value) ? !0 : !1) }
function clientValidateSubs(a, c, d) {
    c.IsValid = !0; var e = a.getAttribute("subs"), b = null; if (null != e && (b = e.split("|"), d)) for (i = 0; i < b.length && !(null != document.getElementById(b[i] + "cus") && (clientValidateSubs(document.getElementById(b[i] + "cus"), c, !1), !c.IsValid)); i++); d = a.id.replace("vcus", "vcusreq"); e = a.id.replace("vcus", "vcusreg"); c.IsValid && (null == document.getElementById(d) || "none" == document.getElementById(d).style.display) && (null == document.getElementById(e) || "none" == document.getElementById(e).style.display) ?
(removeClassName(getParentLi(a), "error", !0), c.IsValid = !0) : (addClassName(getParentLi(a), "error", !0), c.IsValid = !1)
} function initFormPartialPostBack() { browserDetect(); initializeFocus(); ifInstructs() } function initForm() { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(initFormPartialPostBack); browserDetect(); initializeFocus(); ifInstructs() } function getParentLi(a) { return null != a.parentNode && "LI" != a.parentNode.tagName && "DIV" != a.parentNode.tagName ? getParentLi(a.parentNode) : a.parentNode }
function initializeFocus() { fields = getElementsByClassName(document, "*", "field"); for (i = 0; i < fields.length; i++) fields[i].onfocus = function () { clearSafariRadios(); null != getParentLi(this) && addClassName(getParentLi(this), "focused", !0) }, fields[i].onblur = function () { null != getParentLi(this) && removeClassName(getParentLi(this), "focused") } }
function clearSafariRadios() { for (var a = 0; a < highlight_array.length; a++) highlight_array[a].parentNode && removeClassName(highlight_array[a].parentNode.parentNode.parentNode, "focused") } function ifInstructs() { var a = document.getElementById("public"); a && (removeClassName(a, "noI"), "" == getElementsByClassName(document, "*", "instruct") && addClassName(a, "noI", !0), 450 >= a.offsetWidth && addClassName(a, "altInstruct", !0)) }
function browserDetect() { var a = navigator.userAgent.toLowerCase(), c = document.getElementsByTagName("html"); a.indexOf("firefox") + 1 ? addClassName(c[0], "firefox", !0) : a.indexOf("chrome") + 1 ? addClassName(c[0], "chrome", !0) : a.indexOf("safari") + 1 && addClassName(c[0], "safari", !0) } function showRangeCounters() { counters = getElementsByClassName(document, "em", "currently"); for (i = 0; i < counters.length; i++) counters[i].style.display = "inline" }
function validateRange(a, c) { if (document.getElementById("rangeUsedMsg" + a)) { var d = document.getElementById("Field" + a), e = document.getElementById("rangeUsedMsg" + a); switch (c) { case "character": e.innerHTML = d.value.length; break; case "word": var d = d.value, d = d.replace(/\n/g, " "), d = d.split(" "), b = 0; for (i = 0; i < d.length; i++) "" != d[i].replace(/\s+$/, "") && b++; e.innerHTML = b; break; case "digit": e.innerHTML = d.value.length } } }
function getElementsByClassName(a, c, d) { a = "*" == c && a.all ? a.all : a.getElementsByTagName(c); c = []; d = d.replace(/\-/g, "\\-"); d = RegExp("(^|\\s)" + d + "(\\s|$)"); for (var e, b = 0; b < a.length; b++) e = a[b], d.test(e.className) && c.push(e); return c } function addClassName(a, c, d) { if (a.className) { var e = a.className.split(" "); if (d) { d = c.toUpperCase(); for (var b = 0; b < e.length; b++) e[b].toUpperCase() == d && (e.splice(b, 1), b--) } e[e.length] = c; a.className = e.join(" ") } else a.className = c }
function removeClassName(a, c) { if (a.className) { for (var d = a.className.split(" "), e = c.toUpperCase(), b = 0; b < d.length; b++) d[b].toUpperCase() == e && (d.splice(b, 1), b--); a.className = d.join(" ") } } function addEvent(a, c, d) { a.attachEvent ? (a["e" + c + d] = d, a[c + d] = function () { a["e" + c + d](window.event) }, a.attachEvent("on" + c, a[c + d])) : a.addEventListener(c, d, !1) }; function fileUploadRequiredValidate(source, args) {
    var fileUpload = document.getElementById(source.id.replace('vcusreq', ''));
    args.IsValid = (args.Value != '' || (fileUpload.getAttribute('fileCount') !== undefined && fileUpload.getAttribute('fileCount') != '' && fileUpload.getAttribute('fileCount') > 0));
    true;
}