function fnDisableFields() {
    for (var e = 0; e < arguments.length; e++) gE(arguments[e]).disabled = !0
}

function fnCheckEmail(e) {
    var t = fnTrim(e),
        n = fnTrim(e);
    return n.length > 0 && !fnValidateEmail(t) ? !1 : void 0
}

function fnValidateEmail(e) {
    var t = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    return 1 != t.test(e) ? !1 : !0
}

function fnTrim(e) {
    if ("string" != typeof e) return e;
    for (var t = e.length, n = 0;
        " " == e.charAt(n) && (n += 1, !(n >= t)) ;);
    for (e = e.slice(n, t), t = e.length, n = t - 1;
        " " == e.charAt(n) && (n -= 1, !(0 >= n)) ;);
    return e = e.slice(0, n + 1)
}

function fnIsValidPhone(e) {
    var t = fnTrim(e),
        n = t.search("[^0-9,(,),+,-]");
    return t.length > 0 && n >= 0 ? !1 : !0
}

function fnRequiredField(e) {
    return null == e || "null" == e ? !1 : 0 == e.length ? !1 : !0
}

function fnErrorMessage(e) {
    fnSetErrorMsgColor(), gE("lblMessage").innerHTML = e
}

function fnAlphaNumeric(e) {
    for (var t = fnTrim(e), n = 0; n < t.length; n++) {
        var r = t.charAt(n),
            i = r.charCodeAt(0);
        if (!(32 == i || i > 47 && 59 > i || i > 64 && 91 > i || i > 96 && 123 > i)) return !1
    }
    return !0
}

function fnNumericCheck(e) {
    for (var t = fnTrim(e), n = 0; n < t.length; n++) {
        var r = t.charAt(n),
            i = r.charCodeAt(0);
        if (!(i > 47 && 59 > i)) return !1
    }
    return !0
}

function fnNumericCheckOnTextChange(e) {
    for (var t = fnTrim(e.value), n = 0; n < t.length; n++) {
        var r = t.charAt(n),
            i = r.charCodeAt(0);
        if (!(i > 47 && 59 > i)) return e.value = "", !1
    }
    return !0
}

function fnCheckAmount(e) {
    var t = e.search("[^0-9,.]");
    return e.length > 0 && t >= 0 || e.indexOf(".") != e.lastIndexOf(".") ? !1 : !0
}

function fnCheckSpaceChar(e) {
    var t = "";
    return e.indexOf("nbsp") >= 0 ? t : e
}

function hims_ctl_val(e, t, n, r, i, o, a, s, l) {
    return "" == e || "" == t || "" == n ? null : ("string" == typeof e && (this.ControlID = gE(e), this.ErrorMsg = t, this.Required = n, this.ValidationType = r, this.MinValue = i, this.MaxValue = o, this.MaxLength = a, this.CtlName = e, this.status = "F"), this)
}

function functionSetMandatoryField(e) {
    for (var t = 0; t < e.length; t++) "SPAN" == e[t].ControlId.nodeName && (e[t].ControlId.className = e[t].className, e[t].ControlId.parentElement.className = "formLabel"), "TABLE" == e[t].ControlId.nodeName && (e[t].ControlId.parentElement.innerHTML = DivTableHeader + e[t].ControlId.parentElement.innerHTML + DivTableFooter, gE("SPAN1").innerHTML = e[t].headertext, gE("SPAN1").Id = "")
}

function hims_Ctl_Mandatory(e, t, n) {
    return "" == e ? null : ("string" == typeof e && (this.ControlId = gE(e), this.className = t, this.headertext = n), this)
}

