﻿// JScript File
//Create definition of trim() for String
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }

function IsNumericNonoZero(fldName) {
    var theString = "123456789"
    var fldValue = fldName.value;
    var fldLength = fldValue.length;
    for (liCount = 0; liCount < fldLength; liCount++) {
        // Search through string's characters one by one.
        var fldChar = fldValue.charAt(liCount);
        if (theString.indexOf(fldChar) == -1) {
            return true;
        }
    }
}
function IsNumeric(fldName) {
    var theString = "1234567890"
    var fldValue = fldName.value;
    var fldLength = fldValue.length;
    for (liCount = 0; liCount < fldLength; liCount++) {
        // Search through string's characters one by one.
        var fldChar = fldValue.charAt(liCount);
        if (theString.indexOf(fldChar) == -1) {
            return true;
        }
    }
}
function IsNumericWithDot(fldName) {
    var theString = "1234567890."
    var fldValue = fldName.value;
    var fldLength = fldValue.length;
    for (liCount = 0; liCount < fldLength; liCount++) {
        // Search through string's characters one by one.
        var fldChar = fldValue.charAt(liCount);
        if (theString.indexOf(fldChar) == -1) {
            return true;
        }
    }
}
function IsAlfaNumeric(fldName) {
    var theString = "1234567890.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
    var fldValue = fldName.value;
    var fldLength = fldValue.length;
    for (liCount = 0; liCount < fldLength; liCount++) {
        // Search through string's characters one by one.
        var fldChar = fldValue.charAt(liCount);
        if (theString.indexOf(fldChar) == -1) {
            return true;
        }
    }
}
function IsAlfaNumericWithSpace(fldName) {
    var theString = "1234567890.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "
    var fldValue = fldName.value;
    var fldLength = fldValue.length;
    for (liCount = 0; liCount < fldLength; liCount++) {
        // Search through string's characters one by one.
        var fldChar = fldValue.charAt(liCount);
        if (theString.indexOf(fldChar) == -1) {
            return true;
        }
    }
}
function Clickheretoprint(e) {
   
    var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
    disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25";
    var content_vlue = document.getElementById(e).innerHTML;
    var docprint = window.open("", "", disp_setting);
    docprint.document.open();
    docprint.document.write('<html><head><title>.: HYSP :.</title><link rel="stylesheet" href="./tools/PopUpStyle.css">');
    docprint.document.write('</head><body onLoad="self.print();close();" style="background: url(./Images/logo.gif) left top no-repeat;margin:120px 10px 10px 10px;">');
    docprint.document.write(content_vlue);
    if (docprint.document.getElementById('divButtons')) { // Check added to fix error when no div is available - Iftakhar(23-Sept-2009)
        docprint.document.getElementById('divButtons').style.display = 'none';
    }
    docprint.document.write('</body></html>');
    docprint.focus();
    docprint.document.close();
}
function SearchtextBox(e) {
    if (document.getElementById(e).value != "")
        document.getElementById(e).value = "";
}

function move_up() {
    document.getElementById('EventList').scrollTop = 400;
}

function checkFindPhysicianDetails(LastName, Practice, ddlGender, City, ZipCode, lstSpecialty, ShowMessage) {
    document.getElementById(ShowMessage).innerHTML = "";
    if ((document.getElementById(LastName).value.trim() == "") && (document.getElementById(Practice).value.trim() == "") && (document.getElementById(ddlGender).selectedIndex == 0) && (document.getElementById(City).value.trim() == "") && (document.getElementById(ZipCode).value.trim() == "") && (document.getElementById(lstSpecialty).selectedIndex < 1)) {
        document.getElementById(ShowMessage).innerHTML = "Please enter value for Search.";
        document.getElementById(LastName).focus();
        return false;
    }

}

function Focus(LastName, Practice, ddlGender, City, ZipCode, lstSpecialty, ShowMessage) {
    var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
    if (keyCode != 9) {
        document.getElementById(ShowMessage).innerHTML = "";
        if ((document.getElementById(LastName).value.trim() == "") && (document.getElementById(Practice).value.trim() == "") && (document.getElementById(ddlGender).selectedIndex == 0) && (document.getElementById(City).value.trim() == "") && (document.getElementById(ZipCode).value.trim() == "") && (document.getElementById(lstSpecialty).selectedIndex < 1)) {
            document.getElementById(ShowMessage).innerHTML = "Please enter value for Search.";
            document.getElementById(LastName).focus();
            return false;

        }
        else {
            if (navigator.appName == "Microsoft Internet Explorer") {
                var t = window.event.srcElement.type;
                var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
                var keyString = String.fromCharCode(keyCode).toLowerCase();
                if (keyCode == 13) {
                    document.getElementById("ctl00_contentPlaceHolder1_SavePage").focus();
                }
            }
            else {
                if (keyCode == 13) {
                    document.getElementById("ctl00_contentPlaceHolder1_SavePage").focus();
                }
            }
        }
    }
}

