function doClick(objTextBox, e, objSubmitId, strDefaultText) { if (objTextBox.value == '' || objTextBox.value == strDefaultText) return; var key; if (window.event) { key = window.event.keyCode; } else { key = e.which; } if (key == 13) { var btn = document.getElementById(objSubmitId); if (btn != null) { btn.click(); key = 0; } } }
function LinkedTextBoxMoveNext(currControl, nextControlId) { if (currControl.value.length == eval(currControl.getAttribute("maxlength"))) document.getElementById(nextControlId).focus(); }
function LinkedTextBoxValidate(controlIds, errorMessage, targetAction, ActionId) { try { var textBoxes = controlIds.split(","); var objvalues = ""; for (var i = 0; i < textBoxes.length; i++) { var textBox = document.getElementById(textBoxes[i]); var textValue = textBox.value; if (textValue.length != eval(textBox.getAttribute("maxlength"))) { if (errorMessage != "" && typeof (errorMessage) != "undefined") { alert(errorMessage); } return false; } else { objvalues += textValue; } } if (!isNaN(ActionId) && targetAction != "" && typeof (targetAction) != "undefined") { switch (parseInt(ActionId)) { case 1: window.location.href = targetAction + objvalues; break; case 2: document.getElementById(targetAction).value = objvalues; break; default: break; } } } catch (e) { } return true; }; var activeDiv = null;
function showFloatContent(pActiveDivId, pTop, pLeft, pChild) { if (isNaN(pLeft)) { pLeft = -100; } if (isNaN(pTop)) { pTop = 20; } hideFloatContent(); activeDiv = document.getElementById(pActiveDivId); if (activeDiv) { var jqueryObj = $('#' + pActiveDivId); if (typeof (pChild) == 'undefined' || pChild == '') var prtPos = jqueryObj.parent().position(); else var prtPos = jqueryObj.siblings(pChild).position(); jqueryObj.css({ "position": "absolute", "top": prtPos.top + pTop + "px", "left": prtPos.left + pLeft + "px" }).fadeIn(); activeDiv.style.display = "block"; } }
function hideFloatContent() { if (activeDiv) { $(activeDiv).fadeOut(100); } } String.prototype.trim = function() { return this.replace(/^\s*|\s*$/, ""); };
function isValidEmail(email) { try { var emailReg = "^[\\w-_\.+]*[\\w-_\.]\@([\\w]+\\.)+[\\w]+[\\w]$"; var regex = new RegExp(emailReg); return regex.test(email.trim()); } catch (e) { alert("Email validation failed!: " + e.message); return false; } }
function validateEmail(sender, args) { var emails = args.Value.split(","); var isvalid = true; for (var i = 0; i < emails.length; i++) { if (!isValidEmail(emails[i])) { isvalid = false; break; } } args.IsValid = isvalid; return; }
function copyClipBoardData(strTextData) { try { if (window.clipboardData) { window.clipboardData.setData("Text", strTextData); } else if (window.netscape) { if (window.clipboardData) { window.clipboardData.setData("Text", strTextData); } else if (window.netscape) { netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); if (!clip) return; var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); if (!trans) return; trans.addDataFlavor('text/unicode'); var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); var copytext = strTextData; str.data = copytext; trans.setTransferData("text/unicode", str, copytext.length * 2); var clipid = Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans, null, clipid.kGlobalClipboard); return false; } } } catch (e) { return false; } }
function MM_findObj(n, d) { var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) { d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p); } if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n]; for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document); if (!x && d.getElementById) x = d.getElementById(n); return x; } var LastToolTipBoxID = null;
function MM_ShowHideToolTipBox(id) { if (LastToolTipBoxID != null) MM_showHideLayers(LastToolTipBoxID, '', 'hide'); LastToolTipBoxID = id; MM_showHideLayers(LastToolTipBoxID, '', 'show'); }
function MM_showHideLayers() { var i, p, v, obj, args = MM_showHideLayers.arguments; for (i = 0; i < (args.length - 2); i += 3) if ((obj = MM_findObj(args[i])) != null) { v = args[i + 2]; if (obj.style) { obj = obj.style; v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v; } obj.visibility = v; } }
function MM_swapImage() { var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3) if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; } }
function MM_swapImgRestore() { var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc; }
function MM_preloadImages() { var d = document; if (d.images) { if (!d.MM_p) d.MM_p = new Array(); var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; ia.length; i++) if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } } }
function MM_swapImgRestore() { var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc; }
function MM_preloadImages() { var d = document; if (d.images) { if (!d.MM_p) d.MM_p = new Array(); var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++) if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } } }
function MM_swapImage() { var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3) if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; } }
function PreventSubmitOnEnterPress(objName) { if (event.keyCode == 13) { event.cancelBubble = true; event.returnValue = false; return false; } }
function MM_openBrWindow(theURL, winName, features) { var win = window.open(theURL, winName, features); win.focus(); }
function clearText(controlID, defaultText) { if (document.getElementById(controlID).value == defaultText) { document.getElementById(controlID).value = ""; } }
function resetText(controlID, defaultText) { if (document.getElementById(controlID).value == "") { document.getElementById(controlID).value = defaultText; } }
function getAbsolutePath() { var v_rval; var v_file = window.location.pathname; var i_fpsn = v_file.indexOf("/", 0); var i_lpsn = v_file.indexOf("/", i_fpsn + 1); if (i_fpsn < 0) { v_rval = ""; } else { if (i_lpsn < 0) { v_rval = ""; } else { v_rval = v_file.substring(0, i_lpsn); } } return v_rval; }
function confirmApptCancel(pApptID, pName, pExtID, pDate) { var pth = encodeURIComponent(window.location.href); if (confirm('Are you sure you would like to cancel your appointment on ' + pDate + ' with ' + pName + ' .ext ' + pExtID + '?')) { window.location.href = '/appointment/cancel.aspx?apptid=' + pApptID + '&redirpath=' + pth; } return false; }
function confirmCancel(pName, pExtID, pAppPath) { var ans = confirm('Are you sure you want to cancel your Callback from ' + pName + ' ext. ' + pExtID + '?'); var pth = encodeURIComponent(window.location.href); if (ans) { pAppPath = (typeof (pAppPath) == "undefined") ? "" : pAppPath; window.location.href = pAppPath + '/outdial/cancel.aspx?extid=' + pExtID + '&redirpath=' + pth; } return false; }
function confirmCancelWithRedirect(pName, pExtID, pRedirectExtID) { var ans = confirm('Are you sure you want to cancel your Callback from ' + pName + ' ext. ' + pExtID + '?'); var pth = encodeURIComponent(window.location.href); if (ans) { window.location.href = '/outdial/cancel.aspx?redirextid=' + pRedirectExtID + '&extid=' + pExtID + '&redirpath=' + pth; } return false; }
function getCookie(pCookieName) { var str = ""; var pos = document.cookie.indexOf(pCookieName + "="); if (pos != -1) { var s = pos + pCookieName.length + 1; var e = document.cookie.indexOf(";", s); if (e == -1) { e = document.cookie.length; } str = document.cookie.substring(s, e); str = unescape(str); } return str; }
function setCookie(pCookieName, pCookieValue, pDaysTilExpire) { if (pDaysTilExpire == null) { document.cookie = pCookieName + "=" + pCookieValue + "; path=/"; } else { var dtm = new Date(); dtm.setDate(dtm.getDate() + pDaysTilExpire); document.cookie = pCookieName + "=" + pCookieValue + "; path=/; expires=" + dtm; } }
function setTimezoneCookie() { if (getTimezoneCookie() == "") { var dtm = new Date(); var off = (dtm.getTimezoneOffset() * -1) / 60; setCookie("TimeZoneOffset", off, 1); } }
function getTimezoneCookie() { return getCookie("TimeZoneOffset"); } AddEvent(window, "load", setTimezoneCookie);
function AddEvent(obj, evt, fxn) { if (obj.attachEvent) { obj.attachEvent('on' + evt, fxn); } else if (obj.addEventListener) { obj.addEventListener(evt, fxn, false); } }
function DisablePhoneInput(pOutdial) { var arr = document.forms[0].elements; for (var i = 0; i < arr.length; i++) { if (arr[i].type == "text") { if (arr[i].name.indexOf("txtPhone") != -1) { arr[i].disabled = !pOutdial; } } } }
function HideElement(id) { ChangeDisplay(id, 'none'); }
function ShowElement(id) { ChangeDisplay(id, 'block'); }
function TurnOnElement(id) { ChangeClass(id, 'on'); }
function TurnOffElement(id) { ChangeClass(id, 'off'); }
function ChangeDisplay(id, styleValue) { document.getElementById(id).style.display = styleValue; }
function ChangeClass(id, classValue) { var e = document.getElementById(id); if (e) if (e.className != 'hidden') { e.className = classValue; } }
function tabChange(tab) { TurnOffElement('t-bio'); TurnOffElement('t-schedule'); TurnOffElement('t-appointments'); TurnOffElement('t-waitlist'); TurnOffElement('t-testimonials'); TurnOnElement(tab); }
function contentChange(content) { HideElement('c-bio'); HideElement('c-schedule'); HideElement('c-appointments'); HideElement('c-waitlist'); HideElement('c-testimonials'); ShowElement(content); }
function MM_goToURL() { var i, args = MM_goToURL.arguments; document.MM_returnValue = false; for (i = 0; i < (args.length - 1); i += 2) eval(args[i] + ".location='" + args[i + 1] + "'"); }
function disableAndClear(obj, bln) { obj.disabled = bln; obj.backGroundColor = bln == true ? "#e1e1e1" : "#ffffff"; obj.value = bln == true ? '' : obj.value; }
function SetUniqueRadioButton(nameregex, current) { var re = new RegExp(nameregex); for (i = 0; i < document.forms[0].elements.length; i++) { elm = document.forms[0].elements[i]; if (elm.type == 'radio') { if (re.test(elm.name)) elm.checked = false; } } current.checked = true; }
function getInnerContent(tag, data) { var sIndex = data.toLowerCase().indexOf('<' + tag.toLowerCase() + '>') + tag.length + 2; var eIndex = data.toLowerCase().indexOf('</' + tag.toLowerCase() + '>'); return (data.substring(sIndex, eIndex)); } if (!window.lil) { lil = {}; }; if (!lil.jax) { lil.jax = {}; }; if (!window.$_) { $_ = function(el) { if (typeof el == 'string') { el = document.getElementById(el); } return el; } }; lil.jax.killcache = 'nocache'; lil.jax.xhr = function() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { return false; } }; lil.jax.get = function(url, func) { var xhr = lil.jax.xhr(); if (lil.jax.killcache) { var cache = lil.jax.killcache + '=' + new Date().getTime(); url += url.indexOf('?') == -1 ? '?' : '&' + cache; }; xhr.open('GET', url, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { func(xhr.responseText); }; }; xhr.send(); }; lil.jax.pop = function(url, el) { var el = $_(el); var func = function(response) { el.innerHTML = response; }; lil.jax.get(url, func); };