function fnDoValidate(e) {
    MessageArray = new Array, indexValue = 0;
    for (var t = 0; t < e.length; t++) e[t].status = "S", "T" == e[t].Required && "" == e[t].ValidationType && ("" == fnTrim(e[t].ControlID.value) && "SELECT" != gE(e[t].CtlName).nodeName ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : "SELECT" == gE(e[t].CtlName).nodeName ? "-1" == fnTrim(e[t].ControlID.value) || "" == fnTrim(e[t].ControlID.value) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : e[t].status = "S" : "checkbox" == e[t].ControlID.type && 0 == e[t].ControlID.checked ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : e[t].status = "S"), "T" == e[t].Required && "AN" == e[t].ValidationType && ("" == fnTrim(e[t].ControlID.value) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : 0 == fnAlphaNumeric(e[t].ControlID.value) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : e[t].status = "S"), "T" == e[t].Required && "N" == e[t].ValidationType && ("" == fnTrim(e[t].ControlID.value) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : 0 == fnNumericCheck(e[t].ControlID.value) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : e[t].status = "S"), "T" == e[t].Required && "DC" == e[t].ValidationType && ("" == fnTrim(e[t].ControlID.value) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : 0 == fnCheckAmount(e[t].ControlID.value) ? e[t].status = "F" : e[t].status = "S"), "T" == e[t].Required && "DSI" == e[t].ValidationType && (e[t].ControlID.selectedIndex <= 0 ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : e[t].status = "S"), "T" == e[t].Required && "TIME" == e[t].ValidationType && "" != MinValue && "" != MaxValue && (Date.parse(MinValue) > Date.parse(MaxValue) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : e[t].status = "S"), "F" == e[t].Required && "COUNT" == e[t].ValidationType && "SELECT" == gE(e[t].CtlName).nodeName && (0 == fnTrim(e[t].ControlID.length) ? (e[t].status = "F", MessageArray[t] = e[t].ErrorMsg) : e[t].status = "S");
    for (var n = 0; n < e.length; n++)
        if ("F" == e[n].status) return SetMessageBoxDetails(MessageArray), !1;
    return ResetMessageBox(), !0
}

function fnEnableFields() {
    for (var e = 0; e < arguments.length; e++) fnGetControl(arguments[e]).disabled = !1
}

function fnClearTextBox() {
    for (var e = 0; e < arguments.length; e++) fnEnableFields(arguments[e]), fnGetControl(arguments[e]).value = "", fnDisableFields(arguments[e])
}

function fnNumeric(e) {
    var t = e.charCode ? e.charCode : e.keyCode;
    return (8 > t || t > 9) && (48 > t || t > 57) ? !1 : void 0
}

function fnDecimalCheckOnKeyPress(e) {
    var t = e.charCode ? e.charCode : e.keyCode;
    if (8 > t || t > 9) {
        if (!(46 == t || t >= 48 && 57 >= t)) return !1;
        var n = e.srcElement.value.split(".");
        if (n.length > 2) return !1;
        if (46 == t) return 1 == n.length
    }
}

function fnDecimalCheckOnTextChange(e) {
    var t = fnTrim(e.value),
        n = t.search("[^0-9,.]");
    return t.length > 0 && n >= 0 || t.indexOf(".") != t.lastIndexOf(".") ? (e.value = "", !1) : !0
}

function refreshModalWin(e, t, n) {
    for (var r = null, i = 0, o = 0; o < childPopupArray.length - 1; o++)
        if (void 0 != childPopupArray[o] && childPopupArray[o][0] == t) {
            r = childPopupArray[o][1], r.closed && (childPopupArray[o] = void 0);
            break
        }
    null != r && r.closed && (r = null), null == r ? (r = window.open(e, "", "height=1000,width=1200,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=yes"), r.moveTo(0, 0), r.resizeTo(screen.availWidth, screen.availHeight)) : (r.location = e, r.focus(), r.moveTo(0, 0), r.resizeTo(screen.availWidth, screen.availHeight));
    for (var a = 0; a < childPopupArray.length - 1; a++)
        if (void 0 != childPopupArray[a] && childPopupArray[a][0] == t) {
            childPopupArray[a][1] = r, i = a;
            break
        }
    if (0 == i)
        for (var s = 0; s < childPopupArray.length - 1; s++)
            if (void 0 == childPopupArray[s]) {
                childPopupArray[s] = new Array(2), childPopupArray[s][0] = t, childPopupArray[s][1] = r;
                break
            }
}

function modalWin(e, t) {
    var n = screen.width / 2 - 125,
        r = screen.height / 2 - 127.5;
    window.showModalDialog ? window.showModalDialog(e, t, "dialogWidth:820px;dialogHeight:400px") : window.open(e, t, "height=255,width=250, top=" + r + ", left=" + n + ",toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes")
}

