// 
//  ExternalInterface.js
//  __________________________________________________________________
// 
//  Title:			ExternalInterface for mChart
//  Description:	mChartÀÇ ExternalInterface¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Â ÇÔ¼ö
// 
// Last modified:	2007-10-11
// Flash version:	8,0,0,0
// 
// @author			Shin, Yunwoo(ywshin@hanafos.com)
// @Copyright (C) 2007 by JEINE C&C  All right reserved.
// @version			1.0
//

/////////////////////////  Function List //////////////////////////////
//
//		modifyChart()
//		modifyBackground()
//		modifyCanvas()
//		modifyCategoryAxis()
//		modifyCategorys()
//		modifyValueAxis();
//		modifySubValueAxis();
//		modifyLegend();
//		modifyDivision();
//		modifyGrid();
//		modifyDataSeries();
//		modifyDataElement();
//		updateChart();
//		getObject();
//
/////////////////////////////////////////////////////////////////////////
function ExternalInterface(cId){

	this.chartId	=	cId;

}

ExternalInterface.prototype.modifyChart = function(cGroup,cName,cValue){
	var eId = this.getObject(this.chartId);
	eId.setChart(cGroup,cName,cValue);
}

ExternalInterface.prototype.modifyBackground = function(cGroup,cName,cValue){  
	var eId = this.getObject(this.chartId);
	eId.setBackground(cGroup,cName,cValue);
} 

ExternalInterface.prototype.modifyCanvas = function(cGroup,cName,cValue){
	var eId = this.getObject(this.chartId);     
	eId.setCanvas(cGroup,cName,cValue); 
}

ExternalInterface.prototype.modifyDivision = function(cGroup,cName,cValue){
	var eId = this.getObject(this.chartId);
	eId.setDivision(cGroup,cName,cValue);
}

ExternalInterface.prototype.modifyCategoryAxis = function(cGroup,cName,cValue){ 
	var eId = this.getObject(this.chartId);
	eId.setCategoryAxis(cGroup,cName,cValue);
}

ExternalInterface.prototype.modifyValueAxis = function(cGroup,cName,cValue){ 
	var eId = this.getObject(this.chartId);
	eId.setValueAxis(cGroup,cName,cValue);
}

ExternalInterface.prototype.modifySubValueAxis = function(cGroup,cName,cValue){ 
	var eId = this.getObject(this.chartId);
	eId.setSubValueAxis(cGroup,cName,cValue);
}

ExternalInterface.prototype.modifyLegend = function(cGroup,cName,cValue){ 
	var eId = this.getObject(this.chartId);
	eId.setLegend(cGroup,cName,cValue);
}

ExternalInterface.prototype.modifyGrid = function(cGroup,cName,cValue){
	var eId = this.getObject(this.chartId);
	eId.setGrid(cGroup,cName,cValue);
}

							
ExternalInterface.prototype.modifyDataElement = function(deGroup,deName,deValue,deDsname,deIndex){
	var eId = this.getObject(this.chartId);
	eId.setDataElement(deGroup,deName,deValue,deDsname,deIndex);
}

ExternalInterface.prototype.modifyCategorys = function(ctGroup,ctName,ctValue, ctIndex){
	var eId = this.getObject(this.chartId);
	eId.setCategorys(ctGroup,ctName,ctValue, ctIndex);
}

ExternalInterface.prototype.modifyDataSeries = function(dsGroup,dsName,dsValue, dsIndex){
	var eId = this.getObject(this.chartId);
	eId.setDataSeries(dsGroup,dsName,dsValue, dsIndex);
}

ExternalInterface.prototype.getObject = function(elementId){

	return (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
}  

ExternalInterface.prototype.reDrawChart = function(dataVal){
	var eId = this.getObject(this.chartId);
	eId.reDrawChart(dataVal); 
}

ExternalInterface.prototype.updateChart = function(){
	var eId = this.getObject(this.chartId);
	eId.execute();
}



