function SceneListMainCallFlagList(options) {

	this.options			= options;	

	this.FlagList	= null;
	this.FlagListDim = null;
	this.FlagListPopupBG = null;
	
	this.CurItemIndex	= -1;
	this.CurDataIndex	= -1;
}

SceneListMainCallFlagList.prototype.initialize = function () {
	alert("SceneListMainCallFlagList.initialize()");	
	this.create();
}

SceneListMainCallFlagList.prototype.handleShow = function () {
	alert("SceneListMainCallFlagList.handleShow()");
	
	this.FlagList.Show();
}

SceneListMainCallFlagList.prototype.handleHide = function () {
	alert("SceneListMainCallFlagList.handleHide()");
	this.FlagList.Hide();

}

SceneListMainCallFlagList.prototype.handleFocus = function () {
	alert("SceneListMainCallFlagList.handleFocus()");
	if(this.CurItemIndex < 0) {
		this.FlagList.SetCurrentItem(0);	
	}
	else{
		this.FlagList.SetCurrentItem(this.CurItemIndex);
	}
	
}

SceneListMainCallFlagList.prototype.handleBlur = function () {
	alert("SceneListMainCallFlagList.handleBlur()");
}

SceneListMainCallFlagList.prototype.handleKeyDown = function (keyCode) {
	
	alert("SceneListMainCallFlagList.handleKeyDown(" + keyCode + ")");
	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	PluginAPIMgr.PlayAudio(keyCode);
	this.FlagList.KeyProcess(keyCode);	

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////

SceneListMainCallFlagList.prototype.create = function(){
    alert("SceneListMainCallFlagList.create() ");

	
	
	this.FlagList = new List();
	this.FlagList.CreateBG("FlagList");
	this.FlagList.SetBGImage(g_Image.IMAGE_LIST_MAIN_CALL_COUNTR_FLAG_LIST_BG);	
	this.FlagList.SetNumOfVisibleItem(5);
	this.FlagList.SetStartDataIndex(0);		
	this.FlagList.SetItemBgImage(ITEM_STATE.NORMAL," ");
	this.FlagList.SetItemBgImage(ITEM_STATE.HIGHLIGHT,g_Image.IMAGE_LIST_MAIN_CALL_COUNTR_FLAG_LIST_ITEM_HIGHLIGHT_BG);
	this.FlagList.SetDataType(ITEM_DATA_TYPE.IMAGE_ONLY);
	
	var scene = sf.scene.get("ListMainCallFlagList");
	this.FlagList.SetEventOnReturnFunc(scene.ProcessKeyReturn);
	this.FlagList.SetItemPressedEventCallback(scene.ProcessKeyEnter);
		
	var NumOfCountryList = g_Data.GetNumOfCountry();
	var tempData = new Array(NumOfCountryList);  
		
	for (var i=0; i < NumOfCountryList; i++) {
				
		tempData[i] = [ null , g_Image.base_flag_image_path + g_Data.DATA_COUNTRY_PREFIX_ARRAY[i].toUpperCase() + ".png" ];				
		this.FlagList.AddData(tempData[i]);					
	}		
			
	this.FlagList.ShowItem();		



}

SceneListMainCallFlagList.prototype.ProcessKeyReturn = function(){

	alert("SceneListMainCallFlagList.ProcessKeyReturn() ");
	sf.scene.focus('ListMainCall');
	sf.scene.hide('ListMainCallFlagList');

}




SceneListMainCallFlagList.prototype.ProcessKeyEnter = function(){

	alert("SceneListMainCallFlagList.ProcessKeyEnter() ");
	
	var This_ = sf.scene.get("ListMainCallFlagList");
	
	var Index = This_.FlagList.GetCurrentDataIndex();
	
	This_.CurItemIndex = This_.FlagList.GetCurrentItem();
	This_.CurDataIndex = Index;
	
	var Callscene = sf.scene.get("ListMainCall");


	//alert("Image = " + g_Data.DATA_COUNTRY_PREFIX_ARRAY[Index].toUpperCase() + ".png");
	Callscene.CountryCode  = g_Data.DATA_COUNTRY_PREFIX_ARRAY[Index];
	Callscene.CountryCodeBtn.SetFgImage( g_Image.base_flag_image_path + g_Data.DATA_COUNTRY_PREFIX_ARRAY[Index].toUpperCase() + ".png" );
	Callscene.CountryNameLabel.SetText(g_Data.DATA_COUNTRY_NAME_ARRAY[Index]);	
	Callscene.highlight(Callscene.CountryCodeBtn);
	
	sf.scene.hide('ListMainCallFlagList');
	sf.scene.focus('ListMainCall');

}