function modalWin(e, t, n, r) {
    var i = screen.width / 2 - n / 2,
        o = screen.height / 2 - r / 2;
    return window.showModalDialog ? window.showModalDialog(e, t, "dialogWidth:" + n + "px ;dialogHeight:" + r + "px") : window.open(e, t, "height=" + r + ",width=" + n + ", top=" + o + ", left=" + i + ", toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes"), __doPostBack("", t), !1
}

function modalWinPopUp(e, t, n, r) {
    var i = screen.width / 2 - n / 2,
        o = screen.height / 2 - r / 2;
    window.open(e, t, "height=" + r + ",width=" + n + ", top=" + o + ", left=" + i + ", toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes")
}

function PatientSearchModalWin(e, t) {
    var n = screen.width / 2 - 750,
        r = screen.height / 2 - 750;
    return window.showModalDialog ? window.showModalDialog(e, t, "dialogWidth:800px;dialogHeight:565px") : window.open(e, t, "height=1500px,width=1500px , top=" + r + ", left=" + n + ", toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes"), __doPostBack("", ""), !1
}

function NonModalWin(e, t, n, r) {
    var i = screen.width / 2 - n / 2,
        o = screen.height / 2 - r / 2;
    window.open(e, t, "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=" + n + ", height=" + r + ", top=" + o + ", left=" + i)
}

function fnonTextChangeCodeField(e) {
    for (var t = fnTrim(e.value), n = 0; n < t.length; n++) {
        var r = t.charAt(n),
            i = r.charCodeAt(0);
        if (!(i > 64 && 91 > i || i > 96 && 123 > i || 45 == i)) return e.value = "", !1;
        e.value = e.value.toUpperCase()
    }
    __doPostBack(e.Id, "TextChanged")
}

function fnKeyPressForCodeField(e) {
    try {
        var t = e.charCode ? e.charCode : e.keyCode;
        if (8 > t || t > 9) return t > 64 && 91 > t || t > 96 && 123 > t || 45 == t || t > 47 && 58 > t ? !0 : !1
    } catch (e) { }
}

function fnonTextChangeCodeField(e) {
    for (var t = fnTrim(e.value), n = 0; n < t.length; n++) {
        var r = t.charAt(n),
            i = r.charCodeAt(0);
        if (!(i > 64 && 91 > i || i > 96 && 123 > i || 45 == i || i > 47 && 58 > i)) return e.value = "", !1
    }
    return e.value = t.toUpperCase(), !1
}

function fnKeyPressForDescriptionField(e) {
    try {
        return !0
    } catch (e) { }
}

function fnonTextChangeDescriptionField(e) {
    try {
        return !0
    } catch (t) { }
}

function fnKeyPressForNameField(e) {
    try {
        return !0
    } catch (e) { }
}

function fnonTextChangeNameField(e) {
    try {
        return !0
    } catch (t) { }
}

function fnKeyPressForAutoCompleteCodeField(e) {
    try {
        var t = e.charCode ? e.charCode : e.keyCode;
        if (8 > t || t > 9) return t > 64 && 91 > t || t > 96 && 123 > t || 45 == t || t > 47 && 58 > t || 189 == t || 46 == t ? !0 : !1
    } catch (e) { }
}

function fnOnTextChangeAutoCompleteCodeField(e) {
    for (var t = fnTrim(e.value), n = 0; n < t.length; n++) {
        var r = t.charAt(n),
            i = r.charCodeAt(0);
        if (!(i > 64 && 91 > i || i > 96 && 123 > i || 45 == i || i > 47 && 58 > i)) return e.value = "", !1
    }
    return !1
}

function fnKeyPressForAutoCompleteDescriptionField(e) {
    try {
        return !0
    } catch (e) { }
}

function fnOnTextChangeAutoCompleteDescriptionField(e) {
    try {
        return !0
    } catch (t) { }
}

function fnCloseWindow() {
    return window.close(), !1
}

function fnCloseRefreshWindow() {
    return window.opener.location.href = window.opener.location.href, self.close(), !1
}

function CheckLength(e, t) {
    var n = new Number(t);
    e.value.length > n && (e.value = e.value.substring(0, n))
}

function hims_TimePicker(e, t) {
    return "" == e ? null : ("True" == t ? t = !1 : "False" == t && (t = !0), "string" == typeof e && (this.ControlId = e, this.enable = t), this)
}

