var I=document.images;
function W(s){document.write(s)}
function WL(s){document.writeln(s)}
var chartdraw_lblPie="Pie";var chartdraw_lblBar="Bar";var chartdraw_lblLine="Line";var chartdraw_tooltipShare="Share";var chartdraw_tooltipSeries="Series";var chartdraw_tooltipLabel="Label";var chartdraw_tooltipValue="Value";var chartdraw_msgPieChartError="Pie chart cannot be drawn.";var chartdraw_lblShowAll="Show All Series";var chartdraw_lblChartType="Chart Type";var chartdraw_lblSeries="Series";var no_data_series="No data series specified. Please add at least one data series to the graph.";var no_data_atttribute="No data attribute name specified for series - {0}. \nPlease select a valid data attribute for this series.";var no_label_attribute="No label attribute specified. \nPlease select a valid label attribute.";var no_group_operation_specified="No group operation specified for series: \n{0}.";var invalid_group_operation="Invalid group operation - {1} - specified for series - {0}. \nGroup operations allowed are - SUM, AVG, COUNT, MAX, MIN, FIRST, LAST.";var invalid_label_attribute="Invalid label attribute. \nPlease select a valid label attribute.";var invalid_data_atttribute="Invalid data attribute name specified for series - {0}. \nPlease select a valid data attribute for this series.";var invalid_series_attribute_data_type="Invalid data type specified for attribute name in series - {0}. \nThe graph can only be plotted if the attribute values are numbers or dates.";var null_data_value="Series - {0}. contains null values. \nThe graph can only be plotted if the attribute values does not contain any null values.";var thousands_str="thousands";var thousands10_str="10's of thousands";var thousands100_str="100's of thousands";var millions_str="millions";var millions10_str="10's of millions";var millions100_str="100's of millions";var billions_str="billions";var billions10_str="10's of billions";var billions100_str="100's of billions";var Scales=new Array();Scales=[[100000000000.0,billions100_str],[10000000000.0,billions10_str],[1000000000.0,billions_str],[100000000.0,millions100_str],[10000000.0,millions10_str],[1000000.0,millions_str],[100000.0,thousands100_str],[10000.0,thousands10_str],[1000.0,thousands_str]];var ChartCheck=null;var GRAPHS=[];var odcGraphtimer=1000;var odcGraphTimeObj=null;if(BROWSER_INFO.browser=="NAV")
{window.addEventListener('load',function(){odcGraphTimeObj=window.setTimeout(odcGraphRedraw,odcGraphtimer);},false);}
function odcGraphRedraw()
{var CompleteSuccess=true;var obj=null;for(var i=0;i<GRAPHS.length;++i)
{try
{var g=GRAPHS[i];if(g.chartObj.GetVariable("pointData")==null||g.chartObj.GetVariable("pointData")=="")
g.ShowGraph();else
continue;if(g.chartObj.GetVariable("pointData")==null||g.chartObj.GetVariable("pointData")=="")
CompleteSuccess=false;}
catch(e)
{CompleteSuccess=false;}
}
odcGraphtimer+=250;if(CompleteSuccess==false&&odcGraphtimer<3000)
{odcGraphTimeObj=window.setTimeout(odcGraphRedraw,odcGraphtimer);}
else
{window.clearTimeout(odcGraphTimeObj);}
}
function GraphDrawControl()
{GRAPHS[GRAPHS.length]=this;this.chartTitle="";this.xAxisTitle="";this.yAxisTitle="";this.yAxisNLData="";	this.seriesSelectorsNLData="";this.labelNLData="";	this.normalizedTitle=new Array();	this.commonNormalizedTitle="";this.dataSeriesNames="";this.lblPie=chartdraw_lblPie;this.lblBar=chartdraw_lblBar;this.lblLine=chartdraw_lblLine;this.tooltipShare=chartdraw_tooltipShare;this.tooltipSeries=chartdraw_tooltipSeries;this.tooltipLabel=chartdraw_tooltipLabel;this.tooltipValue=chartdraw_tooltipValue;this.msgPieChartError=chartdraw_msgPieChartError;	this.lblShowAll=chartdraw_lblShowAll;	this.lblChartType=chartdraw_lblChartType;	this.lblSeries=chartdraw_lblSeries;this.yAxisDivisions="";	var graphcsspath="/theme/graph.css";	this.css_url="";this.defaultChartType="Pie";this.showLabel;this.showPie;this.showBar;this.showLine;this.showLegend;	this.styleClass="";	this.selectedSeries=-1;	this.showHorizontalLinesBar;	this.showHorizontalLinesLine;	this.showVerticalLinesLine;this.pointData=null;this.pointNLData=null;this.seriesColorData="";this.pieChartColorData="";this.chartObj=null;this.dataSeparator="`";this.seriesSeparator="*";this.splitYAxis=false;	this.noGroupOpSepcified="";this.invalidgroupOperation=""; 	this.label_converter_exception="";	this.data_converter_exception="";	this.yaxis_converter_exception=""; 	var data_exception_shown=false;	var label_exception_shown=false;	var data_exception_shown=false;	var yaxis_exception_shown=false;	this.data_converter_exception="";	this.show_no_graph=false;var tempSeriesNames="";var retvalue="";this.Flash_SeriesColor_Array=[
							["6868D8","blue pens"],
								["F8C800","goldenrod pens"],
								["F83800","red pens"],
						["209800","leaf grean pens"],
								["F88800","orange pens"],
["0090B0","deep sky blue pens"],
								["A0A0A0","light grey pens"],
					["33338C","navy blue pens"],
							["E104D9","medium violet red pens"],
								["04E132","lime green pens"]
 		];	this.Flash_PieSectionColor_Array=[
		["6868D8","blue pens"],
["F8C800","goldenrod pens"],
							["F83800","red pens"],
["209800","leaf grean pens"],
["F88800","orange pens"],
["0090B0","deep sky blue pens"],
		["A0A0A0","light grey pens"],
["33338C","navy blue pens"],
							["E104D9","medium violet red pens"],
["04E132","lime green pens"],
	["474747","dark grey"],
["0BE6DE","cyan pens"],
["816940","saddle brown pens"],
["F5FC33","yellow pens"],
["F56AB2","viiolet red pens"],
["145A01","spring green pens"],
["FDB663","sienna pens"],
["9B9351","light orange pens"],
["C5C5C5","honey dew pens"],
["9205C6","blue violet pens"],
								["C6BF05","orange pens"],
["A3BDFA","medium purple pens"],
["C3ED7B","pale green pens"],
["D46F03","fire brick  pens"],
["F9F890","light yellow pens"],
					["CC9189","indian red pens"],
["A9BC9D","grey pens"],
								["419189","green pens"],
["914161","light red pens"],
								["9398B5","dark white pens"]
	];		this.isRendered=false;		this.type="GraphDraw";		this.pageId="graphdraw1";		
	
		this.getType=function(){			return this.type;		}
	
		this.getId=function(){			return this.pageId;		}
this.setValue=function()
{alert("SetValue() called!!!! SHOULDN'T BE!!!");}
this.separateSeries=function()
{for(var r=0;r<this.dataSeriesNames.length;r++)
{if(r==0){tempSeriesNames=this.dataSeriesNames[r];}else{tempSeriesNames=tempSeriesNames+this.seriesSeparator+this.dataSeriesNames[r];}
					 if(this.normalizedTitle[r]!="undefined"&&typeof(this.normalizedTitle[r])!="undefined"){ 					 tempSeriesNames=tempSeriesNames+this.dataSeparator+this.normalizedTitle[r]; 					}
}
}
this.show=function()
{		this.ShowGraph();	}
		
			this.getSelectedItems=function()
			{				return new Array();			}
		
			this.getHighlightedItem=function()
			{				return 	null;			}
this.ShowGraph=function()
{			
				var StrNoOper=""; 				if(this.noGroupOpSepcified.length!=0){				for(var i=0;i<this.noGroupOpSepcified.length;i++){					if(i>0){						StrNoOper+=", ";					}
						StrNoOper+=this.dataSeriesNames[this.noGroupOpSepcified.charAt(i)];				}
				var arg=new Array();				arg[0]=StrNoOper;				var Msg=NlsFormatMsg(no_group_operation_specified,arg);				Log.error("Execute",Msg);				alert(Msg);				return; 				}
			
			var tempInvGrpOper=this.invalidgroupOperation;			if(tempInvGrpOper.substring(0,4)=="true"){			var arg=new Array();			var StrInvOper=this.dataSeriesNames[parseInt(tempInvGrpOper.charAt(4))];			var StrInv=tempInvGrpOper.substring(5,tempInvGrpOper.length);				arg[0]=StrInvOper
				arg[1]=StrInv
				var Msg=NlsFormatMsg(invalid_group_operation,arg);				Log.error("Execute",Msg);				alert(Msg);				return; 		}
		if(this.show_no_graph==true)return;			if((this.label_converter_exception!="")&&(label_exception_shown==false))	{				alert(this.label_converter_exception);				label_exception_shown=true;			}
			if((this.data_converter_exception!="")&&(data_exception_shown==false))	{ 			alert(this.data_converter_exception);			data_exception_shown=true;			}
			if((this.yaxis_converter_exception!="")&&(yaxis_exception_shown==false))	{			alert(this.yaxis_converter_exception);			yaxis_exception_shown=true;			}
		obj=this;			
		if(BROWSER_INFO.browser=="NAV")
		{this.updateChart();}
this.isRendered=true;}
this.updateChart=function()
{if(this.chartTitle!=""&&typeof(this.chartTitle)!="undefined")this.chartObj.SetVariable("chartTitle",this.chartTitle);if(this.xAxisTitle!=""&&typeof(this.xAxisTitle)!="undefined")this.chartObj.SetVariable("xAxisTitle",this.xAxisTitle); 			if(this.commonNormalizedTitle!=undefined){ 				if(typeof(this.yAxisTitle)!="undefined")this.chartObj.SetVariable("yAxisTitle",this.yAxisTitle+this.dataSeparator+this.commonNormalizedTitle);			}else{ 				if(typeof(this.yAxisTitle)!="undefined")this.chartObj.SetVariable("yAxisTitle",this.yAxisTitle);			}
if(this.dataSeriesNames!=""&&typeof(this.dataSeriesNames)!="undefined")this.chartObj.SetVariable("seriesNames",tempSeriesNames);if(this.yAxisDivisions!=""&&typeof(this.yAxisDivisions)!="undefined")this.chartObj.SetVariable("yAxisDivisions",this.yAxisDivisions);			 
if(this.defaultChartType!=""&&typeof(this.defaultChartType)!="undefined")this.chartObj.SetVariable("defaultChartType",this.defaultChartType);			if(this.selectedSeries!=""&&typeof(this.selectedSeries)!="undefined")this.chartObj.SetVariable("selectedSeries",this.selectedSeries);if(this.showLabel!=""&&typeof(this.showLabel)!="undefined")this.chartObj.SetVariable("showLabel",this.showLabel);if(this.showPie!=""&&typeof(this.showPie)!="undefined")this.chartObj.SetVariable("showPie",this.showPie);if(this.showBar!=""&&typeof(this.showBar)!="undefined")this.chartObj.SetVariable("showBar",this.showBar);if(this.showLine!=""&&typeof(this.showLine)!="undefined")this.chartObj.SetVariable("showLine",this.showLine);			if(this.styleClass!=""&&typeof(this.styleClass)!="undefined")this.chartObj.SetVariable("styleClass",this.styleClass);if(this.showLegend!=""&&typeof(this.showLegend)!="undefined")this.chartObj.SetVariable("showLegend",this.showLegend);			if(this.showHorizontalLinesBar!=""&&typeof(this.showHorizontalLinesBar)!="undefined")this.chartObj.SetVariable("showHorizontalLinesBar",this.showHorizontalLinesBar);			if(this.showHorizontalLinesLine!=""&&typeof(this.showHorizontalLinesLine)!="undefined")this.chartObj.SetVariable("showHorizontalLinesLine",this.showHorizontalLinesLine);			if(this.showVerticalLinesLine!=""&&typeof(this.showVerticalLinesLine)!="undefined")this.chartObj.SetVariable("showVerticalLinesLine",this.showVerticalLinesLine);if(this.labelNLData!=""&&typeof(this.labelNLData)!="undefined")this.chartObj.SetVariable("labelNLData",this.labelNLData);if(this.pointData!=""&&typeof(this.pointData)!="undefined")this.chartObj.SetVariable("pointData",this.pointData);if(this.yAxisNLData!=""&&typeof(this.yAxisNLData)!="undefined")this.chartObj.SetVariable("yAxisNLData",this.yAxisNLData); 			if(this.seriesSelectorsNLData!=""&&typeof(this.seriesSelectorsNLData)!="undefined")this.chartObj.SetVariable("seriesSelectorsNLData",this.seriesSelectorsNLData);if(this.pointNLData!=""&&typeof(this.pointNLData)!="undefined")this.chartObj.SetVariable("pointNLData",this.pointNLData);			if(this.singlePointNLData!=""&&typeof(this.singlePointNLData)!="undefined")this.chartObj.SetVariable("singlePointNLData",this.singlePointNLData);if(this.splitYAxis!=""&&typeof(this.splitYAxis)!="undefined")this.chartObj.SetVariable("splitYAxis",this.splitYAxis);if(this.seriesColorData!=""&&typeof(this.seriesColorData)!="undefined")this.chartObj.SetVariable("seriesColorData",this.seriesColorData);if(this.pieChartColorData!=""&&typeof(this.pieChartColorData)!="undefined")this.chartObj.SetVariable("pieChartColorData",this.pieChartColorData);if(this.dataSeparator!=""&&typeof(this.dataSeparator)!="undefined")this.chartObj.SetVariable("dataSeparator",this.dataSeparator);if(this.seriesSeparator!=""&&typeof(this.seriesSeparator)!="undefined")this.chartObj.SetVariable("seriesSeparator",this.seriesSeparator);if(typeof(this.lblPie)!="undefined")this.chartObj.SetVariable("lblPie",this.lblPie);if(typeof(this.lblBar)!="undefined")this.chartObj.SetVariable("lblBar",this.lblBar);if(typeof(this.lblLine)!="undefined")this.chartObj.SetVariable("lblLine",this.lblLine);			if(typeof(this.lblShowAll)!="undefined")this.chartObj.SetVariable("lblShowAll",this.lblShowAll);			if(typeof(this.lblChartType)!="undefined")this.chartObj.SetVariable("lblChartType",this.lblChartType);			if(typeof(this.lblSeries)!="undefined")this.chartObj.SetVariable("lblSeries",this.lblSeries);if(this.tooltipSeries!=""&&typeof(this.tooltipSeries)!="undefined")this.chartObj.SetVariable("tooltipSeries",this.tooltipSeries);if(this.tooltipLabel!=""&&typeof(this.tooltipLabel)!="undefined")this.chartObj.SetVariable("tooltipLabel",this.tooltipLabel);if(this.tooltipShare!=""&&typeof(this.tooltipShare)!="undefined")this.chartObj.SetVariable("tooltipShare",this.tooltipShare);if(this.tooltipValue!=""&&typeof(this.tooltipValue)!="undefined")this.chartObj.SetVariable("tooltipValue",this.tooltipValue);if(this.msgPieChartError!=""&&typeof(this.msgPieChartError)!="undefined")this.chartObj.SetVariable("msgPieChartError",this.msgPieChartError);			
 			var isSlash=URL_REWRITER_PREFIX.charAt(0);			if(isSlash=="/"){ 					var projectName=URL_REWRITER_PREFIX.substring(1,URL_REWRITER_PREFIX.lastIndexOf("/",URL_REWRITER_PREFIX.length - 2));					this.css_url="/"+projectName+graphcsspath;			}
			else{				var projectName=URL_REWRITER_PREFIX.substring(0,URL_REWRITER_PREFIX.lastIndexOf("/",URL_REWRITER_PREFIX.length - 2));				this.css_url=projectName+graphcsspath;			}
 
 			if(this.css_url!=""&&typeof(this.css_url)!="undefined")this.chartObj.SetVariable("css_url",this.css_url);try{this.chartObj.TCallLabel("/","update");}
catch(e){}
}
this.setChartType=function(chart_type)
{this.defaultChartType=chart_type;}
		this.loadColorData=function()
 		{			this.seriesColorData="";			this.pieChartColorData="";	 		if(this.pointData.length=="null"||this.pointData.length==null||this.pointData.length=='undefined'){ 				this.seriesColorData+=this.Flash_SeriesColor_Array[0][0];				this.pieChartColorData+=this.Flash_PieSectionColor_Array[1][0];			}
			else
			{			var points=this.pointData.split(this.dataSeparator); 			if(points.length!='undefined')
{				var maxSeriesColors=this.Flash_SeriesColor_Array.length;				var maxSectionColors=this.Flash_PieSectionColor_Array.length; 				
				
				var j=0;				for(var i=0;i<this.dataSeriesNames.length;i++)
				{					if(i>0){						this.seriesColorData+=this.seriesSeparator;					}
					if(i>=maxSeriesColors){ 	 					this.seriesColorData+=this.Flash_SeriesColor_Array[j++][0]; 						if(j>=maxSeriesColors){							j=0;						}
					}
					else{		 					this.seriesColorData+=this.Flash_SeriesColor_Array[i][0];					}
				}
				
				
				var j=1;				for(var i=0;i<points.length;i++)
{ 					if(i>0){						this.pieChartColorData+=this.seriesSeparator;					}
					if(i>=maxSectionColors){ 						this.pieChartColorData+=this.Flash_PieSectionColor_Array[j++][0]; 						if(j>=maxSectionColors){							j=1;						}
					}
					else{ 						this.pieChartColorData+=this.Flash_PieSectionColor_Array[i][0];					}
				}
}
		}
}
}