function LoadFocus() {
    if (navigator.appName == "Microsoft Internet Explorer") {
        var t = window.event.srcElement.type;
        var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
        var keyString = String.fromCharCode(keyCode).toLowerCase();
        if (keyCode == 13) {
            document.getElementById("ctl00_contentPlaceHolder1_SavePage").focus();
        }
    }
    else {
        if (keyCode == 13) {
            document.getElementById("ctl00_contentPlaceHolder1_SavePage").focus();
        }
    }

}

function DateFrom_ValueChanged(wdSatrtDateID, wdEndDateID) {
    //get the DOM object for 'Check In' date control
    var wdSatrtDate = igdrp_getComboById(wdSatrtDateID);
    //get the DOM object for 'Check In' date control
    var wdEndDate = igdrp_getComboById(wdEndDateID);    

    //get the selected check-in date
    var selectedStartDate = wdStartDate.getValue();

    //set the check-out date (add 1 day to check in date)
    var endDate = new Date();
    endDate.setTime(selectedStartDate.getTime());
    endDate.setDate(endDate.getDate() + 1);
    wdEndDate.setValue(endDate);

}

function printMonthViewEvent(e,strdate) {

    var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
    disp_setting += "scrollbars=yes,width=700, height=600, left=100, top=25";
    var content_vlue = document.getElementById(e).innerHTML;
    var docprint = window.open("", "", disp_setting);
    docprint.document.open();
    docprint.document.write('<html><head><title>.: HYSP :.</title><link rel="stylesheet" href="./tools/VisitorStyleSheet.css">');
    docprint.document.write('<style type="text/css">');
    docprint.document.write('THEAD.ig_4d60ef9e_r4 TR TH, TFOOT.ig_4d60ef9e_r4 TR TH, TBODY.ig_4d60ef9e_r4 TR TH{font-family:Arial;font-size:13pt;font-weight:bold;background-color:LightGrey;color:Black;border-style:Solid;border-left-color:White;border-top-color:White;border-left-width:1px;border-top-width:1px; text-align:left;}');
    docprint.document.write('</style>');
    docprint.document.write('<script type="text/javascript" src="./Tools/VisitorJScript.js"></script>');    
    docprint.document.write('<script type="text/javascript">');
    docprint.document.write('function igtbl_headerClickUp(e, gd) { }');
    docprint.document.write('function igtbl_headerContextMenu(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseMove(e, gd) { }');
    docprint.document.write('function igtbl_headerClickDown(e, gd) { }');
    docprint.document.write('function igtbl_cellDblClick(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOver(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOut(e, gd) { }');
    docprint.document.write('function igtbl_onScroll(e, gd) { }');
    docprint.document.write('function igtbl_cellClickUp(e, gd) { }');
    docprint.document.write('function igtbl_cellContextMenu(e, gd) { }');
    docprint.document.write('function igtbl_cellMouseMove(e, gd) { }');
    docprint.document.write('function igtbl_selectStart(e, gd) { }');
    docprint.document.write('function igtbl_cellClickDown(e, gd) { }');
    docprint.document.write('function igtbl_cellDblClick(e, gd) { }');
    docprint.document.write('function igtbl_cellMouseOver(e, gd) { }');
    docprint.document.write('function igtbl_cellMouseOut(e, gd) { }');
    docprint.document.write('function igtbl_headerClickUp(e, gd) { }');
    docprint.document.write('function igtbl_headerContextMenu(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseMove(e, gd) { }');
    docprint.document.write('function igtbl_headerClickDown(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOver(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOut(e, gd) { }');
    docprint.document.write('function igtbl_tableMouseMove(e, gd) { }');
    docprint.document.write('</script>');
    docprint.document.write('</head><body onLoad="self.print();close();" style="background: url(./Images/logo.gif) left top no-repeat;margin:120px 10px 10px 10px;">');
    docprint.document.write('<div class="PrintEventMonthViewDate"><b>' + strdate + '</b></div>');    
    docprint.document.write(content_vlue);
    docprint.document.write('</body></html>');
    docprint.focus();
    docprint.document.close();
}

