/* This function call is specific to EW */ tii_callFunctionOnWindowLoad (function () { var submittedForm = document.getElementById('subform'); if (!submittedForm) { submittedForm = document.getElementById ('servicesform'); } if (submittedForm) { var submittedFormValidation = new tii_ValidatedForm (submittedForm); } /* var cancelAndClose = document.getElementById ('cancelandclose'); if (cancelAndClose) { function cancelAndCloseWindow (event) { if ((event.type == 'keydown' || event.type == 'keypress') && event.keyCode != 13) { return false; } window.close (); } tii_addEventHandler (cancelAndClose, 'click', cancelAndCloseWindow, false); var keyevent = ew_issafari || ew_isie ? 'keydown' : 'keypress'; tii_addEventHandler (cancelAndClose, keyevent, cancelAndCloseWindow, false); } */ }); /* Override default declaration with this one */ tii_ValidatedForm.prototype.printErrors=function () { var ul=this.invalid [0].node.parentNode; tii_dom_removeWhitespaceTextNodes (ul); this.invalid [0].element.focus (); if (this.msg != null) { ul.parentNode.parentNode.parentNode.removeChild (this.msg); } this.msg=document.createElement ("div"); this.msg.className="formerror"; ul.parentNode.parentNode.parentNode.insertBefore (this.msg, ul.parentNode.parentNode); var message="WE'RE SORRY, we need you to correct or provide more information. Please see each marked section below and resubmit."; this.msg.innerHTML = message; var ulChildren = ul.childNodes; for (var k = 0; k < ulChildren.length; k++) { var ulChild = ulChildren.item (k); if (ulChild.firstChild.className == 'formerror') { ul.removeChild (ulChild); k--; } } for (var j = 0; j < ul.childNodes.length; j++) { var ulChild = ul.childNodes.item (j); var label = (ulChild.className.indexOf('agree') > -1) ? ulChild.firstChild.nextSibling : ulChild.firstChild; var compareId = ew_isie ? label.getAttribute('htmlFor') : label.getAttribute('for'); for (var i = 0; i < this.invalid.length; i++) { var item = this.invalid [i]; if (compareId == item.element.id) { var previousSib = ulChild.previousSibling; if (previousSib == null || previousSib.firstChild.className != 'formerror') { var errorLi = document.createElement ('li'); errorLi.innerHTML = '