function DisableEnableTimePicker(e) {
    for (var t = 0; t < e.length; t++) {
        var n = "ctl00$CP$" + e[t].ControlId + "_imgUp",
            r = "ctl00$CP$" + e[t].ControlId + "_imgDown";
        gE(n).disabled = e[t].enable, gE(r).disabled = e[t].enable
    }
}

function EnableDisableTimePicker(e) {
    for (var t = 0; t < e.length; t++) {
        var n = e[t].ControlId + "_imgUp",
            r = e[t].ControlId + "_imgDown";
        gE(n).disabled = e[t].enable, gE(r).disabled = e[t].enable
    }
}

function MaskDecimal(e, t, n) {
    var r = e.charCode ? e.charCode : e.keyCode;
    if (8 > r || r > 9) {
        if (!(46 == r || 45 == r || r >= 48 && 57 >= r)) return !1;
        var i = e.srcElement.value.split(".");
        if (i.length > 2) return !1;
        if (46 == r) return 1 == i.length;
        if (e.srcElement.value.length >= t + n + 1) return !1;
        if (i[0].length == t && 1 == i.length) return !1
    }
}

function MaskDecimalWithNegative(e, t, n) {
    var r = e.charCode ? e.charCode : e.keyCode;
    if (8 > r || r > 9) {
        if (!(45 == r || 46 == r || r >= 48 && 57 >= r)) return !1;
        var i = e.srcElement.value.split(".");
        if (i.length > 2) return !1;
        if (46 == r) return 1 == i.length;
        if (e.srcElement.value.length >= t + n + 1) return !1;
        if (i[0].length == t && 1 == i.length) return !1
    }
}

function fnValidateDecimal(e, t, n) {
    var r = e.value;
    if (0 == r.length) return !0;
    var i = /^-?\d*[0-9]$/;
    if (r = e.value, 0 == r.length) return !0;
    var o = "",
        a = r.split(".");
    if (a.length >= 2) {
        if (a[0].length > 0 && 1 != i.test(a[0])) return e.value = "", !0;
        if (a[1].length > 0 && 1 != i.test(a[1])) return e.value = "", !0;
        o = a[0].length > t ? a[0].substring(0, t) : a[0], o = a[1].length > n ? o + "." + a[1].substring(0, n) : o + "." + a[1]
    } else {
        if (a[0].length > 0 && 1 != i.test(a[0])) return e.value = "", !0;
        o = r.indexOf(".") >= 0 ? r.length > n + 1 ? r.substring(0, n + 1) : r : r.length > t ? r.substring(0, t) : r
    }
    o.length > 0 && (r = o), e.value = r
}

function fnValidateDecimalWithNegative(e, t, n) {
    var r = e.value;
    if (0 == r.length) return !0;
    var i = NaN;
    if (r = e.value, 0 == r.length) return !0;
    var o = "",
        a = r.split(".");
    if (a.length >= 2) {
        if (a[0].length > 0 && 1 != i.test(a[0])) return e.value = "", !0;
        if (a[1].length > 0 && 1 != i.test(a[1])) return e.value = "", !0;
        o = a[0].length > t ? a[0].substring(0, t) : a[0], o = a[1].length > n ? o + "." + a[1].substring(0, n) : o + "." + a[1]
    } else {
        if (a[0].length > 0 && 1 != i.test(a[0])) return e.value = "", !0;
        o = r.indexOf(".") >= 0 ? r.length > n + 1 ? r.substring(0, n + 1) : r : r.length > t ? r.substring(0, t) : r
    }
    o.length > 0 && (r = o), e.value = r
}

function MaskInteger(e, t) {
    var n = e.charCode ? e.charCode : e.keyCode;
    if (8 > n || n > 9) {
        if (!(n >= 48 && 57 >= n)) return !1;
        if (e.srcElement.value.length > t) return !1
    }
}

function ValidateNumericRangeValue(e, t) {
    var n = e.value;
    return 0 == n.length ? !0 : n > t ? (e.value = "", MessageArray = new Array, SetMessageBox("Enter Valid Value", "info"), e.focus(), !1) : (ResetMessageBox(), !0)
}

