 function InitializeHiddenVars(){
  
  }

// ==================  RPSelnPg.js
 function RPSelnPg_InitializeHiddenVars(){
  
  }


  function DoDeleteReportGroup(URLParamStr, ARepName){
    var UserResult = 1;
    /*var UserResult = confirm('Are you sure you want to delete the Report or Report Group "' + ARepName + '"?. \nIf this report is part of a group then you may not be able to run that Report Group anymore.'+
                     '\nThis will also remove any corresponding scheduled report entries. Also Affects any other Reps that may be using this report.');
       */
    //alert(UserResult);
    if(UserResult== "1")
      document.location="CTReportsDeleteAction" + URLParamStr;
  }

  function OpenRunReportWindow(AUrl, AOpenPopUp){
    //alert(AUrl);
    //window.location=AUrl;
    var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=no, menubar=no, statusbar=yes, ";
    if (AOpenPopUp=="true"){
        var ActualHieght="250";
        var ActualWidth="350";}
      else{
        var ActualHieght="850";
        var ActualWidth="1050";}
    FeatureStr = FeatureStr + "width=" + ActualWidth + ", height=" + ActualHieght + ", top=50, left=50";
    window.open(AUrl, "", FeatureStr);
  }

  function WarnOpenRunReportWindow(AUrl){
    //alert(AUrl);
    if (DoSaveAndRunSchedRepNow(AUrl) == 0)
      return;
    var UserResult = 1;  
   /* var UserResult = confirm('Do you want to display the report run page before running or directly run the report?'
                     + '\nPress Ok to display the report run page to modify report options.\nPress Cancel to directly run report using current report set options.');
     */
    //alert(UserResult);
    if(UserResult=="0")
      AUrl = AUrl + '&AutoRunRep=true';
    OpenRunReportWindow(AUrl, "false");
  }

        function RpSeln_DoRunInTaskerRepNow(AUrl){
          //alert(AUrl);
          if (DoSaveAndRunSchedRepNow(AUrl) == 0)
            return;
          var UserResult = 1; 
	  /* UserResult = confirm('Do you want to view report progress while it is being generated?');  */
          var AOpenPopUp = "false";
          if(UserResult=="1"){
                AUrl = AUrl + '&ViewFinalRep=true';
          }
          else{
                AOpenPopUp = "true";          
          }
          OpenRunReportWindow(AUrl, AOpenPopUp);
          window.blur();
        }

  function DoManageRptLogosPage(){
    var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
    FeatureStr = FeatureStr + " width=1100, height=575, top=120, left=60";
    var AUrl=document.CTReportsSelectionPage.LogoUploadPageURL.value;
    //window.open(AUrl, "", FeatureStr);
    alert("This function is disabled. Please copy any logo files directly to the Captools/net Server machine and place it in the 'CTReports' folder.");
  }

  function DoClearRecentReps(){
      __doPostBack('ClearRectRepsBtn', 'CLICK');
      //ClearManualBtnClick();
  }

  function DoViewLastRepOutPut(ASessionID){
    AUrl = "ShowReportOutputPage?RepSessionID=" + ASessionID;
    var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
    FeatureStr = FeatureStr + " width=1050, height=775, top=50, left=60";
    //alert(AUrl);
    window.open(AUrl, "ViewLastReport", FeatureStr);
  }

  function DoLoadHideAllSubReps(){
      __doPostBack('LoadSubRepsBtn', 'CLICK');
  }

  function OpenSchedReportWindow(){
    AUrl="CTReportScheduledEdPage";
    var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
    FeatureStr = FeatureStr + " width=1050, height=775, top=50, left=60";
    //alert(AUrl);
    window.open(AUrl, "SchedRepWin", FeatureStr);
  }

    function OpenEditRepSetWindow(){
    	AUrl="CTReportSetAddEdPage";
       var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
      FeatureStr = FeatureStr + " width=1050, height=875, top=50, left=60";
      //alert(AUrl);
      window.open(AUrl, "ReportSetWin", FeatureStr);
  }


  function DoCreateNewAccountGroup(){
    AUrl="CTSelectGroupAcctsPage";
    var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=no, menubar=no, statusbar=yes";
    //alert(AUrl);
    window.open(AUrl, "", FeatureStr);
  }

  function OpenReportSelectionWindow(){
    AUrl="ShowRepSelPage";
    var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
    FeatureStr = FeatureStr + " width=1100, height=875, top=50, left=60";
    //alert(AUrl);
    window.open(AUrl, "", FeatureStr);
  }

  function DoShowSavedReports(){
    AUrl="CTShowSavedReports";
    var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
    FeatureStr = FeatureStr + " width=1100, height=875, top=50, left=60";
    //alert(AUrl);
    window.open(AUrl, "", FeatureStr);
  }

