/****************************************************************************************
    Function/Procedure  Name            :- fnCloseWindow
    functionality                       :- To Call Function to close the page.		
    ****************************************************************************************/
  
    function fnCloseWindow()
    {
     // 
      // alert(document.getElementById(clientID).innerHTML);
      
      //alert('raj');
     //  window.opener=null;
       window.close();
        return false;
        
    }
        //fnCancelWindow
       function fnCancelWindow()
    {
     // 
      // alert();
      // document.getElementsByName("ctl00_CP_SearchHiddenField").item = true;
           
     //  window.opener=null;
    // document.getElementById('').
       window.close();
        return false;

    }
    /****************************************************************************************
    Function/Procedure  Name            :- fnConfimation
    functionality                       :- To Call Function to Clear Controls		
    ****************************************************************************************/
    function fnConfimation(DisplayMessage) {
        var ConfirmClear = confirm(DisplayMessage);
        if (ConfirmClear) {
         
            return true;
        }
        else {
           
            return false;
        }
        
    }

    /****************************************************************************************
    Function/Procedure  Name            :- modalWin
    functionality                       :- Function to open the Popup page.		
    ****************************************************************************************/
    function modalWin(strFullWindowName, strWindowTitle, dialogSize) {

        var left = (screen.width / 2) - (250 / 2);
        var top = (screen.height / 2) - (255 / 2);
   
         if (window.showModalDialog)
         {
             window.showModalDialog(strFullWindowName, strWindowTitle, "dialogWidth:820px;dialogHeight:480px");
        }
      else {
          
          //  window.open(strFullWindowName, strWindowTitle, 'height=1500px,width=1500px,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
            window.open(strFullWindowName, strWindowTitle, 'height=255,width=250' + ', top=' + top + ', left=' + left + ',toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
        }
       
        __doPostBack("", "");
        return false;
    }

    /****************************************************************************************
    Function/Procedure  Name            :- modalWin
    functionality                       :- Function to open the Popup page for Image Capture Page.		
    ****************************************************************************************/
    function ImageCaptureModalWin(strFullWindowName, strWindowTitle, dialogSize) {

        var left = (screen.width / 2) - (250 / 2);
        var top = (screen.height / 2) - (255 / 2);

        if (window.showModalDialog) {
            window.showModalDialog(strFullWindowName, strWindowTitle, "dialogWidth:300px;dialogHeight:300px");
        }
        else {

            //  window.open(strFullWindowName, strWindowTitle, 'height=1500px,width=1500px,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
            window.open(strFullWindowName, strWindowTitle, 'height=300,width=300' + ', top=' + top + ', left=' + left + ',toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
        }

        __doPostBack("", "");
        return false;
    }


    /****************************************************************************************
    Function/Procedure  Name            :- PatientSearchmodalWin
    functionality                       :- Function to open the Popup page.		
    ****************************************************************************************/

    function PatientSearchModalWin(strFullWindowName, strWindowTitle) {

        var left = (screen.width / 2) - (250 / 2);
        var top = (screen.height / 2) - (255 / 2);
   
        if (window.showModalDialog) {
            window.showModalDialog(strFullWindowName, strWindowTitle, "dialogWidth:800px;dialogHeight:565px");
        }
        else {
          //  window.open(strFullWindowName, strWindowTitle, 'height=1500px,width=1500px,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
            window.open(strFullWindowName, strWindowTitle, 'height=255,width=250' + ', top=' + top + ', left=' + left + ',toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
        }

        __doPostBack("", "");
        return false;
    }

    //mantis: 43180, start
    /****************************************************************************************
    Function/Procedure  Name            :- MigrationRedirection
    functionality                       :- Function to get an alert when the popup and redirect setting will off in chrome while redirecting the module to migration.		
    ****************************************************************************************/

    function checkPopupBlocked() {
        const popup = window.open('', '', 'width=100,height=100');
        if (!popup || popup.closed || typeof popup.closed === 'undefined') {
            alert("Please allow \"Pop-ups and redirects\" for this site in your browser settings .");
        }
        else {
            popup.close(); // Close it immediately if not blocked
        }
    }
    //mantis: 43180, end