﻿/*********************************************************************/  
	function DisplayProviderDetails(parms)
       {        
          OpenRadWindowDetails("RadWindowDetails", parms);
	   }  
	 function DisplayProviderGrpDetails(parms)
       {         
          OpenRadWindowDetails("RadWindowGrpDetails", parms);
	   }    
		   
    function OpenRadWindowDetails(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("ProviderDetail.aspx?" + parms);             
        }   
     /*********************************************************************/  
     function DisplayGroupDetails(parms)
       {         
          OpenRadWindowGroupDetails("RadWindowGroupDetails", parms);
	   }  
      function OpenRadWindowGroupDetails(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("GroupDetail.aspx?" + parms);             
        }
    /*********************************************************************/
      function DisplayGroupPopUp(parms) {
          OpenRadWindowGroupPopUp("RadWindowGroupDetails", parms);
       }
      function OpenRadWindowGroupPopUp(WindowName, parms) {
           var oWindow = window.radopen(null, WindowName);
           oWindow.Modal = true;
           oWindow.SetUrl("GroupPopUp.aspx?" + parms);
        }
     /*********************************************************************/  
	function DisplayFacilityDetails(parms)
       {       
           OpenRadWindowFACDetails("RadWindowFACDetails", parms);          
	   }   
    function OpenRadWindowFACDetails(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("FacilityDetail.aspx?" + parms);             
        }   
        
     /*********************************************************************/  
	function DisplayMTFDetails(parms)
       {         
          OpenRadWindowMTFDetails("RadWindowMTFDetails", parms);
	   }  	  
		   
    function OpenRadWindowMTFDetails(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("MTFDetail.aspx?" + parms);             
        }       
        
/*********************************************************************/  
	function DisplayProviderDetailsGrp(parms)
       {         
          OpenRadWindowDetailsGrp("RadWindowDetailsGrp", parms);
	   }  
		   
    function OpenRadWindowDetailsGrp(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("ifrmProviderDetail.aspx?" + parms);             
        }                   
/*********************************************************************/ 
    function DisplayProviderLocations(parms)
       {         
          OpenRadWindowLocations("RadWindowLocations", parms);
	   }  
	 function DisplayProviderGrpLocations(parms)
       {         
          OpenRadWindowLocations("RadWindowGrpLocations", parms);        
	   }     
		   
    function OpenRadWindowLocations(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("ProviderLocations.aspx?" + parms);             
        }       
/*********************************************************************/ 
    function DisplayProviderWebSite(parms)
       {         
          var theURL = parms;  
		  var winName = "ProvWebSite";
		  var features = "width=1016,height=764,status=yes,scrollbars=yes,toolbar=yes,location=yes,status=yes,resizable=yes,dependent=yes,top=0,left=0"; 	
		  window.open(theURL,winName,features);
	   }     
		   
    function OpenRadWindowWebSite(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = false;
            oWindow.SetUrl(parms);             
        }
        /*********************************************************************/ 

	function DisplayDirections(parms)
       {
           // GetSearchID();
           //var AddParms = parent.getElementById("hdnSearchID").value;
           //  AddParms = parms + AddParms  this will work
          //alert(AddParms);        
          OpenRadWindowDirections("RadWindowDirections", parms);    
	   }     
	
    function OpenRadWindowDirections(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;            
            oWindow.SetUrl(parms);             
        }       
/*********************************************************************/ 
	function DisplayGroup(parms)
       {         
          OpenRadWindowGroup("RadWindowGroup", parms);
	   }  	
		   
    function OpenRadWindowGroup(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl(parms);             
        }
        /*********************************************************************/       
        function DisplayTSCDetails(parms) {
            OpenRadWindowTSCDetails("RadWindowTSCDetails", parms);
        }
        function OpenRadWindowTSCDetails(WindowName, parms) {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("TSCDetail.aspx?" + parms);
        }

        /*********************************************************************/  
		function CloseRadWindow()
		{
			 GetRadWindow().Close();
		}
		function GetRadWindow()
		{
			var oWindow = null;
			if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
			else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)
			 return oWindow;
		} 
/*********************************************************************/  
	function DisplayLeaveSite(parms)
       {         
          OpenRadWindowLeaveSite("RadWindowLeaveSite", parms);
	   }  	  
		   
    function OpenRadWindowLeaveSite(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("LeaveSite.aspx?" + parms);             
        }  	