function printFindAPhysician(e) {
    var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
    disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25";
    var content_vlue = document.getElementById(e).innerHTML;
    var docprint = window.open("", "", disp_setting);
    docprint.document.open();
    docprint.document.write('<html><head><title>.: HYSP :.</title><link rel="stylesheet" href="./tools/VisitorStyleSheet.css">');
    docprint.document.write('<style type="text/css">');
    docprint.document.write('grid{text-align: center;}');
    docprint.document.write('pagerStyle{height: 21px;font: normal 10px Arial;color: #000000;background-color: #FFFFFF;padding-bottom: 2px;height: 11px;border: none 0 #FFFFFF;}');
	docprint.document.write('.ig_5e015eba_r0{width:945px;}');
	docprint.document.write('.ig_5e015eba_r16{height:11px;}');
	docprint.document.write('TBODY.ig_5e015eba_r1 TR TD, THEAD.ig_5e015eba_r1 TR TH, TFOOT.ig_5e015eba_r1 TR TH, TBODY.ig_5e015eba_r1 TR TH{font-weight:bold;height:30px;}');
	docprint.document.write('TBODY.ig_5e015eba_r1 TR.ig_5e015eba_r2 TD{font-weight:bold;height:30px;}');
	docprint.document.write('TBODY.ig_5e015eba_r1 TR TD.ig_5e015eba_4{color:Green;}');
	docprint.document.write('THEAD.ig_5e015eba_r4 TR TH, TFOOT.ig_5e015eba_r4 TR TH, TBODY.ig_5e015eba_r4 TR TH{font-size:14px;font-weight:bold;background-color:#007D43;color:White;border-style:Solid; text-align:left;}');
	docprint.document.write('TFOOT.ig_5e015eba_r5 TR TH{border-style:None;}');
	docprint.document.write('TBODY.ig_5e015eba_r4 TR TH.ig_5e015eba_r7, TFOOT.ig_5e015eba_r4 TR TH.ig_5e015eba_r7{background-color:#007D43;border-width:0px;width:22px;padding:0px 0px 0px 0px;height:auto; text-align:center; vertical-align:middle;}');
	docprint.document.write('THEAD.ig_5e015eba_r4 TR TH.ig_5e015eba_1{color:#808080;}');
	docprint.document.write('TBODY.ig_5e015eba_r1 TR TD.ig_5e015eba_0, THEAD.ig_5e015eba_r1 TR TH.ig_5e015eba_0, TFOOT.ig_5e015eba_r1 TR TH.ig_5e015eba_0, .ig_5e015eba_0{background-color:Transparent;border-width:0px;width:100%;margin:0px 0px 0px 0px;padding:0px 0px 0px 0px;background-image:none; text-align:left; vertical-align:top;}');
	docprint.document.write('@media print{#ctl00xcontentPlaceHolder1xManagePhysicianList_main, #ctl00xcontentPlaceHolder1xManagePhysicianList_div{overflow: visible !important;}}');
	docprint.document.write('</style>');
	docprint.document.write('<script type="text/javascript" src="./Tools/VisitorJScript.js"></script>');
	docprint.document.write('<script type="text/javascript">');
	docprint.document.write('function igtbl_headerClickUp(e, gd) { }');
	docprint.document.write('function igtbl_headerContextMenu(e, gd) { }');
	docprint.document.write('function igtbl_headerMouseMove(e, gd) { }');
	docprint.document.write('function igtbl_headerClickDown(e, gd) { }');
	docprint.document.write('function igtbl_cellDblClick(e, gd) { }');
	docprint.document.write('function igtbl_headerMouseOver(e, gd) { }');
	docprint.document.write('function igtbl_headerMouseOut(e, gd) { }');
	docprint.document.write('function igtbl_onScroll(e, gd) { }');
	docprint.document.write('function igtbl_cellClickUp(e, gd) { }');
	docprint.document.write('function igtbl_cellContextMenu(e, gd) { }');
	docprint.document.write('function igtbl_cellMouseMove(e, gd) { }');
	docprint.document.write('function igtbl_selectStart(e, gd) { }');
	docprint.document.write('function igtbl_cellClickDown(e, gd) { }');
	docprint.document.write('function igtbl_cellDblClick(e, gd) { }');
	docprint.document.write('function igtbl_cellMouseOver(e, gd) { }');
	docprint.document.write('function igtbl_cellMouseOut(e, gd) { }');
	docprint.document.write('function igtbl_headerClickUp(e, gd) { }');
	docprint.document.write('function igtbl_headerContextMenu(e, gd) { }');
	docprint.document.write('function igtbl_headerMouseMove(e, gd) { }');
	docprint.document.write('function igtbl_headerClickDown(e, gd) { }');
	docprint.document.write('function igtbl_headerMouseOver(e, gd) { }');
	docprint.document.write('function igtbl_headerMouseOut(e, gd) { }');
	docprint.document.write('function igtbl_tableMouseMove(e, gd) { }');
	docprint.document.write('</script>');
	docprint.document.write('</head><body onLoad="self.print();close();" style="background: url(./Images/logo.gif) left top no-repeat;margin:120px 10px 10px 10px;">');
    docprint.document.write(content_vlue);
    docprint.document.write('</body>');
    docprint.document.write('</html>');
    docprint.focus();
    docprint.document.close();
    
}