function fnValidateInteger(e, t) {
    var n = e.value;
    if (0 == n.length) return !0;
    var r = /^\d*[0-9]$/;
    return 1 != r.test(n) ? (e.value = "", !0) : (n.length > t && (n = n.substring(0, t), e.value = n), !0)
}

function fnMaxLength(e, t) {
    var n = new Number(t);
    return e.value.length < n
}

function CreateGridHeader(e, t, n) {
    alert("Hiiiiiiii");
    var r = document.getElementById(e),
        i = document.getElementById(t),
        o = document.getElementById(n),
        a = o.appendChild(document.createElement("table"));
    r.style.paddingTop = "0px";
    var s = r.clientWidth;
    r.style.width = "5000px", o.className = r.className, o.style.cssText = r.style.cssText, o.style.overflow = "auto", o.style.overflowX = "hidden", o.style.overflowY = "hidden", o.style.height = i.rows[0].clientHeight + "px", o.style.borderBottomWidth = "0px", a.className = i.className, a.style.cssText = i.style.cssText, a.border = "1px", a.rules = "all", a.cellPadding = i.cellPadding, a.cellSpacing = i.cellSpacing;
    var l = a.insertRow(0);
    l.className = i.rows[0].className, l.style.cssText = i.rows[0].style.cssText;
    for (var d = 0; d < i.rows[0].cells.length; d++) {
        var u = l.appendChild(document.createElement("td"));
        u.innerHTML = i.rows[0].cells[d].innerHTML;
        var c = 0;
        c = u.clientWidth > i.rows[1].cells[d].clientWidth ? u.clientWidth : i.rows[1].cells[d].clientWidth, d <= i.rows[0].cells.length - 2 ? u.style.width = c + "px" : u.style.width = c + 20 + "px", i.rows[1].cells[d].style.width = c + "px"
    }
    var h = i.clientWidth;
    return i.rows[0].style.display = "none", o.style.width = s + "px", r.style.width = s + "px", i.style.width = h + "px", a.style.width = h + 20 + "px", a.style.display = "visible", r.style.display = "visible", !1
}

function Onscrollfnction() {
    var e = document.getElementById("DataDiv"),
        t = document.getElementById("HeaderDiv");
    return t.scrollLeft = e.scrollLeft, !1
}

function fnGetTimeSelectorClientId(e) {
    var t, n = document.forms[0].length,
        r = 0;
    for (r = 0; n > r && (t = document.forms[0].elements[r].id, pos = t.indexOf(e), !(pos >= 0)) ; r++);
    return t
}

function fnCheckForMandatory(e) {
    return "" == e.value ? !1 : void 0
}

function KeysShortcut(e) {
    113 == event.keyCode && document.getElementById(e).click()
}

function openReportWin(e, t, n) {
    return window.open(e, t, "height=1500px,width=1500px,left=0px,top=0px,toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes ,modal=yes"), !1
}

function globalButtonover(e) {
    "buttonGlobalCustom" == document.getElementById(e).className ? document.getElementById(e).className = "buttonGlobalCustomOver" : document.getElementById(e).className = "buttonGlobalOver"
}

function globalButtonout(e) {
    "buttonGlobalCustomOver" == document.getElementById(e).className ? document.getElementById(e).className = "buttonGlobalCustom" : document.getElementById(e).className = "buttonGlobal"
}

function bodyButtonover(e) {
    "buttonLBlueCustom" == document.getElementById(e).className ? document.getElementById(e).className = "buttonLBlueCustomOver" : document.getElementById(e).className = "buttonLBlueOver"
}

function bodyButtonout(e) {
    "buttonLBlueCustomOver" == document.getElementById(e).className ? document.getElementById(e).className = "buttonLBlueCustom" : document.getElementById(e).className = "buttonLBlue"
}

function hideshowbutton() {
    0 == counterb ? (document.getElementById("leftContainer").style.display = "none", counterb = 1) : (document.getElementById("leftContainer").style.display = "block", counterb = 0)
}

function openModalpopup() {
    0 == popcounter ? (document.getElementById("popUp").style.display = "block", document.getElementById("blocklayer").style.display = "block", document.getElementById("blocklayer").style.height = screen.height, document.getElementById("blocklayer").style.width = screen.width, popcounter += 1) : (document.getElementById("popUp").style.display = "none", document.getElementById("blocklayer").style.display = "none", popcounter = 0)
}