/*********************************************************************/  
    function DisplaySpecialtyListMainForm(parms)
       {         
          OpenRadWindowS("SpecialtyListMainForm", parms);
	   }     
		   
    function OpenRadWindowS(WindowName, parms)
        {
            var oWindow = window.radopen(null, WindowName);
            oWindow.Modal = true;
            oWindow.SetUrl("SpecialtyList.aspx?" + parms);          
        }
        /*********************************************************************/
        
        //----------------------------------------------------------------------
        //	Convert spaces to ""            
        //----------------------------------------------------------------------  
        function convertSpaces(str) {
            var out = "", flag = 0;
            for (i = 0; i < str.length; i++) {
                if (str.charAt(i) != " ") {
                    out += str.charAt(i);
                    flag = 0;
                }
                else {
                    if (flag == 0) {
                        out += "";
                        flag = 1;
                    }
                }
            }
            return out;
        }
        //----------------------------------------------------------------------------------
        //	name:	DoProviderLookUp
        //----------------------------------------------------------------------------------
        function DoProviderLookUp(strRPN, strProviderId, strNetworkID, strEnvironment) {           
            if (strEnvironment == "PROD") {
                strURL = 'http://apps.humana-military.com/APPS/ProviderInfo/ProvInfoMain.aspx';
            }
            else {
                strURL = 'http://test-apps.humana-military.com/APPS/ProviderInfo/ProvInfoMain.aspx';
            }
            strURL = strURL + '?RPN=' + strRPN + '&ProviderId=' + strProviderId + '&Network' + strNetworkID;
            OpenProvWindow(strURL, 'ProviderLookUp', 'status=no,scrollbars=yes,resizable=yes,width=720,height=540,top=25,left=50');
        }
        //--------------------------------------------------------------------------------
        //	name:		OpenProvWindow
        //	purpose:	Generic function to open a window, given the URL, window name and parms
        //--------------------------------------------------------------------------------
        function OpenProvWindow(theURL, winName, winParms) {
            window.open(theURL, winName, winParms);
        }
        //--------------------------------------------------------------
        //	name:	PrintActuatePCMGrid
        //--------------------------------------------------------------
        var PrePareName;
        function PrintActuatePCMGrid() {
            PrePareName = "";
            GetPreparedForName();

            var strPrintURL = '/ReportCentral.asp?ReportID2=ZUPRV385';
         
            strPrintURL = strPrintURL + '&ZipCode=' + document.getElementById("ctl00_cphMain_hdnPCMZip").value;
            strPrintURL = strPrintURL + '&strBenePreparedFor=' + PrePareName;
            strPrintURL = strPrintURL + '&Distance=' + document.getElementById("ctl00_cphMain_hdnPCMDistance").value;   
            strPrintURL = strPrintURL + '&__viewFormat=pdf';
            //alert(strPrintURL);
            window.open(strPrintURL, "Locator1", "status=no,scrollbars=no,resizable=yes,width=900,height=600,top=0,left=0,toolbar=no,addressbar=no");
            
        }
      
        //--------------------------------------------------------------
        //	name:	PrintActuatePTGrid
        //--------------------------------------------------------------      
        function PrintActuatePTGrid() {
            PrePareName = "";
            GetPreparedForName();

            var strPrintURL = '/ReportCentral.asp?ReportID2=ZUPRV386';

            strPrintURL = strPrintURL + '&ZipCode=' + document.getElementById("ctl00_cphMain_hdnPTZip").value;
            strPrintURL = strPrintURL + '&strBenePreparedFor=' + PrePareName;
            strPrintURL = strPrintURL + '&Distance=' + document.getElementById("ctl00_cphMain_hdnPTDistance").value;
            strPrintURL = strPrintURL + '&Specialty=' + document.getElementById("ctl00_cphMain_hdnPTSpecialty").value;

            strPrintURL = strPrintURL + '&__viewFormat=pdf';           

            window.open(strPrintURL, "Locator1", "status=no,scrollbars=no,resizable=yes,width=900,height=600,top=0,left=0,toolbar=no,addressbar=no");
            
        }
        //--------------------------------------------------------------
        //	name:	PrintActuateFacGrid
        //--------------------------------------------------------------       
        function PrintActuateFacGrid() {
            PrePareName = "";
            GetPreparedForName();

            var strPrintURL = '/ReportCentral.asp?ReportID2=ZUPRV387';

            strPrintURL = strPrintURL + '&ZipCode=' + document.getElementById("ctl00_cphMain_hdnPTZip").value;
            strPrintURL = strPrintURL + '&strBenePreparedFor=' + PrePareName;
            strPrintURL = strPrintURL + '&Distance=' + document.getElementById("ctl00_cphMain_hdnPTDistance").value;
            strPrintURL = strPrintURL + '&Specialty=' + document.getElementById("ctl00_cphMain_hdnPTSpecialty").value;

            strPrintURL = strPrintURL + '&__viewFormat=pdf';

            window.open(strPrintURL, "Locator1", "status=no,scrollbars=no,resizable=yes,width=900,height=600,top=0,left=0,toolbar=no,addressbar=no");

        }
        function GetPreparedForName() {
            var theURL = "NamePromptDialog.asp";
            var winName = "Dialog";
            var features = "dialogLeft:150px;dialogTop:174px;dialogHeight:180px;dialogWidth:410px;center:No;help:No;scroll:No;resizable:No;status:No;";

            if (ie5) {
                var DialogAnswer
                DialogAnswer = window.showModalDialog(theURL, winName, features)
                if (DialogAnswer) {
                    PrePareName = DialogAnswer;
                }
                else {
                    PrePareName = '';
                }
            }
            else {
                var DialogAnswer = prompt("Do you want a Prepared For Name printed on this Provider Directory?\nIf yes, enter the name in the field below before pressing the OK button.", "");
                PrePareName = DialogAnswer;
            }
        }
        //-------------------------------------------------------------------------------
        //	name:	Browser sniffer
        //-------------------------------------------------------------------------------
        v3 = 0; op = 0; ie4 = 0; ie5 = 0; nn4 = 0; nn6 = 0; isMac = 0; aol = 0;
        if (document.images) {
            if (navigator.userAgent.indexOf("Opera") != -1) {
                op = 1;
            } else {
                if (navigator.userAgent.indexOf("AOL") != -1) {
                    aol = 1;
                } else {
                    ie4 = (document.all && !document.getElementById);
                    nn4 = (document.layers);
                    ie5 = (document.all && document.getElementById);
                    nn6 = (document.addEventListener);
                }
            }
        } else {
            v3 = 1;
        }
        if (navigator.userAgent.indexOf("Mac") != -1) {
            isMac = 1;
        } 
