3
ICAP

Support ICAP

To empower health around the world.

Connect Socially

Follow ICAP on social media.

<!-- Begin MailChimp Signup Form --><!-- [et_pb_line_break_holder] --><form action="https://columbia.us13.list-manage.com/subscribe/post?u=dc8e9a6b3434a0237605f7f56&id=75c129a805" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank"><!-- [et_pb_line_break_holder] --> <input type="email" value="" name="EMAIL" class="email-mailchimp-custom" id="mce-EMAIL" placeholder="Email Address" required><!-- [et_pb_line_break_holder] --> <div style="position: absolute; left: -5000px;" aria-hidden="true"><!-- [et_pb_line_break_holder] --> <input type="text" name="b_dc8e9a6b3434a0237605f7f56_75c129a805" tabindex="-1" value=""><!-- [et_pb_line_break_holder] --> </div><!-- [et_pb_line_break_holder] --><div class="mc-status"></div><!-- [et_pb_line_break_holder] --> <input type="submit" value="Update Newsletter Preferences" name="subscribe" id="mc-embedded-subscribe" class="button btn-blue-mailchimp-custom"><!-- [et_pb_line_break_holder] --></form><!-- [et_pb_line_break_holder] --><!--End mc_embed_signup-->
<script><!-- [et_pb_line_break_holder] -->// A Validity State Polyfill<!-- [et_pb_line_break_holder] -->;(function (window, document, undefined) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> 'use strict';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Make sure that ValidityState is supported in full (all features)<!-- [et_pb_line_break_holder] --> var supported = function () {<!-- [et_pb_line_break_holder] --> var input = document.createElement('input');<!-- [et_pb_line_break_holder] --> return ('validity' in input && 'badInput' in input.validity && 'patternMismatch' in input.validity && 'rangeOverflow' in input.validity && 'rangeUnderflow' in input.validity && 'stepMismatch' in input.validity && 'tooLong' in input.validity && 'tooShort' in input.validity && 'typeMismatch' in input.validity && 'valid' in input.validity && 'valueMissing' in input.validity);<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> /**<!-- [et_pb_line_break_holder] --> * Generate the field validity object<!-- [et_pb_line_break_holder] --> * @param {Node]} field The field to validate<!-- [et_pb_line_break_holder] --> * @return {Object} The validity object<!-- [et_pb_line_break_holder] --> */<!-- [et_pb_line_break_holder] --> var getValidityState = function (field) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Variables<!-- [et_pb_line_break_holder] --> var type = field.getAttribute('type') || input.nodeName.toLowerCase();<!-- [et_pb_line_break_holder] --> var isNum = type === 'number' || type === 'range';<!-- [et_pb_line_break_holder] --> var length = field.value.length;<!-- [et_pb_line_break_holder] --> var valid = true;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If radio group, get selected field<!-- [et_pb_line_break_holder] --> if (field.type === 'radio' && field.name) {<!-- [et_pb_line_break_holder] --> var group = document.getElementsByName(field.name);<!-- [et_pb_line_break_holder] --> if (group.length > 0) {<!-- [et_pb_line_break_holder] --> for (var i = 0; i < group.length; i++) {<!-- [et_pb_line_break_holder] --> if (group[i].form === field.form && field.checked) {<!-- [et_pb_line_break_holder] --> field = group[i];<!-- [et_pb_line_break_holder] --> break;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Run validity checks<!-- [et_pb_line_break_holder] --> var checkValidity = {<!-- [et_pb_line_break_holder] --> badInput: (isNum && length > 0 && !/[-+]?[0-9]/.test(field.value)), // value of a number field is not a number<!-- [et_pb_line_break_holder] --> patternMismatch: (field.hasAttribute('pattern') && length > 0 && new RegExp(field.getAttribute('pattern')).test(field.value) === false), // value does not conform to the pattern<!-- [et_pb_line_break_holder] --> rangeOverflow: (field.hasAttribute('max') && isNum && field.value > 0 && Number(field.value) > Number(field.getAttribute('max'))), // value of a number field is higher than the max attribute<!-- [et_pb_line_break_holder] --> rangeUnderflow: (field.hasAttribute('min') && isNum && field.value > 0 && Number(field.value) < Number(field.getAttribute('min'))), // value of a number field is lower than the min attribute<!-- [et_pb_line_break_holder] --> stepMismatch: (isNum && ((field.hasAttribute('step') && field.getAttribute('step') !== 'any' && Number(field.value) % Number(field.getAttribute('step')) !== 0) || (!field.hasAttribute('step') && Number(field.value) % 1 !== 0))), // value of a number field does not conform to the stepattribute<!-- [et_pb_line_break_holder] --> tooLong: (field.hasAttribute('maxLength') && field.getAttribute('maxLength') > 0 && length > parseInt(field.getAttribute('maxLength'), 10)), // the user has edited a too-long value in a field with maxlength<!-- [et_pb_line_break_holder] --> tooShort: (field.hasAttribute('minLength') && field.getAttribute('minLength') > 0 && length > 0 && length < parseInt(field.getAttribute('minLength'), 10)), // the user has edited a too-short value in a field with minlength<!-- [et_pb_line_break_holder] --> typeMismatch: (length > 0 && ((type === 'email' && !/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/.test(field.value)) || (type === 'url' && !/^(?:(?:https?|HTTPS?|ftp|FTP):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)(?:\.(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)*)(?::\d{2,5})?(?:[\/?#]\S*)?$/.test(field.value)))), // value of a email or URL field is not an email address or URL<!-- [et_pb_line_break_holder] --> valueMissing: (field.hasAttribute('required') && (((type === 'checkbox' || type === 'radio') && !field.checked) || (type === 'select' && field.options[field.selectedIndex].value < 1) || (type !=='checkbox' && type !== 'radio' && type !=='select' && length < 1))) // required field without a value<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Check if any errors<!-- [et_pb_line_break_holder] --> for (var key in checkValidity) {<!-- [et_pb_line_break_holder] --> if (checkValidity.hasOwnProperty(key)) {<!-- [et_pb_line_break_holder] --> // If there's an error, change valid value<!-- [et_pb_line_break_holder] --> if (checkValidity[key]) {<!-- [et_pb_line_break_holder] --> valid = false;<!-- [et_pb_line_break_holder] --> break;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Add valid property to validity object<!-- [et_pb_line_break_holder] --> checkValidity.valid = valid;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Return object<!-- [et_pb_line_break_holder] --> return checkValidity;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If the full set of ValidityState features aren't supported, polyfill<!-- [et_pb_line_break_holder] --> // if (!supported()) {<!-- [et_pb_line_break_holder] --> Object.defineProperty(HTMLInputElement.prototype, 'validity', {<!-- [et_pb_line_break_holder] --> get: function ValidityState() {<!-- [et_pb_line_break_holder] --> return getValidityState(this);<!-- [et_pb_line_break_holder] --> },<!-- [et_pb_line_break_holder] --> configurable: true,<!-- [et_pb_line_break_holder] --> });<!-- [et_pb_line_break_holder] --> // }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->})(window, document);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->/*<!-- [et_pb_line_break_holder] --> * classList.js: Cross-browser full element.classList implementation.<!-- [et_pb_line_break_holder] --> * 1.1.20170427<!-- [et_pb_line_break_holder] --> *<!-- [et_pb_line_break_holder] --> * By Eli Grey, http://eligrey.com<!-- [et_pb_line_break_holder] --> * License: Dedicated to the public domain.<!-- [et_pb_line_break_holder] --> * See https://github.com/eligrey/classList.js/blob/master/LICENSE.md<!-- [et_pb_line_break_holder] --> */<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->/*global self, document, DOMException */<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->if ("document" in self) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Full polyfill for browsers with no classList support<!-- [et_pb_line_break_holder] -->// Including IE < Edge missing SVGElement.classList<!-- [et_pb_line_break_holder] -->if (!("classList" in document.createElement("_")) <!-- [et_pb_line_break_holder] --> || document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->(function (view) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->"use strict";<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->if (!('Element' in view)) return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->var<!-- [et_pb_line_break_holder] --> classListProp = "classList"<!-- [et_pb_line_break_holder] --> , protoProp = "prototype"<!-- [et_pb_line_break_holder] --> , elemCtrProto = view.Element[protoProp]<!-- [et_pb_line_break_holder] --> , objCtr = Object<!-- [et_pb_line_break_holder] --> , strTrim = String[protoProp].trim || function () {<!-- [et_pb_line_break_holder] --> return this.replace(/^\s+|\s+$/g, "");<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> , arrIndexOf = Array[protoProp].indexOf || function (item) {<!-- [et_pb_line_break_holder] --> var<!-- [et_pb_line_break_holder] --> i = 0<!-- [et_pb_line_break_holder] --> , len = this.length<!-- [et_pb_line_break_holder] --> ;<!-- [et_pb_line_break_holder] --> for (; i < len; i++) {<!-- [et_pb_line_break_holder] --> if (i in this && this[i] === item) {<!-- [et_pb_line_break_holder] --> return i;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> return -1;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> // Vendors: please allow content code to instantiate DOMExceptions<!-- [et_pb_line_break_holder] --> , DOMEx = function (type, message) {<!-- [et_pb_line_break_holder] --> this.name = type;<!-- [et_pb_line_break_holder] --> this.code = DOMException[type];<!-- [et_pb_line_break_holder] --> this.message = message;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> , checkTokenAndGetIndex = function (classList, token) {<!-- [et_pb_line_break_holder] --> if (token === "") {<!-- [et_pb_line_break_holder] --> throw new DOMEx(<!-- [et_pb_line_break_holder] --> "SYNTAX_ERR"<!-- [et_pb_line_break_holder] --> , "An invalid or illegal string was specified"<!-- [et_pb_line_break_holder] --> );<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> if (/\s/.test(token)) {<!-- [et_pb_line_break_holder] --> throw new DOMEx(<!-- [et_pb_line_break_holder] --> "INVALID_CHARACTER_ERR"<!-- [et_pb_line_break_holder] --> , "String contains an invalid character"<!-- [et_pb_line_break_holder] --> );<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> return arrIndexOf.call(classList, token);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> , ClassList = function (elem) {<!-- [et_pb_line_break_holder] --> var<!-- [et_pb_line_break_holder] --> trimmedClasses = strTrim.call(elem.getAttribute("class") || "")<!-- [et_pb_line_break_holder] --> , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []<!-- [et_pb_line_break_holder] --> , i = 0<!-- [et_pb_line_break_holder] --> , len = classes.length<!-- [et_pb_line_break_holder] --> ;<!-- [et_pb_line_break_holder] --> for (; i < len; i++) {<!-- [et_pb_line_break_holder] --> this.push(classes[i]);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> this._updateClassName = function () {<!-- [et_pb_line_break_holder] --> elem.setAttribute("class", this.toString());<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> , classListProto = ClassList[protoProp] = []<!-- [et_pb_line_break_holder] --> , classListGetter = function () {<!-- [et_pb_line_break_holder] --> return new ClassList(this);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] -->;<!-- [et_pb_line_break_holder] -->// Most DOMException implementations don't allow calling DOMException's toString()<!-- [et_pb_line_break_holder] -->// on non-DOMExceptions. Error's toString() is sufficient here.<!-- [et_pb_line_break_holder] -->DOMEx[protoProp] = Error[protoProp];<!-- [et_pb_line_break_holder] -->classListProto.item = function (i) {<!-- [et_pb_line_break_holder] --> return this[i] || null;<!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] -->classListProto.contains = function (token) {<!-- [et_pb_line_break_holder] --> token += "";<!-- [et_pb_line_break_holder] --> return checkTokenAndGetIndex(this, token) !== -1;<!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] -->classListProto.add = function () {<!-- [et_pb_line_break_holder] --> var<!-- [et_pb_line_break_holder] --> tokens = arguments<!-- [et_pb_line_break_holder] --> , i = 0<!-- [et_pb_line_break_holder] --> , l = tokens.length<!-- [et_pb_line_break_holder] --> , token<!-- [et_pb_line_break_holder] --> , updated = false<!-- [et_pb_line_break_holder] --> ;<!-- [et_pb_line_break_holder] --> do {<!-- [et_pb_line_break_holder] --> token = tokens[i] + "";<!-- [et_pb_line_break_holder] --> if (checkTokenAndGetIndex(this, token) === -1) {<!-- [et_pb_line_break_holder] --> this.push(token);<!-- [et_pb_line_break_holder] --> updated = true;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> while (++i < l);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> if (updated) {<!-- [et_pb_line_break_holder] --> this._updateClassName();<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] -->classListProto.remove = function () {<!-- [et_pb_line_break_holder] --> var<!-- [et_pb_line_break_holder] --> tokens = arguments<!-- [et_pb_line_break_holder] --> , i = 0<!-- [et_pb_line_break_holder] --> , l = tokens.length<!-- [et_pb_line_break_holder] --> , token<!-- [et_pb_line_break_holder] --> , updated = false<!-- [et_pb_line_break_holder] --> , index<!-- [et_pb_line_break_holder] --> ;<!-- [et_pb_line_break_holder] --> do {<!-- [et_pb_line_break_holder] --> token = tokens[i] + "";<!-- [et_pb_line_break_holder] --> index = checkTokenAndGetIndex(this, token);<!-- [et_pb_line_break_holder] --> while (index !== -1) {<!-- [et_pb_line_break_holder] --> this.splice(index, 1);<!-- [et_pb_line_break_holder] --> updated = true;<!-- [et_pb_line_break_holder] --> index = checkTokenAndGetIndex(this, token);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> while (++i < l);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> if (updated) {<!-- [et_pb_line_break_holder] --> this._updateClassName();<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] -->classListProto.toggle = function (token, force) {<!-- [et_pb_line_break_holder] --> token += "";<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var<!-- [et_pb_line_break_holder] --> result = this.contains(token)<!-- [et_pb_line_break_holder] --> , method = result ?<!-- [et_pb_line_break_holder] --> force !== true && "remove"<!-- [et_pb_line_break_holder] --> :<!-- [et_pb_line_break_holder] --> force !== false && "add"<!-- [et_pb_line_break_holder] --> ;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> if (method) {<!-- [et_pb_line_break_holder] --> this[method](token);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> if (force === true || force === false) {<!-- [et_pb_line_break_holder] --> return force;<!-- [et_pb_line_break_holder] --> } else {<!-- [et_pb_line_break_holder] --> return !result;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] -->classListProto.toString = function () {<!-- [et_pb_line_break_holder] --> return this.join(" ");<!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->if (objCtr.defineProperty) {<!-- [et_pb_line_break_holder] --> var classListPropDesc = {<!-- [et_pb_line_break_holder] --> get: classListGetter<!-- [et_pb_line_break_holder] --> , enumerable: true<!-- [et_pb_line_break_holder] --> , configurable: true<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --> try {<!-- [et_pb_line_break_holder] --> objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);<!-- [et_pb_line_break_holder] --> } catch (ex) { // IE 8 doesn't support enumerable:true<!-- [et_pb_line_break_holder] --> // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36<!-- [et_pb_line_break_holder] --> // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected<!-- [et_pb_line_break_holder] --> if (ex.number === undefined || ex.number === -0x7FF5EC54) {<!-- [et_pb_line_break_holder] --> classListPropDesc.enumerable = false;<!-- [et_pb_line_break_holder] --> objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] -->} else if (objCtr[protoProp].__defineGetter__) {<!-- [et_pb_line_break_holder] --> elemCtrProto.__defineGetter__(classListProp, classListGetter);<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->}(self));<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// There is full or partial native classList support, so just check if we need<!-- [et_pb_line_break_holder] -->// to normalize the add/remove and toggle APIs.<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->(function () {<!-- [et_pb_line_break_holder] --> "use strict";<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var testElement = document.createElement("_");<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> testElement.classList.add("c1", "c2");<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Polyfill for IE 10/11 and Firefox <26, where classList.add and<!-- [et_pb_line_break_holder] --> // classList.remove exist but support only one argument at a time.<!-- [et_pb_line_break_holder] --> if (!testElement.classList.contains("c2")) {<!-- [et_pb_line_break_holder] --> var createMethod = function(method) {<!-- [et_pb_line_break_holder] --> var original = DOMTokenList.prototype[method];<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> DOMTokenList.prototype[method] = function(token) {<!-- [et_pb_line_break_holder] --> var i, len = arguments.length;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> for (i = 0; i < len; i++) {<!-- [et_pb_line_break_holder] --> token = arguments[i];<!-- [et_pb_line_break_holder] --> original.call(this, token);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --> createMethod('add');<!-- [et_pb_line_break_holder] --> createMethod('remove');<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> testElement.classList.toggle("c3", false);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Polyfill for IE 10 and Firefox <24, where classList.toggle does not<!-- [et_pb_line_break_holder] --> // support the second argument.<!-- [et_pb_line_break_holder] --> if (testElement.classList.contains("c3")) {<!-- [et_pb_line_break_holder] --> var _toggle = DOMTokenList.prototype.toggle;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> DOMTokenList.prototype.toggle = function(token, force) {<!-- [et_pb_line_break_holder] --> if (1 in arguments && !this.contains(token) === !force) {<!-- [et_pb_line_break_holder] --> return force;<!-- [et_pb_line_break_holder] --> } else {<!-- [et_pb_line_break_holder] --> return _toggle.call(this, token);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> testElement = null;<!-- [et_pb_line_break_holder] -->}());<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Add the novalidate attribute when the JS loads<!-- [et_pb_line_break_holder] -->var forms = document.querySelectorAll('.validate');<!-- [et_pb_line_break_holder] -->for (var i = 0; i < forms.length; i++) {<!-- [et_pb_line_break_holder] --> forms[i].setAttribute('novalidate', true);<!-- [et_pb_line_break_holder] -->}<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Validate the field<!-- [et_pb_line_break_holder] -->var hasError = function (field) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Don't validate submits, buttons, file and reset inputs, and disabled fields<!-- [et_pb_line_break_holder] --> if (field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Get validity<!-- [et_pb_line_break_holder] --> var validity = field.validity;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If valid, return null<!-- [et_pb_line_break_holder] --> if (validity.valid) return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If field is required and empty<!-- [et_pb_line_break_holder] --> if (validity.valueMissing) return 'Please fill out this field.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If not the right type<!-- [et_pb_line_break_holder] --> if (validity.typeMismatch) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Email<!-- [et_pb_line_break_holder] --> if (field.type === 'email') return 'Please enter an email address.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // URL<!-- [et_pb_line_break_holder] --> if (field.type === 'url') return 'Please enter a URL.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If too short<!-- [et_pb_line_break_holder] --> if (validity.tooShort) return 'Please lengthen this text to ' + field.getAttribute('minLength') + ' characters or more. You are currently using ' + field.value.length + ' characters.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If too long<!-- [et_pb_line_break_holder] --> if (validity.tooLong) return 'Please shorten this text to no more than ' + field.getAttribute('maxLength') + ' characters. You are currently using ' + field.value.length + ' characters.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If pattern doesn't match<!-- [et_pb_line_break_holder] --> if (validity.patternMismatch) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If pattern info is included, return custom error<!-- [et_pb_line_break_holder] --> if (field.hasAttribute('title')) return field.getAttribute('title');<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Otherwise, generic error<!-- [et_pb_line_break_holder] --> return 'Please match the requested format.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If number input isn't a number<!-- [et_pb_line_break_holder] --> if (validity.badInput) return 'Please enter a number.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If a number value doesn't match the step interval<!-- [et_pb_line_break_holder] --> if (validity.stepMismatch) return 'Please select a valid value.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If a number field is over the max<!-- [et_pb_line_break_holder] --> if (validity.rangeOverflow) return 'Please select a value that is no more than ' + field.getAttribute('max') + '.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If a number field is below the min<!-- [et_pb_line_break_holder] --> if (validity.rangeUnderflow) return 'Please select a value that is no less than ' + field.getAttribute('min') + '.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If all else fails, return a generic catchall error<!-- [et_pb_line_break_holder] --> return 'The value you entered for this field is invalid.';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Show an error message<!-- [et_pb_line_break_holder] -->var showError = function (field, error) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Add error class to field<!-- [et_pb_line_break_holder] --> field.classList.add('error');<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> // If the field is a radio button and part of a group, error all and get the last item in the group<!-- [et_pb_line_break_holder] --> if (field.type === 'radio' && field.name) {<!-- [et_pb_line_break_holder] --> var group = field.form.querySelectorAll('[name="' + field.name + '"]');<!-- [et_pb_line_break_holder] --> if (group.length > 0) {<!-- [et_pb_line_break_holder] --> for (var i = 0; i < group.length; i++) {<!-- [et_pb_line_break_holder] --> group[i].classList.add('error');<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> field = group[group.length - 1];<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Get field id or name<!-- [et_pb_line_break_holder] --> var id = field.id || field.name;<!-- [et_pb_line_break_holder] --> if (!id) return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Check if error message field already exists<!-- [et_pb_line_break_holder] --> // If not, create one<!-- [et_pb_line_break_holder] --> var message = field.form.querySelector('.error-message#error-for-' + id );<!-- [et_pb_line_break_holder] --> if (!message) {<!-- [et_pb_line_break_holder] --> message = document.createElement('div');<!-- [et_pb_line_break_holder] --> message.className = 'error-message';<!-- [et_pb_line_break_holder] --> message.id = 'error-for-' + id;<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> // If the field is a radio button or checkbox, insert error after the label<!-- [et_pb_line_break_holder] --> var label;<!-- [et_pb_line_break_holder] --> if (field.type === 'radio' || field.type ==='checkbox') {<!-- [et_pb_line_break_holder] --> label = field.form.querySelector('label[for="' + id + '"]') || field.parentNode;<!-- [et_pb_line_break_holder] --> if (label) {<!-- [et_pb_line_break_holder] --> label.parentNode.insertBefore( message, label.nextSibling );<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Otherwise, insert it after the field<!-- [et_pb_line_break_holder] --> if (!label) {<!-- [et_pb_line_break_holder] --> field.parentNode.insertBefore( message, field.nextSibling );<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> // Add ARIA role to the field<!-- [et_pb_line_break_holder] --> field.setAttribute('aria-describedby', 'error-for-' + id);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Update error message<!-- [et_pb_line_break_holder] --> message.innerHTML = error;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Show error message<!-- [et_pb_line_break_holder] --> message.style.display = 'block';<!-- [et_pb_line_break_holder] --> message.style.visibility = 'visible';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Remove the error message<!-- [et_pb_line_break_holder] -->var removeError = function (field) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Remove error class to field<!-- [et_pb_line_break_holder] --> field.classList.remove('error');<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> // Remove ARIA role from the field<!-- [et_pb_line_break_holder] --> field.removeAttribute('aria-describedby');<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If the field is a radio button and part of a group, remove error from all and get the last item in the group<!-- [et_pb_line_break_holder] --> if (field.type === 'radio' && field.name) {<!-- [et_pb_line_break_holder] --> var group = field.form.querySelectorAll('[name="' + field.name + '"]');<!-- [et_pb_line_break_holder] --> if (group.length > 0) {<!-- [et_pb_line_break_holder] --> for (var i = 0; i < group.length; i++) {<!-- [et_pb_line_break_holder] --> group[i].classList.remove('error');<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> field = group[group.length - 1];<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Get field id or name<!-- [et_pb_line_break_holder] --> var id = field.id || field.name;<!-- [et_pb_line_break_holder] --> if (!id) return;<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Check if an error message is in the DOM<!-- [et_pb_line_break_holder] --> var message = field.form.querySelector('.error-message#error-for-' + id + '');<!-- [et_pb_line_break_holder] --> if (!message) return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If so, hide it<!-- [et_pb_line_break_holder] --> message.innerHTML = '';<!-- [et_pb_line_break_holder] --> message.style.display = 'none';<!-- [et_pb_line_break_holder] --> message.style.visibility = 'hidden';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Serialize the form data into a query string<!-- [et_pb_line_break_holder] -->// Forked and modified from https://stackoverflow.com/a/30153391/1293256<!-- [et_pb_line_break_holder] -->var serialize = function (form) {<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> // Setup our serialized data<!-- [et_pb_line_break_holder] --> var serialized = '';<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> // Loop through each field in the form<!-- [et_pb_line_break_holder] --> for (i = 0; i < form.elements.length; i++) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> var field = form.elements[i];<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields<!-- [et_pb_line_break_holder] --> if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Convert field data to a query string<!-- [et_pb_line_break_holder] --> if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) {<!-- [et_pb_line_break_holder] --> serialized += '&' + encodeURIComponent(field.name) + "=" + encodeURIComponent(field.value);<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> return serialized;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Display the form status<!-- [et_pb_line_break_holder] -->window.displayMailChimpStatus = function (data) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Make sure the data is in the right format and that there's a status container<!-- [et_pb_line_break_holder] --> if (!data.result || !data.msg || !mcStatus ) return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Update our status message<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> if( data.msg == '0 - Please enter a value' ){<!-- [et_pb_line_break_holder] --> mcStatus.innerHTML = '';<!-- [et_pb_line_break_holder] --> }else{<!-- [et_pb_line_break_holder] --> mcStatus.innerHTML = data.msg;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If error, add error class<!-- [et_pb_line_break_holder] --> if (data.result === 'error') {<!-- [et_pb_line_break_holder] --> mcStatus.classList.remove('success-message');<!-- [et_pb_line_break_holder] --> mcStatus.classList.add('error-message');<!-- [et_pb_line_break_holder] --> return;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Otherwise, add success class<!-- [et_pb_line_break_holder] --> mcStatus.classList.remove('error-message');<!-- [et_pb_line_break_holder] --> mcStatus.classList.add('success-message');<!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Submit the form<!-- [et_pb_line_break_holder] -->var submitMailChimpForm = function (form) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Get the Submit URL<!-- [et_pb_line_break_holder] --> var url = form.getAttribute('action');<!-- [et_pb_line_break_holder] --> url = url.replace('/post?u=', '/post-json?u=');<!-- [et_pb_line_break_holder] --> url += serialize(form) + '&c=displayMailChimpStatus';<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Create script with url and callback (if specified)<!-- [et_pb_line_break_holder] --> var ref = window.document.getElementsByTagName( 'script' )[ 0 ];<!-- [et_pb_line_break_holder] --> var script = window.document.createElement( 'script' );<!-- [et_pb_line_break_holder] --> script.src = url;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Create a global variable for the status container<!-- [et_pb_line_break_holder] --> window.mcStatus = form.querySelector('.mc-status');<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Insert script tag into the DOM (append to <head>)<!-- [et_pb_line_break_holder] --> ref.parentNode.insertBefore( script, ref );<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // After the script is loaded (and executed), remove it<!-- [et_pb_line_break_holder] --> script.onload = function () {<!-- [et_pb_line_break_holder] --> this.remove();<!-- [et_pb_line_break_holder] --> };<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->};<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Listen to all blur events<!-- [et_pb_line_break_holder] -->document.addEventListener('blur', function (event) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Only run if the field is in a form to be validated<!-- [et_pb_line_break_holder] --> if (!event.target.form.classList.contains('validate')) return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Validate the field<!-- [et_pb_line_break_holder] --> var error = hasError(event.target);<!-- [et_pb_line_break_holder] --> <!-- [et_pb_line_break_holder] --> // If there's an error, show it<!-- [et_pb_line_break_holder] --> if (error) {<!-- [et_pb_line_break_holder] --> showError(event.target, error);<!-- [et_pb_line_break_holder] --> return;<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Otherwise, remove any existing error message<!-- [et_pb_line_break_holder] --> removeError(event.target);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->}, true);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->// Check all fields on submit<!-- [et_pb_line_break_holder] -->document.addEventListener('submit', function (event) {<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Only run on forms flagged for validation<!-- [et_pb_line_break_holder] --> if (!event.target.classList.contains('validate')) return;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Prevent form from submitting<!-- [et_pb_line_break_holder] --> event.preventDefault();<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Get all of the form elements<!-- [et_pb_line_break_holder] --> var fields = event.target.elements;<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Validate each field<!-- [et_pb_line_break_holder] --> // Store the first field with an error to a variable so we can bring it into focus later<!-- [et_pb_line_break_holder] --> var error, hasErrors;<!-- [et_pb_line_break_holder] --> for (var i = 0; i < fields.length; i++) {<!-- [et_pb_line_break_holder] --> error = hasError(fields[i]);<!-- [et_pb_line_break_holder] --> if (error) {<!-- [et_pb_line_break_holder] --> showError(fields[i], error);<!-- [et_pb_line_break_holder] --> if (!hasErrors) {<!-- [et_pb_line_break_holder] --> hasErrors = fields[i];<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // If there are errrors, don't submit form and focus on first element with error<!-- [et_pb_line_break_holder] --> if (hasErrors) {<!-- [et_pb_line_break_holder] --> hasErrors.focus();<!-- [et_pb_line_break_holder] --> }<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] --> // Otherwise, let the form submit normally<!-- [et_pb_line_break_holder] --> // You could also bolt in an Ajax form submit process here<!-- [et_pb_line_break_holder] --> submitMailChimpForm(event.target);<!-- [et_pb_line_break_holder] --><!-- [et_pb_line_break_holder] -->}, false);<!-- [et_pb_line_break_holder] --></script>