// =========  RpRepSet.js

   var RpRepSetWinHandle;


      function DoAcctSel(APageName){
        //alert(document.CTReportSetAddEdPage.OpenPopUp.value);
        if (APageName == null) {
        	APageName = 'CTSelectGroupAcctsPage';
		}
        var TheURL = APageName + '?RepSetId=' + document.CTReportSetAddEdPage.SchedRepID.value;
        TheURL = TheURL + '&RepRTMFName=' + document.CTReportSetAddEdPage.ReportOrGroupFileName.value;

        if (document.CTReportSetAddEdPage.ReportOrGroupLocation!=null){
          if ((document.CTReportSetAddEdPage.ReportOrGroupLocation.value=="")||(document.CTReportSetAddEdPage.ReportOrGroupLocation.value=="#"))
            TheURL = TheURL + '&CustomRep=false';
          else{
            TheURL = TheURL + '&CustomRep=true';
            TheURL = TheURL + '&UserDirName=' + document.CTReportSetAddEdPage.ReportOrGroupLocation.value;}
        }
        else
          TheURL = TheURL + '&CustomRep=false';

        if (document.CTReportSetAddEdPage.ViewFinalRep!=null){
          if ((document.CTReportSetAddEdPage.ViewFinalRep.value=="true"))
            TheURL = TheURL + '&ViewFinalRep=true';
          else
            TheURL = TheURL + '&ViewFinalRep=false';
        }
        else
          TheURL = TheURL + '&ViewFinalRep=false';

        if (document.CTReportSetAddEdPage.IsReportAGroup!=null){
          //if ((document.CTReportSetAddEdPage.IsReportAGroup.value=="")||(document.CTReportSetAddEdPage.IsReportAGroup.value=="#"))
          if ((document.CTReportSetAddEdPage.IsReportAGroup.value=="true"))
            TheURL = TheURL + '&ReportGroup=true';
          else
            TheURL = TheURL + '&ReportGroup=false';
        }
        else
            TheURL = TheURL + '&ReportGroup=false';

        var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
        if (document.CTReportSetAddEdPage.OpenPopUp!=null){
            var ActualHeight="850";
            var ActualWidth="1050";
         }
        FeatureStr = FeatureStr + "width=" + ActualWidth + ", height=" + ActualHeight + ", top=50, left=50";

        if (document.CTReportSetAddEdPage.ReportDesc!=null)
            TheURL = TheURL + '&RepDesc=' + document.CTReportSetAddEdPage.ReportDesc.value;

        //alert(TheURL);

        if (document.CTReportSetAddEdPage.OpenPopUp!=null)
          document.CTReportSetAddEdPage.OpenPopUp.value="-1";
        RpRepSetWinHandle = window.open(TheURL, APageName, FeatureStr);
        RpRepSetWinHandle.focus();
        window.blur();
      }

      function RpRepSet_DoRunInTaskerRepNow(APageName, CurrRecIndex){
        //alert(APageName + ' , ' + CurrRecIndex);
        document.CTReportSetAddEdPage.CurrSchedRepNo.value=CurrRecIndex;
        __doPostBack('SaveAndTestRunSchedRep', 'CLICK');
        if (DoSaveAndRunSchedRepNow(APageName) == 0)
          return;
        var UserResult = 1; 
	//confirm('Do you want to view report progress while it is being generated?');
         if(UserResult=="1"){
          if (document.CTReportSetAddEdPage.ViewFinalRep!=null){
            document.CTReportSetAddEdPage.ViewFinalRep.value="true";
            if (document.CTReportSetAddEdPage.OpenPopUp!=null)
              document.CTReportSetAddEdPage.OpenPopUp.value="true";
          }
        }
        else{
        }
        DoAcctSel(APageName);
        window.blur();        
      }

      function RpRepSet_InitializeHiddenVars(){
        if (document.CTReportSetAddEdPage.CloseAndExit!=null){
          if (document.CTReportSetAddEdPage.CloseAndExit.value=="true"){
	    window.close();
	    return;
	  }
        }
        if (document.CTReportSetAddEdPage.RSR_StartDateType!=null){
          //document.CTReportSetAddEdPage.StartDateSelect.value=document.CTReportsMainEntryPage.RSR_StartDateType.value;
          //alert(document.CTReportSetAddEdPage.RSR_StartDateType.value + " " + document.CTReportsMainEntryPage.StartDateSelect.value);
          //alert(document.CTReportSetAddEdPage.RSR_StartDateType.value);
          //alert(document.CTReportSetAddEdPage.StartDateSelect);
          SetRadioValue(document.CTReportSetAddEdPage.StartDateSelect, document.CTReportSetAddEdPage.RSR_StartDateType.value);
          //setCheckedValue(document.CTReportSetAddEdPage.StartDateSelect, document.CTReportsMainEntryPage.RSR_StartDateType.value);
        }

        if (document.CTReportSetAddEdPage.RSR_EndDateType!=null){
          //document.CTReportSetAddEdPage.EndDateSelect.value=document.CTReportsMainEntryPage.RSR_EndDateType.value;
          SetRadioValue(document.CTReportSetAddEdPage.EndDateSelect, document.CTReportSetAddEdPage.RSR_EndDateType.value);
          //setCheckedValue(document.CTReportSetAddEdPage.EndDateSelect, document.CTReportsMainEntryPage.RSR_EndDateType.value);
          //alert(document.CTReportSetAddEdPage.RSR_EndDateType.value + " " + document.CTReportsMainEntryPage.EndDateSelect.value);
        }

        //SetDateSelOptions();

        if (document.CTReportSetAddEdPage.OpenPopUp!=null){
          if (document.CTReportSetAddEdPage.OpenPopUp.value!="-1"){
            if (document.CTReportSetAddEdPage.OpenPopUp.value=="CTReportSelector") {
              RpRepSet_DoReportSel(-1);
              window.blur();
            }
            else{
              DoEditAcctGroupSel(document.CTReportSetAddEdPage.OpenPopUp.value);
              window.blur();
            }
          }
        }  
        //DoSavePDFAfterGenCBoxClick();
        //DoEmailPDFAfterGenCBoxClick();
      }

    function RpRepSet_ValidateNewRepDesc(){
      var TempDesc=RemoveBlanks(document.CTReportSetAddEdPage.NewRepDesc.value)
      //alert(TempDesc);
      if (TempDesc==''){
        alert("Please enter a valid Report Group Description.");
        document.CTReportSetAddEdPage.NewRepDesc.focus();
        return(1);
      }
      else
        return(0);
    }

    function RefreshPage(){
//alert("RefreshPagex"+document.CTReportSetAddEdPage.CTReportSetAddEdPage_SchedReportsDataSourceFocusedRow.value);
      //document.location="CTReportSetAddEdPage?CurrSchedRepNo="+document.CTReportSetAddEdPage.CTReportSetAddEdPage_SchedReportsDataSourceFocusedRow.value;
      document.location="CTReportSetAddEdPage?CurrSchedRepNo="+document.CTReportSetAddEdPage.CurrSchedRepNo.value;
      //location.reload();
      //return;
      //alert(AcctGrpId + " x " + AcctGrpCount);
      //document.CTReportSetAddEdPage.AcctSelectionGroup.value=AcctGrpId;
      //document.CTReportSetAddEdPage.AccountsSelectionGroup.value=AcctGrpCount;
      //document.CTReportSetAddEdPage.AccountsSelectionGroup.setFocus();
      //document.CTReportSetAddEdPage.AccountsSelectionMethod.setFocus();
    }

      function DoSetReportSelCallBack(){
        var ARepName="#";
        if (document.CTReportSetAddEdPage.ReportOrGroupFileName!=null)
          ARepName=document.CTReportSetAddEdPage.ReportOrGroupFileName.value;
        var ARepLoc="#";
        if (document.CTReportSetAddEdPage.ReportOrGroupLocation!=null)
          ARepLoc=document.CTReportSetAddEdPage.ReportOrGroupLocation.value;
        var aIsRepGroup="false";
        if (document.CTReportSetAddEdPage.IsReportAGroup!=null)
          aIsRepGroup=document.CTReportSetAddEdPage.IsReportAGroup.value;
        //alert("DoSetReportSelCallBack " + ARepName + " x " + ARepLoc + " x " + aIsRepGroup);
        RpRepSetWinHandle.SetCurrentParams(ARepName, ARepLoc, aIsRepGroup);
        RpRepSetWinHandle.focus();
        //alert("done DoSetReportSelCallBack " + RpRepSetWinHandle);
      }

     function SetSelRepInCaller(aRepName, aRepUserDir, aIsRepGroup){
             //alert("SetSelRepInCaller - " + aRepName + " x " + aRepUserDir + " x " + aIsRepGroup);
        document.CTReportSetAddEdPage.ReportOrGroupFileName.value=aRepName;
        document.CTReportSetAddEdPage.ReportOrGroupLocation.value=aRepUserDir;
        document.CTReportSetAddEdPage.IsReportAGroup.value=aIsRepGroup;
        //document.CTReportSetAddEdPage.SelRepFileNameAndDescURL.href.text=aRepName;
        //alert("SetSelRepInCaller - " + aRepName + " x " + aRepUserDir + " x " + aIsRepGroup);
        __doPostBack('AddScheduledReportBtn', 'CLICK');
     }

      function RpRepSet_DoReportSel(CurrRecIndex){
        var TheURL = "CTReportSelector?Dummy=true";
        if (document.CTReportSetAddEdPage.ReportOrGroupLocation!=null){
          if ((document.CTReportSetAddEdPage.ReportOrGroupLocation.value=="")||(document.CTReportSetAddEdPage.ReportOrGroupLocation.value=="#"))
            TheURL = TheURL + "&ShowStdReps=true";
        }
        if (document.CTReportSetAddEdPage.AddedFromSubRep!=null){
          //alert(document.CTReportSetAddEdPage.AddedFromSubRep.value);
          if ((document.CTReportSetAddEdPage.AddedFromSubRep.value=="")||(document.CTReportSetAddEdPage.AddedFromSubRep.value=="true")){
            TheURL = TheURL + "&ShowAllReps=true";}
        }
        //document.CTReportSetAddEdPage.CurrSchedRepNo.value=CurrRecIndex;
        var ActualHeight="750";
        var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
        FeatureStr = FeatureStr + "width=1050, height=" + ActualHeight + ", top=100, left=100";
        //alert(TheURL+FeatureStr);
        RpRepSetWinHandle = window.open(TheURL, "SelectReport", FeatureStr);
        //alert("EditFontColorBorder - ");
      }

      function DoLaunchRecord(RepSetId, CurrRecIndex){
      //Launches report
        //alert(APageName + ' , ' + CurrRecIndex);
        var TheURL = 'CTReportsMainEntryPage?RepRTMFName=' + document.CTReportSetAddEdPage.ReportOrGroupFileName.value;
        document.CTReportSetAddEdPage.CurrSchedRepNo.value=CurrRecIndex;
        __doPostBack('SaveAndTestRunSchedRep', 'CLICK');
        if (DoSaveAndRunSchedRepNow(TheURL) == 0)
          return;

        if (document.CTReportSetAddEdPage.ReportOrGroupLocation!=null){
          if ((document.CTReportSetAddEdPage.ReportOrGroupLocation.value=="")||(document.CTReportSetAddEdPage.ReportOrGroupLocation.value=="#"))
            TheURL = TheURL + '&CustomRep=false';
          else
            TheURL = TheURL + '&CustomRep=true';
        }
        else{
          TheURL = TheURL + '&CustomRep=false';
          TheURL = TheURL + '&UserDirName=' + document.CTReportSetAddEdPage.ReportOrGroupLocation.value;
        }

        if (document.CTReportSetAddEdPage.IsReportAGroup!=null){
          //if ((document.CTReportSetAddEdPage.IsReportAGroup.value=="")||(document.CTReportSetAddEdPage.IsReportAGroup.value=="#"))
          if ((document.CTReportSetAddEdPage.IsReportAGroup.value=="true"))
            TheURL = TheURL + '&ReportGroup=true';
          else
            TheURL = TheURL + '&ReportGroup=false';
        }
        else
            TheURL = TheURL + '&ReportGroup=false';

        if (document.CTReportSetAddEdPage.ReportDesc!=null)
            TheURL = TheURL + '&RepDesc=' + document.CTReportSetAddEdPage.ReportDesc.value;

        var UserResult = true; 
	//confirm('Do you want to display the report run page before running or directly run the report?'
        //+ '\nPress Ok to display the report run page to modify report options.\nPress Cancel to directly run report using current report set options.');
        //alert(UserResult);
        if(UserResult=="0")
          TheURL = TheURL + '&AutoRunRep=true';          

        TheURL = TheURL + '&RepSetId=' + RepSetId;

        var ActualHeight="850";
        var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
        FeatureStr = FeatureStr + "width=1050, height=" + ActualHeight + ", top=100, left=100";
        //alert(TheURL+FeatureStr);
        RpRepSetWinHandle = window.open(TheURL, "RunReport", FeatureStr);
        RpRepSetWinHandle.focus();
        window.blur();
        //alert("EditFontColorBorder - ");

        //alert(RepSetId);
        //document.CTReportSetAddEdPage.CurrSchedRepNo.value=CurrRecIndex;
        //__doPostBack('SaveAndTestRunSchedRep', 'CLICK');
      }

      function RPRepSet_DoEditRecord(CurrRecIndex){      
       //alert(CurrRecIndex);
        document.CTReportSetAddEdPage.CurrSchedRepNo.value=CurrRecIndex;
        __doPostBack('EditRepBtn', 'CLICK');
      }

      function DoDeleteRecord(CurrRecIndex){
        var UserResult = true;
	//confirm('Are you sure you want to remove the scheduled Report # :' + (CurrRecIndex + 1) + '?');
        //	alert(UserResult);
        if(UserResult=="1"){
          document.CTReportSetAddEdPage.CurrSchedRepNo.value=CurrRecIndex;
          __doPostBack('RemoveRepBtn', 'CLICK');
        }
      }

      function DoShowAcctSelPopUp(){
       //alert(CurrRecIndex);
        __doPostBack('EditAcctGroupBtn', 'CLICK');
      }

      //javascript:DoRunInTaskerRepNow('CTTestSchedRepPage');
      function SetAutoTaskState(){
        if (document.CTReportSetAddEdPage.SchedRepSetCBox!=null){
                //if (document.CTReportSetAddEdPage.SchedRepSetCBox.checked==true)
                //  alert("1");
                //if (document.CTReportSetAddEdPage.SchedRepSetCBox.checked==true)
                //  document.CTReportSetAddEdPage.TaskOffset.disabled=false;
                //else
                //  document.CTReportSetAddEdPage.TaskOffset.disabled=true;
                //if (document.CTReportSetAddEdPage.SchedRepSetCBox.checked==true)
                //  document.CTReportSetAddEdPage.TaskOffsetDays.disabled=false;
                //else
                //  document.CTReportSetAddEdPage.TaskOffsetDays.disabled=true;
                if (document.CTReportSetAddEdPage.SchedRepSetCBox.checked==true)
                  document.CTReportSetAddEdPage.AutoRepPeriod.disabled=false;
                else
                  document.CTReportSetAddEdPage.AutoRepPeriod.disabled=true;
        }
      }

      function Obs_SetDateSelOptions(){
       var GoBackType = document.CTReportSetAddEdPage.GoBackUnits;
       var GoBackQty = document.CTReportSetAddEdPage.GoBackQuantity;
       var GoBackDays = 0;
       var dateEnd = new Date(theform.EndDateCal.value);
       var dateStart = new Date(dateEnd.value);
       var adays = dateStart.getDate();
       var ayear = dateStart.getFullYear();
       var amonth = dateStart.getMonth();
       document.CTReportSetAddEdPage.GoBackQuantity.disabled = GetRadioValue(document.CTReportSetAddEdPage.StartDateType != "1");
       document.CTReportSetAddEdPage.GoBackUnits.disabled=document.CTReportSetAddEdPage.GoBackQuantity.disabled;
       document.CTReportSetAddEdPage.StartDateCalEditor.disabled = GetRadioValue(document.CTReportSetAddEdPage.StartDateType != "2")
       document.CTReportSetAddEdPage.EndDateCalEditor.disabled = GetRadioValue(document.CTReportSetAddEdPage.EndDateType != "2")
       if (GetRadioValue(document.CTReportSetAddEdPage.EndDateType) == "0")
           dateEnd = dateEnd.getDate - dateEnd.getDay ;
       if (GetRadioValue(document.CTReportSetAddEdPage.EndDateType)=="1")
           dateEnd = dateEnd.getDate;
       if (GetRadioValue(document.CTReportSetAddEdPage.EndDateType) == "2")
           dateEnd = document.CTReportSetAddEdPage.EndDateCal.value;
       theform.EndDateCal.value = dateEnd;
       document.CTReportSetAddEdPage.EndDateCal.value = dateEnd;
       document.CTReportSetAddEdPage.EndDateCal.RefreshPage;
       if (GetRadioValue(document.CTReportSetAddEdPage.StartDateType) == "0") 
           dateStart = dateEnd.getFullYear() - DaysInTheYear(dateEnd);

       if (GetRadioValue(document.CTReportSetAddEdPage.StartDateType)=="1"){
              document.CTReportSetAddEdPage.GoBackQuantity.disabled=false;
              document.CTReportSetAddEdPage.GoBackUnits.disabled=false;
              if (GoBackType=="0") {                  //days
                  aday = daysInMonth(ayear,amonth);
                  dateStart.setFullYear(ayear,amonth,aday);
                  //document.CTReportSetAddEdPage.StartDateCal.value = dateStart;		
              }	    
              if (GoBackType=="1") {            //weeks
                  GoBackDays = GoBackQty * 7;
                  dateStart = dateEnd-GoBackDays;
                  //document.CTReportSetAddEdPage.StartDateCal.value = (document.CTReportSetAddEdPage.EndDateCal.value - GoBackDays);
              }
              if (GoBackType == "2") {        // months

                  for (var i = 0; i  < GoBackQty; i++){
                      amonth = amonth - 1;
                      if (amonth < 0) {
                          amonth =  11;
                          ayear = ayear - 1;
                      }  
                  }
                  dateStart.setMonth = amonth;
                  dateStart.setYear = ayear;
                  //dateStart.setDate = adays;
              }
             // if (GoBackType == "3") {        // years
                //  ayear 
           //   document.CTReportSetAddEdPage.StartDateCal.value = (document.CTReportSetAddEdPage.EndDateCal.value - GoBackQty);

          }
       theform.StartDateCal.value = dateStart;
       document.CTReportSetAddEdPage.StartDateCal.value = dateStart;
       document.CTReportSetAddEdPage.StartDateCal.RefreshPage;
      }

    // function CloseWin() {
  //		Window.Close();
    //    }

    function ConfigRepSetWindow(ARepSetParams){
      var AUrl = 'CTReportSetAddEdPage' + ARepSetParams;
      var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
      FeatureStr = FeatureStr + " width=1050, height=875, top=50, left=60";
      //alert(AUrl);
      window.open(AUrl, "ReportSetWin", FeatureStr);
    }