function printDayEvent(e) {
    var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
    disp_setting += "scrollbars=yes,width=800, height=700, left=100, top=25";
    var content_vlue = document.getElementById(e).innerHTML;
    var docprint = window.open("", "", disp_setting);
    docprint.document.open();
    docprint.document.write('<html><head><title>.: HYSP :.</title><link rel="stylesheet" href="./tools/VisitorStyleSheet.css">');
    docprint.document.write('<style type="text/css">');
    docprint.document.write('.ig_b1dd11b5_r0{width:1028px;}');
    docprint.document.write('.ig_b1dd11b5_r16{height:11px;}');
    docprint.document.write('THEAD.ig_b1dd11b5_r4 TR TH, TFOOT.ig_b1dd11b5_r4 TR TH, TBODY.ig_b1dd11b5_r4 TR TH{font-family:Calibri;font-size:13pt;font-weight:bold;background-color:LightGrey;color:Black;border-style:Solid; text-align:left;}');
    docprint.document.write('TBODY.ig_b1dd11b5_r4 TR TH.ig_b1dd11b5_r7, TFOOT.ig_b1dd11b5_r4 TR TH.ig_b1dd11b5_r7{background-color:LightGrey;border-width:0px;width:22px;padding:0px 0px 0px 0px;height:auto; text-align:center; vertical-align:middle;}');
    docprint.document.write('.MainFrameComment_new{scrollbar-face-color: #ffffff;scrollbar-highlight-color: #c9c9c9;scrollbar-shadow-color: #c9c9c9;scrollbar-3dlight-color: #ffffff;margin: 5px 5px 5px 2px;position: relative;width: 60%;height: 570px;border: 0px solid #000000;text-align: justify;padding: 5px 5px 10px 2px;}');
    docprint.document.write('</style>');
    docprint.document.write('<script type="text/javascript">');
    docprint.document.write('function igtbl_headerClickUp(e, gd) { }');
    docprint.document.write('function igtbl_headerContextMenu(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseMove(e, gd) { }');
    docprint.document.write('function igtbl_headerClickDown(e, gd) { }');
    docprint.document.write('function igtbl_cellDblClick(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOver(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOut(e, gd) { }');
    docprint.document.write('function igtbl_onScroll(e, gd) { }');
    docprint.document.write('function igtbl_cellClickUp(e, gd) { }');
    docprint.document.write('function igtbl_cellContextMenu(e, gd) { }');
    docprint.document.write('function igtbl_cellMouseMove(e, gd) { }');
    docprint.document.write('function igtbl_selectStart(e, gd) { }');
    docprint.document.write('function igtbl_cellClickDown(e, gd) { }');
    docprint.document.write('function igtbl_cellDblClick(e, gd) { }');
    docprint.document.write('function igtbl_cellMouseOver(e, gd) { }');
    docprint.document.write('function igtbl_cellMouseOut(e, gd) { }');
    docprint.document.write('function igtbl_headerClickUp(e, gd) { }');
    docprint.document.write('function igtbl_headerContextMenu(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseMove(e, gd) { }');
    docprint.document.write('function igtbl_headerClickDown(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOver(e, gd) { }');
    docprint.document.write('function igtbl_headerMouseOut(e, gd) { }');
    docprint.document.write('function igtbl_tableMouseMove(e, gd) { }');
    docprint.document.write('</script>');
    docprint.document.write('</head><body onLoad="self.print();close();" style="background: url(./Images/logo.gif) left top no-repeat;margin:120px 10px 10px 10px;">');
    docprint.document.write(content_vlue);
    docprint.document.getElementById('EventList').className = "MainFrameComment_new";
    docprint.document.write('</body></html>');
    docprint.focus();
    docprint.document.close();
}
