      function ConfirmDeleteChart(){
        var UserResult = 1; 
	//confirm('Are you sure you want to delete the Chart?. You can just hide it by editing the chart and setting the visibility.');
        //alert(UserResult);
        if(UserResult=="0")
          return(1);
      }

      function InitializeHiddenVars(){
        if (document.ReportEditChartsPage.CloseAndExit!=null){
          if (document.ReportEditChartsPage.CloseAndExit.value=="true"){
	    window.close();
	    return;
	  }		 	
        }

        RgnBackColorDiv.style.backgroundColor=document.ReportEditChartsPage.ChartRgnBackColor.value;
        RgnBackColorDiv.innerText=document.ReportEditChartsPage.ChartRgnBackColor.value;
        RgnBackColorDiv.style.borderWidth=document.ReportEditChartsPage.ChartRgnBorderWidth.value;
        RgnBackColorDiv.style.borderColor=document.ReportEditChartsPage.ChartRgnBorderColor.value;
        RgnBackColorDiv.style.borderStyle=document.ReportEditChartsPage.ChartRgnBorderStyle.value;
        TitleFontColorCallerDiv.style.fontFamily=document.ReportEditChartsPage.ChartTitleFontName.value;
        TitleFontColorCallerDiv.style.fontSize=document.ReportEditChartsPage.ChartTitleFontSize.value;
        TitleFontColorCallerDiv.style.color=document.ReportEditChartsPage.ChartTitleFontColor.value;
        TitleFontColorCallerDiv.style.fontWeight=(document.ReportEditChartsPage.ChartTitleFontBold.value=="True") ? "bold" : "normal";
        TitleFontColorCallerDiv.style.textDecoration=(document.ReportEditChartsPage.ChartTitleFontUnderLine.value=="True") ? "underline" : "none";
        TitleFontColorCallerDiv.style.fontStyle=(document.ReportEditChartsPage.ChartTitleFontItalics.value=="True") ? "italic" : "normal";
        TitleFontColorCallerDiv.style.backgroundColor=document.ReportEditChartsPage.MainBGColor.value;
        LegendFontColorCallerDiv.style.fontFamily=document.ReportEditChartsPage.LegendFontName.value;
        LegendFontColorCallerDiv.style.fontSize=document.ReportEditChartsPage.LegendFontSize.value;
        LegendFontColorCallerDiv.style.color=document.ReportEditChartsPage.LegendFontColor.value;
        LegendFontColorCallerDiv.style.fontWeight=(document.ReportEditChartsPage.LegendFontBold.value=="True") ? "bold" : "normal";
        LegendFontColorCallerDiv.style.textDecoration=(document.ReportEditChartsPage.LegendFontUnderLine.value=="True") ? "underline" : "none";
        LegendFontColorCallerDiv.style.fontStyle=(document.ReportEditChartsPage.LegendFontItalics.value=="True") ? "italic" : "normal";
        LegendFontColorCallerDiv.style.backgroundColor=document.ReportEditChartsPage.LegendBkgrdColor.value;
        LegendFontColorCallerDiv.style.borderStyle=document.ReportEditChartsPage.LegendBorderStyle.value;
        LegendFontColorCallerDiv.style.borderColor=document.ReportEditChartsPage.LegendBorderColor.value;
        LegendFontColorCallerDiv.style.borderWidth=document.ReportEditChartsPage.LegendBorderWidth.value;


        var RptLineChartItemsPanelTable=null;
        RptLineChartItemsPanelTable=document.getElementById("RptLineChartItemsPanel");
        if (RptLineChartItemsPanelTable==null)
          return;
        CaptionFontCallerDiv.style.fontFamily=document.ReportEditChartsPage.CaptionFontName.value;
        CaptionFontCallerDiv.style.fontSize=document.ReportEditChartsPage.CaptionFontSize.value;
        CaptionFontCallerDiv.style.color=document.ReportEditChartsPage.CaptionFontColor.value;
        CaptionFontCallerDiv.style.fontWeight=(document.ReportEditChartsPage.CaptionFontBold.value=="True") ? "bold" : "normal";
        CaptionFontCallerDiv.style.textDecoration=(document.ReportEditChartsPage.CaptionFontUnderLine.value=="True") ? "underline" : "none";
        CaptionFontCallerDiv.style.fontStyle=(document.ReportEditChartsPage.CaptionFontItalics.value=="True") ? "italic" : "normal";
        
        BackWallColorDiv.style.backgroundColor=document.ReportEditChartsPage.BackWallColor.value;
        BackWallColorDiv.innerText=document.ReportEditChartsPage.BackWallColor.value;
        XWallColorDiv.style.backgroundColor=document.ReportEditChartsPage.XWallColor.value;
        XWallColorDiv.innerText=document.ReportEditChartsPage.XWallColor.value;
        YWallColorDiv.style.backgroundColor=document.ReportEditChartsPage.YWallColor.value;
        YWallColorDiv.innerText=document.ReportEditChartsPage.YWallColor.value;
        //alert(AlterDetailColorDiv.style.backgroundColor);
        //alert(DetailFontCallerDiv.style.fontFamily);
      }

      function SetFieldHiddenVars(){        
        var RptChartsEditPanelTable=null;
        RptChartsEditPanelTable=document.getElementById("RptChartsEditPanel");
        if (RptChartsEditPanelTable==null)
          return;

        document.ReportEditChartsPage.ChartTitleFontName.value=TitleFontColorCallerDiv.style.fontFamily;
        document.ReportEditChartsPage.ChartTitleFontSize.value=TitleFontColorCallerDiv.style.fontSize;
        document.ReportEditChartsPage.ChartTitleFontColor.value=TitleFontColorCallerDiv.style.color;
        document.ReportEditChartsPage.MainBGColor.value=TitleFontColorCallerDiv.style.backgroundColor;
        document.ReportEditChartsPage.ChartTitleFontBold.value=(TitleFontColorCallerDiv.style.fontWeight=="bold") ? "True" : "False";
        document.ReportEditChartsPage.ChartTitleFontUnderLine.value=(TitleFontColorCallerDiv.style.textDecoration=="underline") ? "True" : "False";
        document.ReportEditChartsPage.ChartTitleFontItalics.value=(TitleFontColorCallerDiv.style.fontStyle=="italic") ? "True" : "False";

        document.ReportEditChartsPage.LegendFontName.value=LegendFontColorCallerDiv.style.fontFamily;
        document.ReportEditChartsPage.LegendFontSize.value=LegendFontColorCallerDiv.style.fontSize;
        document.ReportEditChartsPage.LegendFontColor.value=LegendFontColorCallerDiv.style.color;
        document.ReportEditChartsPage.LegendBkgrdColor.value=LegendFontColorCallerDiv.style.backgroundColor;
        document.ReportEditChartsPage.LegendFontBold.value=(LegendFontColorCallerDiv.style.fontWeight=="bold") ? "True" : "False";
        document.ReportEditChartsPage.LegendFontUnderLine.value=(LegendFontColorCallerDiv.style.textDecoration=="underline") ? "True" : "False";
        document.ReportEditChartsPage.LegendFontItalics.value=(LegendFontColorCallerDiv.style.fontStyle=="italic") ? "True" : "False";
        document.ReportEditChartsPage.LegendBorderStyle.value=LegendFontColorCallerDiv.style.borderStyle;
        document.ReportEditChartsPage.LegendBorderColor.value=LegendFontColorCallerDiv.style.borderColor;
        document.ReportEditChartsPage.LegendBorderWidth.value=LegendFontColorCallerDiv.style.borderWidth;

        var RptLineChartItemsPanelTable=null;
        RptLineChartItemsPanelTable=document.getElementById("RptLineChartItemsPanel");
        if (RptLineChartItemsPanelTable==null)
          return;
        document.ReportEditChartsPage.CaptionFontName.value=CaptionFontCallerDiv.style.fontFamily;
        document.ReportEditChartsPage.CaptionFontSize.value=CaptionFontCallerDiv.style.fontSize;
        document.ReportEditChartsPage.CaptionFontColor.value=CaptionFontCallerDiv.style.color;
        document.ReportEditChartsPage.CaptionFontBold.value=(CaptionFontCallerDiv.style.fontWeight=="bold") ? "True" : "False";
        document.ReportEditChartsPage.CaptionFontUnderLine.value=(CaptionFontCallerDiv.style.textDecoration=="underline") ? "True" : "False";
        document.ReportEditChartsPage.CaptionFontItalics.value=(CaptionFontCallerDiv.style.fontStyle=="italic") ? "True" : "False";

        document.ReportEditChartsPage.XWallColor.value=XWallColorDiv.style.backgroundColor;
        document.ReportEditChartsPage.YWallColor.value=YWallColorDiv.style.backgroundColor;
        document.ReportEditChartsPage.BackWallColor.value=BackWallColorDiv.style.backgroundColor;
      }

      function SetHiddenVars(){
        document.ReportEditChartsPage.ChartRgnBackColor.value=RgnBackColorDiv.style.backgroundColor;
        document.ReportEditChartsPage.ChartRgnBorderWidth.value=RgnBackColorDiv.style.borderWidth;
        document.ReportEditChartsPage.ChartRgnBorderColor.value=RgnBackColorDiv.style.borderColor;
        document.ReportEditChartsPage.ChartRgnBorderStyle.value=RgnBackColorDiv.style.borderStyle;
      }

      function DoRemoveChart(CurrRecIndex){
        if (ConfirmDeleteChart() == 1) return;
        SetHiddenVars();        
        document.ReportEditChartsPage.CurrEditRecIndex.value=CurrRecIndex;
        __doPostBack('DeleteChart1', 'CLICK');
      }

      function DoEditChart(CurrRecIndex){
        SetFieldHiddenVars();
        SetHiddenVars();
        document.ReportEditChartsPage.CurrEditRecIndex.value=CurrRecIndex;
        //alert(document.ReportEditChartsPage.CurrEditRecIndex.value);
        __doPostBack('EditChart1', 'CLICK');
      }

      function DoMoveUpRecord(CurrRecIndex){
        SetFieldHiddenVars();
        SetHiddenVars();
        document.ReportEditChartsPage.CurrEditRecIndex.value=CurrRecIndex;
        __doPostBack('MoveUpBtn', 'CLICK');
      }

      function DoMoveDownRecord(CurrRecIndex){
        SetFieldHiddenVars();
        SetHiddenVars();
        document.ReportEditChartsPage.CurrEditRecIndex.value=CurrRecIndex;
        __doPostBack('MoveDownBtn', 'CLICK');
      }
