
      function DLLatestDesktop(NewWindow){
          if (NewWindow==0){
            window.location="DLLatestCTClient";
            return;
          }
          else{
                  var iHeight = 200;
                  var iWidth = 300;
                  var intLeft = (screen.availWidth - iWidth)/2;
                  var intTop = (screen.availHeight - iHeight)/2;
                  var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=no, menubar=no, statusbar=yes, ";
                  FeatureStr = FeatureStr + "width=" + iWidth + ", height=" + iHeight + ", top=" + intTop + ", left=" + intLeft;
                  //alert(theurl+featurestr);
                  var aURL="DLLatestCTClient";
                  window.open(aURL, "DownloadLatestDesktop", FeatureStr);
          }
      }

      function InitializeHiddenVars(){
        var InitPanelTable=null;
        InitPanelTable=document.getElementById("InitPanel");
        if (InitPanelTable!=null){
	    if (confirm("Welcome to Captools/net. Would like to download and setup Capools/net Desktop program on this machine?")==1) {
              DLLatestDesktop(1);
            }
	}
      }

    var RepSelWinHandle;

        function DoEditRecord(CurrRecKeyVal){
        document.location="RegAddEditUserPage?UID=" + CurrRecKeyVal;
      }

      function DoDeleteRecord(CurrRecKeyVal){
          var iHeight = 925;
          var iWidth = 1100;
          var intLeft = (screen.availWidth - iWidth)/2;
          var intTop = (screen.availHeight - iHeight)/2;
          var FeatureStr = "scrollbars=yes, resizable=yes, toolbar=no, menubar=no, statusbar=yes, ";
          FeatureStr = FeatureStr + "width=" + iWidth + ", height=" + iHeight + ", top=" + intTop + ", left=" + intLeft;
        //if (confirm("Are you sure you want to Delete the user : " + CurrRecKeyVal +
          //  "? Have you reassigned clients for this RepId to another RepId?")==1){
          //document.location="CTWebHomePage?DeleteUserUID=" + CurrRecKeyVal;}
          RepSelWinHandle = window.open("CTAssignRepSelector?DeleteUserUID=" + CurrRecKeyVal, "SelAssignRep", FeatureStr);

      }

      function DoResetRecord(CurrRecKeyVal){
        if (confirm("Are you sure you want to reset status of the user : " + CurrRecKeyVal + "?")==1){
          document.location="CTWebHomePage?ResetUserUID=" + CurrRecKeyVal;}
      }

    function RefreshPage(){
      //document.location="CTWebHomePage";
     location.reload(true);
    }