// ========= RpGrpEd.js

  //var RepSelWinHandle;

  function SendRepToSupport(){
    var TheURL="SendRepToSupport";
    TheURL=TheURL + "?RepRTMFname=" + document.CTReportsGroupEdPage.RepRTMFName.value;
    if (document.CTReportsGroupEdPage.UserDirName!=null)
      TheURL=TheURL + "&UserDirName=" + document.CTReportsGroupEdPage.UserDirName.value;
    TheURL=TheURL + "&CustomRep=" + document.CTReportsGroupEdPage.CustomRep.value;
    TheURL=TheURL + "&ReportGroup=true";
    var FeatureStr = "scrollbars=yes ,resizable=yes ,toolbar=no ,menubar=no ,statusbar=yes, ";
    FeatureStr = FeatureStr + "width=300, height=275, top=175, left=160";
    //alert(TheURL);
    window.open(TheURL, "", FeatureStr);
  }

    function RpGrpEd_ValidateNewRepDesc(){
      var TempDesc=RemoveBlanks(document.CTReportsGroupEdPage.NewRepDesc.value)
      alert(TempDesc);
      if (TempDesc==''){
        alert("Please enter a valid Report Group Description.");
        document.CTReportsGroupEdPage.NewRepDesc.focus();
        return(1);
      }
      else
        return(0);
    }

      function DoMoveUpRecord(CurrRecIndex){
        document.CTReportsGroupEdPage.CurrRepNo.value=CurrRecIndex;
        __doPostBack('MoveUpBtn', 'CLICK');
      }

      function DoMoveDownRecord(CurrRecIndex){
        document.CTReportsGroupEdPage.CurrRepNo.value=CurrRecIndex;
        __doPostBack('MoveDownBtn', 'CLICK');
      }

    
      function RpGrpEd_DoEditRecord(AURL){
        var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=yes, menubar=yes, statusbar=yes, ";
        var AWidth=screen.availWidth-55;
        var AHieght=screen.availHeight-170;
        FeatureStr = FeatureStr + "width=" + AWidth + ", height=" + AHieght + ", top=25, left=20";
        window.open(AURL, "EditWindow", FeatureStr)
      }

      function DoRemoveRecord(CurrRecIndex){
        document.CTReportsGroupEdPage.CurrRepNo.value=CurrRecIndex;
        __doPostBack('RemoveRepBtn', 'CLICK');
      }


      function DoOpenCloneReportWindow(CurrRecIndex, AUrl, AAction, IsARepGroup, ARepName, ARepMsg){
        document.CTReportsGroupEdPage.CurrRepNo.value=CurrRecIndex;
        OpenCloneReportWindow(AUrl, AAction, IsARepGroup, ARepName, ARepMsg)        
      }

      function DoRemAddCloneReport(ACloneRep){
        //alert(document.CTReportsGroupEdPage.CurrRepNo.value);
        //alert(ACloneRep);
        document.CTReportsGroupEdPage.NewRepDetails.value=ACloneRep;
        __doPostBack('RemAddRepBtn', 'CLICK');
      }