function fullPopup(e) {
    params = "width=" + screen.width, params += ", height=" + screen.height, params += ", top=0, left=0", params += ", fullscreen=no", window.open(e, "windowname4", params)
}

function SetMessageBoxDetails(e) {
    var t = '<div class="messageHolder newmsg"><div class="himsWireBox"><div class="himsBoxHeader"><div></div></div><div class="himsBoxContent messageMessage"><div class="errorContainer"><div class="fLeft statusImage"><div ></div></div><div class="statusMessage fLeft"><div>';
    t += "Mandatory fields are not filled.", t += '</div><div id="hideShowError"><ul>';
    for (var n = 0; n < e.length; n++) e[n] && (t += "<li>" + e[n] + "</li>\n");
    t += '</ul></div></div><div align="right" class="pRight5 cursorHand" id="maxmin"><div id="hideShowImg" class="fRight"><img src="../../../images/icons/collapsetab.png" title="Minimize" onclick="maxmin()" /></div></div><div class="cBoth"></div></div></div><div class="himsBoxFooter"><div></div></div></div></div>';
    var r = document.getElementById("MessageBoxDiv");
    r.innerHTML = t
}

function maxmin() {
    0 == counter ? (document.getElementById("hideShowImg").innerHTML = '<img src="../../../images/icons/expandtab.png" title="Maximize" onclick="maxmin()" />', document.getElementById("hideShowError").style.display = "none", counter += 1) : (document.getElementById("hideShowImg").innerHTML = '<img src="../../../images/icons/collapsetab.png" title="Minimize" onclick="maxmin()" />', document.getElementById("hideShowError").style.display = "block", counter = 0)
}

function SetMessageBox(e, t) {
    var n = document.getElementById("MessageBoxDiv"),
        r = t.toLowerCase();
    return n.innerHTML = '<div class="messageHolder newmsg"><div class="himsWireBox"  ><div class="himsBoxHeader"><div></div></div><div class="himsBoxContent messageMessage"><div class="' + r + 'Container"><div class="fLeft statusImage"><div ></div></div><div class="statusMessage fLeft"><div>' + e + '</div></div><div class="cBoth"></div></div></div><div class="himsBoxFooter"><div></div></div></div></div>', !1
}

function ResetMessageBox() {
    var e = document.getElementById("MessageBoxDiv");
    return e.innerHTML = "", !1
}

function tabChange(e) {
    var t = document.getElementById("tabMenu").getElementsByTagName("li");
    for (i = 1; i <= t.length; i++) document.getElementById("tab" + i).className = "", document.getElementById("tab" + i + "content").style.display = "none";
    document.getElementById(e).className = "current", document.getElementById(e + "content").style.display = "block"
}

function fnCloseForm() {
    return window.close(), !1
}

function isInteger(e) {
    var t;
    for (t = 0; t < e.length; t++) {
        var n = e.charAt(t);
        if ("0" > n || n > "9") return !1
    }
    return !0
}

function stripCharsInBag(e, t) {
    var n, r = "";
    for (n = 0; n < e.length; n++) {
        var i = e.charAt(n); -1 == t.indexOf(i) && (r += i)
    }
    return r
}

function daysInFebruary(e) {
    return e % 4 != 0 || e % 100 == 0 && e % 400 != 0 ? 28 : 29
}

function DaysArray(e) {
    for (var t = 1; e >= t; t++) this[t] = 31, (4 == t || 6 == t || 9 == t || 11 == t) && (this[t] = 30), 2 == t && (this[t] = 29);
    return this
}

