/** NOTE:   this file exists purely for backward compatibility reason for old embed charts.  
 *          We SHOULD NOT develop this file any further.  All additional code for embedded charts
 *			should be done in charts/wikinvest/wikichart/javascript/Chart.js
 *
 *			All work for generic web metrics should be done in Resource.js file.
 */

(function()
{
	if ((typeof(Wikinvest) == 'undefined') ||  (typeof(Wikinvest.WebMetrics) == 'undefined'))
	{
		// this js should not execute if the above namespaces do not exist
		//alert("cannot find necessary namespace, exiting script");
		return; // prevent the rest of the js files from executing 
	}
	
	//alert("found the necessary namespaces.  continue with rest of function definition");
	if ( (typeof(Wikinvest.Chart) == 'undefined') )
	{
		Wikinvest.Chart = {};
	}

	if ( (typeof(Wikinvest.Chart.ChartTracker) == 'undefined') )
	{
		// if bloggertracker namespace has not bee defined, create a namespsace
		Wikinvest.Chart.ChartTracker = {};
	}

	Wikinvest.Chart.ChartTracker.trackChartView = function(chartId)
	{
	
		if ( (chartId != null) && (chartId.length != 0) )
		{
			/**
			var wikinvestChartViewTracker = new Wikinvest.WebMetrics.Tracker();
			var trackingType = 2; // tracking chart view 
			wikinvestChartViewTracker._trackPageView(trackingType, chartId);
			*/
		}
		// this method will be called by flex, which will return null if method is not found
		// or if method does not have a return value.  We are going to return default true
		// so that flex can tell if this method exists or not
		return true;
	};

	Wikinvest.Chart.ChartTracker.trackChartAction = function(chartId, chartAction)
	{
		/**
		if ( (chartId != null) && (chartAction != null) && (chartId.length != 0) &&
			(chartAction.length != 0) )
		{
			var wikinvestChartActionTracker = new Wikinvest.WebMetrics.Tracker();
			var trackingType = 5;  // tracking click action
			wikinvestChartActionTracker._trackUrlClick(trackingType, chartId, chartAction);
		}
		*/
	};
})();
