   function SetCurrentParams(AReportName, ARepGrpLocation, aIsRepGroup){
      //alert("SetCurrentParams: " + AReportName + " x " + ARepGrpLocation + " x " + aIsRepGroup);
      document.CTReportSelector.CurrReportName.value=AReportName;
      document.CTReportSelector.IsReportAGroup.value=aIsRepGroup;
      document.CTReportSelector.ReportGroupLocation.value=ARepGrpLocation;
      for (var i=0; i<document.CTReportSelector.ReportListBox.length;i++){
        var AText=document.CTReportSelector.ReportListBox.options[i].text;
        var NameValObj = new Object();
        NameValObj.NameValstr=AText;
        NameValObj.AValue="";
        NameValObj.AName="";
        GetNameValue(NameValObj, "=");
        //alert(document.CTReportSelector.ReportListBox.options[i].value + "=" +NameValObj.AName+ "x" + aIsRepGroup+"*"+ARepGrpLocation+"=...->"+AReportName);
        if(document.CTReportSelector.ReportListBox.options[i].value + "=" +NameValObj.AName==(aIsRepGroup+"*"+ARepGrpLocation+"=...->"+AReportName)){
          //alert(document.CTReportSelector.ReportListBox.options[i].value + "=" +NameValObj.AName+ "x" + aIsRepGroup+"*"+ARepGrpLocation+"=...->"+AReportName);
          document.CTReportSelector.ReportListBox.options[i].selected=true;
        }
      }
      if (document.CTReportSelector.ReportListBox.selectedIndex!=-1)
        ApplyReportToPreview();
    }

    function ApplyReportToPreview(){
      var SelRepText=document.CTReportSelector.ReportListBox.options[document.CTReportSelector.ReportListBox.selectedIndex].value;
      if (SelRepText=="No_SEL")
        return 1;
      var NameValObj = new Object();
      NameValObj.NameValstr=document.CTReportSelector.ReportListBox.options[document.CTReportSelector.ReportListBox.selectedIndex].text;
      NameValObj.AValue="";
      NameValObj.AName="";
      GetNameValue(NameValObj, "=");
      NameValObj.AName = NameValObj.AName.replace(/...->/gi, "")
    //alert(SelRepText + "x" + document.CTReportSelector.ReportListBox.options[document.CTReportSelector.ReportListBox.selectedIndex].text + "x" + NameValObj.AName);
      var ComValObj = new Object();
      ComValObj.NameValstr=SelRepText;
      ComValObj.AName="";
      ComValObj.AValue="";
      GetNameValue(ComValObj, "*");
    //alert(NameValObj.AName + "=" + ComValObj.AName + " - " + ComValObj.AValue);
      var DispStr="Report : <br>"+ComValObj.AValue;
      if (NameValObj.AValue!=""){
        DispStr=DispStr+"<br><br>Custom Report.";
        DispStr=DispStr+"<br><br>User Folder :" + NameValObj.AValue + ".";
      }
      else
        DispStr=DispStr+"<br><br>Standard Report";
      //RepSelPreviewDiv.innerHTML=DispStr;
      document.CTReportSelector.CurrReportName.value=NameValObj.AName;
      document.CTReportSelector.IsReportAGroup.value= "true";     //ComValObj.AName;
      document.CTReportSelector.ReportGroupLocation.value=ComValObj.AValue;
      return 0;
    }

    function DoSetReport(){
      if (ApplyReportToPreview()==1)
        return;
      var IsRepGroup=document.CTReportSelector.IsReportAGroup.value;
      var ARepName=document.CTReportSelector.CurrReportName.value;
      var ARepLoc=document.CTReportSelector.ReportGroupLocation.value;
      if (ARepLoc=="") 
        ARepLoc="#";
      //alert("DoSetReport - " + ARepName + " = " + ARepLoc + " * " + IsRepGroup);
      window.opener.SetSelRepInCaller(ARepName, ARepLoc, IsRepGroup);
      window.close();
    }