function isDate(e) {
    var t = DaysArray(12),
        n = e.indexOf(dtCh),
        r = e.indexOf(dtCh, n + 1),
        i = e.substring(0, n),
        o = e.substring(n + 1, r),
        a = e.substring(r + 1);
    strYr = a, "0" == o.charAt(0) && o.length > 1 && (o = o.substring(1)), "0" == i.charAt(0) && i.length > 1 && (i = i.substring(1));
    for (var s = 1; 3 >= s; s++) "0" == strYr.charAt(0) && strYr.length > 1 && (strYr = strYr.substring(1));
    return month = parseInt(i), day = parseInt(o), year = parseInt(strYr), -1 == n || -1 == r ? (SetMessageBoxforDatePicker("The date format should be : mm/dd/yyyy"), !1) : i.length < 1 || month < 1 || month > 12 ? (SetMessageBoxforDatePicker("Please enter a valid month"), !1) : o.length < 1 || day < 1 || day > 31 || 2 == month && day > daysInFebruary(year) || day > t[month] ? (SetMessageBoxforDatePicker("Please enter a valid day"), !1) : 4 != a.length || 0 == year || year < minYear || year > maxYear ? (SetMessageBoxforDatePicker("Please enter a valid year between " + minYear + " and " + maxYear), !1) : -1 != e.indexOf(dtCh, r + 1) || 0 == isInteger(stripCharsInBag(e, dtCh)) ? (SetMessageBoxforDatePicker("Please enter a valid date"), !1) : !0
}

function ValidateDateFormate(e) {
    return ResetMessageBox(), "" != e.value && 0 == isDate(e.value) ? (e.focus(), !1) : !0
}

function SetMessageBoxforDatePicker(e) {
    var t = new Date,
        n = (t.toLocaleString(), '<div class="messageHolder newmsg"><div class="himsWireBox" style="width:100%;padding-left:1px"><div class="himsBoxHeader"><div></div></div><div class="himsBoxContent messageMessage"><div class="errorContainer"><div class="fLeft statusImage"><div ></div></div><div class="statusMessage fLeft"><div>');
    n += '</div><div id="hideShowError"><ul>', n += "date format should be : mm/dd/yyyy", n += "<li>" + e + "</li>\n", n += '</ul></div></div><div align="right" class="pRight5 cursorHand" id="maxmin"><div id="hideShowImg" class="fRight"><img src="../../images/icons/collapsetab.png" title="Minimize" onclick="maxmin()" /></div></div><div class="cBoth"></div></div></div><div class="himsBoxFooter"><div></div></div></div></div>';
    var r = document.getElementById("MessageBoxDiv");
    r.innerHTML = n
}

function isNumberKey(e) {
    var t = e.which ? e.which : event.keyCode;
    return 48 > t || t > 57 ? !1 : !0
}

function CheckAll(e) {
    var t = e.parentNode.parentNode.parentNode.parentNode;
    for (i = 1; i < t.rows.length; i++) t.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = e.checked
}

function calendarShown(e, t) {
    e._switchMode("months", !0)
}
var gE = function (e) {
    return document.getElementById(e)
},
    MessageArray = new Array,
    DivTableHeader = "<div class='himssuHeader1WireBox'><div class='himsBoxHeader'><div class='leftdiv'></div><div class='himsBoxTitle'><div class='headerText'><SPAN ID='SPAN1'>Laboratory Test Request</SPAN></div></div></div><div class='himsBoxContent'><div class='contentHolder'>",
    DivTableFooter = "</div></div></div>",
    childPopupArray = new Array(30);
showHideTooltip = function () {
    var obj = event.srcElement;
    with (document.getElementById("tooltip")) {
        with (style) {
            if ("mouseleave" == event.type) return void (display = "none");
            display = "inline", left = event.x, top = event.y
        }
        if ("text" == obj.type && (innerHTML = obj.value, "" == obj.value)) with (style) return void (display = "none");
        if ("textarea" == obj.type) {
            if (innerHTML = obj.value, "" == obj.value) with (style) return void (display = "none")
        } else if (obj.selectedIndex > -1 && "select-one" == obj.type) {
            innerHTML = obj.options[obj.selectedIndex].innerText;
            for (var DropDownCount = 0; DropDownCount < obj.options.length; DropDownCount++) obj.options[DropDownCount].title = obj.options[DropDownCount].innerText
        }
    }
}, counterb = 0, popcounter = 0;
var counter = 0;
document.include = function (e) {
    if ("undefined" == typeof e) return !1;
    var t, n;
    t = document.all ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest, n = Math.random().toString().substring(2), t.open("GET", e, !1), t.send(null), document.write(t.responseText)
};
var dtCh = "/",
    minYear = 1900,
    maxYear = 2100;

function ShowToolTip(ClassDropDownList) {
    var title = ClassDropDownList.options[ClassDropDownList.selectedIndex].Text;
     ClassDropDownList.attr('title', title);

 }