function SceneminiMainContact(options) {

	this.options = options;

	this.miniMainContactView = null;
    
     this.destroyFlag = null;
     this.liveCallFlag = null;

	//object
	this.ListMainContactBtn 	= null;
	this.ListMainSignOutBtn 	= null;
    this.ListMainGoToSkypeBtn 	= null;
    this.list					= null;
			
	//flags
	this.Status			= ENUM_SCENE_STATUS.INITIALIZED;
	this.LiveCallMode	= false;
	this.SetFocus		= false;	
	this.IsShownObj		= false;
	
	this.WheelOperation = false;
	this.Timer=null;
	
	this.listDivId=null;
	this.contactUpArrow=null;
	this.contactDownArrow=null;
	
	//add by minseok 130805 : for miniStatusChange Scene
	this.init = false;
	
}

SceneminiMainContact.prototype.initialize = function () {
	alert("SceneminiMainContact.initialize()");
	this.create();
	this.init = true;
}

SceneminiMainContact.prototype.handleShow = function () {
	alert("SceneminiMainContact.handleShow()");
	this.ShowObj();
	this.ShowKeyHelpbar();
	$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).helpbarType=2;
	
	$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).LC_setStartPage(false);	
	this.ArrowUpdate();
}

SceneminiMainContact.prototype.handleHide = function () {
	alert("SceneminiMainContact.handleHide()");
	
	if (this.IsShownObj) {
		this.list.Hide();
		this.IsShownObj = false;
		this.Status = ENUM_SCENE_STATUS.DISAPPEARED;
		var obj = this.ListMainContactView.getCurrentHighlight();
		if(obj)
			obj.blur();
		//this.highlight(null);
 	}
	
	$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).LC_setEndPage();	
}

SceneminiMainContact.prototype.handleFocus = function () {
	alert("SceneminiMainContact.handleFocus()");
	//TEMPCODE:
	//set focus when popup was shown...

	if(this.IsShownObj){
		var currentHighlight =  this.ListMainContactView.getCurrentHighlight();
		alert("currentHighlight = "+currentHighlight+", miniLastHighlight = "+this.list.miniLastHighlight);

		if(currentHighlight == null && this.list.miniLastHighlight == ENUM_SCENE_NAVIGATOR.RETURN_TAB)
		{
			this.highlight(this.ListMainContactBtn);
		} 
		else if(currentHighlight == null && this.list.miniLastHighlight <= ENUM_SCENE_NAVIGATOR.GOTO_SKYPE)
		{
			this.blur();
			if(this.list.miniLastHighlight == ENUM_SCENE_NAVIGATOR.CONTACT_BTN) {
				this.highlight(this.ListMainContactBtn);
			} else if(this.list.miniLastHighlight == ENUM_SCENE_NAVIGATOR.SIGNOUT_BTN) {
				this.highlight(this.ListMainSignOutBtn);
			} else if(this.list.miniLastHighlight == ENUM_SCENE_NAVIGATOR.CONTACT_LIST) {
				this.list.highlight();
			} else if(this.list.miniLastHighlight == ENUM_SCENE_NAVIGATOR.GOTO_SKYPE) {
				this.highlight(this.ListMainGoToSkypeBtn);
			}
		} 
		else
		{
			if(currentHighlight == null)
				this.highlight(this.ListMainContactBtn);
			else
			this.highlight(currentHighlight);
		}
	}
	this.ShowKeyHelpbar();
	
}

SceneminiMainContact.prototype.handleBlur = function () {
	alert("SceneminiMainContact.handleBlur()");
	if(this.IsShownObj){
		var obj = this.ListMainContactView.getCurrentHighlight();
		if( !(obj==this.list && this.list.Flag_Select==true)&&obj!=null){
			obj.blur();
		}
	}
}

SceneminiMainContact.prototype.handleKeyDown = function (keyCode) {
	
	alert("SceneminiMainContact.handleKeyDown(" + keyCode + ")");
	if(TVCOMM_SERVICE_MODE == TVCHAT_MODE_HIDDEN && !(keyCode==$.sfKey.RETURN ||keyCode==$.sfKey.EXIT||keyCode==$.sfKey.BLUE)){
		return;
	}
	PluginAPIMgr.PlayAudio(keyCode);
	
	var ridgeDirection = Math.round((keyCode - (5*10000000)) / 100000);
	
	if(ridgeDirection == 1) { // Ridge flick : Up
		if(ProcMgr.GetRidgeFlick() == false) {
			this.list.PageScroll(true);
			ProcMgr.StartRidgeTimer();
		}
	}
	else if(ridgeDirection == 2) { // Ridge flick : Down
		if(ProcMgr.GetRidgeFlick() == false) {
			this.list.PageScroll(false);
			ProcMgr.StartRidgeTimer();
		}
	}
	else {
		switch(keyCode) {
			case $.sfKey.LEFT:
				this.processLeftKey();
				break;
			case $.sfKey.RIGHT:
				this.processRightKey();
				break;
			case $.sfKey.UP:
				this.processUpKey();
				break;
			case $.sfKey.DOWN:
				this.processDownKey();
				break;
			case $.sfKey.ENTER:
                this.processEnterKey();
                break;
              
			case $.sfKey.TOOLS:
				$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).processToolsKey();
				break; 
			case $.sfKey.BLUE:
				$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).processBlueKey();
				break;
			case $.sfKey.RED:
				StateMgr.Start_Signout_State();
				break;
			case	ENUM_CALL_BLOCK_KEY_CODE.DUALVIEW:
				WndMgr.StartOneBottonPopup(OneBtnPopupIndex.FUNCTION_ISNT_AVAILABLE);
				break;		
			case $.sfKey.RETURN:
			case $.sfKey.EXIT:
				$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).processExitKey();
				break;
	/*
			case 147:		//infolink
			case 261:		//contents
			case 115:		//wiselink
				ProcMgr.processInfolinkKey();
				break;
	*/
		}
		if(Flag_Hidden_State==false)
			event.stopPropagation();
	}
}

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

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

   this.ListMainContactView = new View("miniMainContact");

	var this_ = this;
    var clickCF =  function(obj){this_.processClickEvent(obj);};

    this.ListMainContactBtn = new Button();
    this.ListMainContactBtn.SetImageObjId("list_main_contact_btn");
    this.ListMainContactBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_LIST_MAIN_CONTACT_INPUT_ITEM_NORMAL_BG);
    this.ListMainContactBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_LIST_MAIN_CONTACT_INPUT_ITEM_HIGHLIGHT_BG);
	this.ListMainContactBtn.SetBgImage(BtnImgIndex.BTN_SELECTED_IMG, g_Image.IMAGE_LIST_MAIN_CONTACT_INPUT_ITEM_HIGHLIGHT_BG);
    this.ListMainContactBtn.SetTextObjId("list_main_contact_btn_text");
    this.ListMainContactBtn.SetIsPlainText(true);
    this.ListMainContactBtn.SetText(PluginAPIMgr.GetMyDisplayName());
    this.ListMainContactBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"list_main_category_btn_style_nor");
    this.ListMainContactBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"list_main_category_btn_style_focus");     	
	this.ListMainContactBtn.SetIconObjId("list_main_contact_btn_icon");
    this.ListMainContactBtn.SetBgIcon(0,PluginAPIMgr.GetMyOnlineStateImage());		
	this.ListMainContactBtn.SetOnClickCallbackFunc(clickCF);
	this.ListMainContactBtn.SetOnMouseOverCallbackFunc(function(obj){
	    this_.processMouseOver(obj);
	});
    this.ListMainContactBtn.setTextKPILog(KPI_LOG_ITEM_ID.ONLINE_STATUS_BTN);

    this.ListMainSignOutBtn = new Button();
    this.ListMainSignOutBtn.SetImageObjId("list_main_sign_out_btn");
    this.ListMainSignOutBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_LIST_MAIN_CONTACT_SIGN_OUT_NORMAL_BG);
    this.ListMainSignOutBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_LIST_MAIN_CONTACT_SIGN_OUT_HIGHLIGHT_BG);
	this.ListMainSignOutBtn.SetBgImage(BtnImgIndex.BTN_SELECTED_IMG, g_Image.IMAGE_LIST_MAIN_CONTACT_SIGN_OUT_OVER_BG);
	this.ListMainSignOutBtn.SetOnClickCallbackFunc(clickCF);
	this.ListMainSignOutBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.ListMainSignOutBtn.setTextKPILog(KPI_LOG_ITEM_ID.LOGOUT_BTN);

	this.ListMainGoToSkypeBtn= new Button();
	this.ListMainGoToSkypeBtn.SetImageObjId("list_main_GoToSkype_btn",20);
	this.ListMainGoToSkypeBtn.SetTextObjId("list_main_GoToSkype_btn_text");
	this.ListMainGoToSkypeBtn.SetOnClickCallbackFunc(clickCF);
	this.ListMainGoToSkypeBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.ListMainGoToSkypeBtn.setTextKPILog(KPI_LOG_ITEM_ID.GO_TO_SKYPE_BTN);

	this.list = new ContactList();	
    this.list.Create();
	this.Status = ENUM_SCENE_STATUS.CREATED;
	
    this.TempDiv = document.getElementById("miniMainContact");
   	this.TempDiv.onmousewheel = function()
   	{
   		if(this_.WheelOperation == false)
   		{
   			alert("SceneminiMainContact.onmousewheel");
	   		this_.WheelOperation = true;
	   		PluginAPIMgr.StartOSDTimer("700" , function() { this_.timerCallback();}, ENUM_TIMER_TYPE.POPUP_WND);
	   		
			if(event.wheelDelta > 0)
			{
				this_.list.PageScroll(true);
			}
			else
			{
				this_.list.PageScroll(false);
			}
	    }		
    };	
    // arrow
    this.contactUpArrow = new Label("contactUpArrow",null);
    this.contactDownArrow = new Label("contactDownArrow",null);
   
    if (WndMgr.MouseOverEnable == true) {
       
        $("#contactList").bind("mouseenter", function() {
            this_.ShowArrow();
        });
        $("#contactList").bind("mouseleave", function() {
            this_.HideArrow();
        });
        $("#contactUpArrow").bind("mouseenter", function() {
            this_.contactUpArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_UP_FOCUS);
            this_.contactDownArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_DOWN_NORMAL);
        });
        $("#contactUpArrow").bind("mouseleave", function() {
            this_.contactUpArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_UP_NORMAL);
        });
        $("#contactDownArrow").bind("mouseenter", function() {
            this_.contactDownArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_DOWN_FOCUS);
            this_.contactUpArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_UP_NORMAL);
        });
        $("#contactDownArrow").bind("mouseleave", function() {
            this_.contactDownArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_DOWN_NORMAL);
        });

        }
        if (WndMgr.MouseClickEnable == true) {
            $("#contactUpArrow").click(function() {
                this_.list.PageScroll(true);
            });
            $("#contactDownArrow").click(function() {
                this_.list.PageScroll(false);
            });
        }

}
SceneminiMainContact.prototype.ArrowUpdate = function() {
    alert("SceneminiMainContact.prototype.ArrowUpdate ");
    this.contactUpArrow.hiddenObj();
    this.contactDownArrow.hiddenObj();
    if(this.list.TotalPageNum>1){
        if(this.list.GetCurPage()==1){
            this.contactUpArrow.hiddenObj();
            this.contactDownArrow.visibleObj();
        }else if(this.list.GetCurPage() >= this.list.TotalPageNum){
            this.contactUpArrow.visibleObj();
            this.contactDownArrow.hiddenObj();
        }else{
            this.contactUpArrow.visibleObj();
            this.contactDownArrow.visibleObj();
        }
    }
}
SceneminiMainContact.prototype.ShowArrow = function() {
    alert("SceneminiMainContact.prototype.ShowArrow ");
    this.contactUpArrow.SetBgImage(" ");
    this.contactDownArrow.SetBgImage(" ");
    this.contactUpArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_UP_NORMAL);
    this.contactDownArrow.SetBgImage(g_Image.IMAGE_MAIN_ARROW_DOWN_NORMAL);
}
SceneminiMainContact.prototype.HideArrow = function() {
       alert("SceneminiMainContact.prototype.HideArrow ");
    this.contactUpArrow.SetBgImage(" ");
    this.contactDownArrow.SetBgImage(" ");
}
SceneminiMainContact.prototype.setDestroyFlag= function(destroy_flag){
     this.destroyFlag = destroy_flag;
}

SceneminiMainContact.prototype.setLiveCallFlag= function(live_call_flag){
     this.liveCallFlag = live_call_flag;
}

SceneminiMainContact.prototype.highlight = function(obj) {
    alert("SceneminiMainContact.highlight() = " + obj);
   
	this.ListMainContactView.setCurrenHighlight(obj);
}

SceneminiMainContact.prototype.blur = function() {
    alert("SceneminiMainContact.blur()");

	this.ListMainContactBtn.blur();
	this.ListMainSignOutBtn.blur();
	this.ListMainGoToSkypeBtn.blur();
	this.list.blur();
}

SceneminiMainContact.prototype.update=function()
{
    alert("SceneminiMainContact.update()");
    this.updateOnlineStatus();
    this.updateSkypeName();
}

SceneminiMainContact.prototype.updateOnlineStatus= function()
{
    this.ListMainContactBtn.SetBgIcon(0,PluginAPIMgr.GetMyOnlineStateImage());
	this.ListMainContactBtn.SetBgIcon(1,PluginAPIMgr.GetMyOnlineStateImage());
}

SceneminiMainContact.prototype.updateSkypeName = function()
{
     this.ListMainContactBtn.SetText(PluginAPIMgr.GetMyDisplayName());
}

SceneminiMainContact.prototype.UpdateNewChatNum=function(){
		
}

/*
SceneminiMainContact.prototype.toggleCameraOffBtnEnable=function()
{
    alert("SceneminiMainContact.toggleCameraOffBtnEnable() ");
    
    var camera_state = PluginAPIMgr.GetCameraState();
    
    if(camera_state == ENUM_CAM_STATE.CAM_STATE_DISCONNECTED || camera_state == ENUM_CAM_STATE.CAM_STATE_CONNECTING)
    {
        alert("SceneListMain.toggleCameraOffBtnEnable() Dim : true ->  camera_state : "+ camera_state );
    }
    else
    {
        alert("SceneListMain.toggleCameraOffBtnEnable() Dim :  false ");
        if(PluginAPIMgr.IsInCall()==1)
		{
			PluginAPIMgr.StartRecord();
		}
    }    
}*/


//to refresh in current page
SceneminiMainContact.prototype.Refresh = function(){

	if(this.Status == ENUM_SCENE_STATUS.ACTIVATED && this.IsShownObj == true){
				
		this.list.Refresh();
		if(this.list.NotifingLabel.GetShowState() == true) {
			$("#list_main_GoToSkype_btn").css('z-index', '5');
			this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_WELCOME_BTN_NORMAL);
			this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_WELCOME_BTN_NORMALFOCUS);
			this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"list_main_GoToSkype_normal_style");
			this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"list_main_GoToSkype_select_style");
			this.ListMainGoToSkypeBtn.SetText(TV_SID_GO_TO_SKYPE);
//			this.ListMainGoToSkypeBtn.EnableOnClick();
		}
		else {
			$("#list_main_GoToSkype_btn").css('z-index', '2');
			this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, "");
			this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, "");
			this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"");
			this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"");
			this.ListMainGoToSkypeBtn.SetText("");
			this.ListMainGoToSkypeBtn.blur();
//			this.ListMainGoToSkypeBtn.DisableOnClick();
		}
	} 

}

SceneminiMainContact.prototype.setDestroyFlag= function(destroy_flag){
     
	 if(destroy_flag ){
	 	this.Status = ENUM_SCENE_STATUS.DESTORYED;	
	 }
	 	 
}

SceneminiMainContact.prototype.CheckValidList = function(){
	var Num = this.list.GetTotalDataNum();
	alert("SceneminiMainContact.CheckValidList( "+Num+" )");	
	if( Num > 0){
		return true;
	}
	else {
		return false;
	}
}

//Initializ list
SceneminiMainContact.prototype.InitializeScene = function(){

	this.list.Initialize();	
	this.Status = ENUM_SCENE_STATUS.ACTIVATED;
	this.LiveCallMode = ProcMgr.GetIsInCall();	

}

SceneminiMainContact.prototype.GetState = function(){
	
	return this.Status;
}


SceneminiMainContact.prototype.Activation = function(){
	alert("SceneminiMainContact.Activation()");	
	
	if(this.Status > ENUM_SCENE_STATUS.CREATED){
		
		this.Status = ENUM_SCENE_STATUS.ACTIVATED;
		this.list.Refresh();				
	}
		
}

SceneminiMainContact.prototype.Deactivation = function(){
	alert("SceneminiMainContact.Deactivation()");	
	
	this.Status = ENUM_SCENE_STATUS.DEACTIVATED;
}

SceneminiMainContact.prototype.ProgressCallDuration = function(strTime){

	if(this.IsShownObj && this.LiveCallMode){		
		this.list.ProgressCallDuration(strTime);
	}
	
}

SceneminiMainContact.prototype.ShowLoading = function(){
	
	$("#"+ this.GIFLayer.Obj).css('display', 'block');
}

SceneminiMainContact.prototype.HideLoading = function(){
	
	$("#"+ this.GIFLayer.Obj).css('display', 'none');
}


SceneminiMainContact.prototype.ShowKeyHelpbar = function(){
	if(WIDGET.mouse==true){
		helpBarHandler.showHelpIcon('red',SID_LOGOUT);
		helpBarHandler.hideHelpIcon('green',"");
		helpBarHandler.hideHelpIcon('yellow',"");
		helpBarHandler.showHelpIcon('blue',TV_SID_CHANGE_VIEW);
		helpBarHandler.showHelpIcon('tools',sfLang.SID_TOOLS);
		helpBarHandler.showHelpIcon('return',SID_RETURN);
		
		helpBarHandler.setHelpIconClickEvent('help_red',function(){
			var Scene = $.sfScene.get({id:"miniMainContact", scope:WIDGET.id});
			Scene.handleKeyDown($.sfKey.RED);
		});
	}else{
		$("#HomeHelp").sfKeyHelp({
			'red' : SID_LOGOUT,
			'blue' : TV_SID_CHANGE_VIEW,
			'tools' : sfLang.SID_TOOLS,
			'return' : SID_RETURN
		});	
	}
}
SceneminiMainContact.prototype.ShowObj = function(){
	
	var IsInCall = ProcMgr.GetIsInCall();
			
	if(this.Status == ENUM_SCENE_STATUS.CREATED || this.Status == ENUM_SCENE_STATUS.DESTORYED || this.LiveCallMode != IsInCall){		
		
		this.list.Initialize();	
		this.Status = ENUM_SCENE_STATUS.ACTIVATED;
		this.LiveCallMode = IsInCall;
		
	}
	else{
		this.Activation();
	}
	
	this.update();
	this.list.Show();
	
	if(this.list.NotifingLabel.GetShowState() == true) {
		$("#list_main_GoToSkype_btn").css('z-index', '5');
		this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_WELCOME_BTN_NORMAL);
		this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_WELCOME_BTN_NORMALFOCUS);
		this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"list_main_GoToSkype_normal_style");
		this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"list_main_GoToSkype_select_style");
		this.ListMainGoToSkypeBtn.SetText(TV_SID_GO_TO_SKYPE);
//		this.ListMainGoToSkypeBtn.EnableOnClick();
	}
	else {
		$("#list_main_GoToSkype_btn").css('z-index', '2');
		this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, "");
		this.ListMainGoToSkypeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, "");
		this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"");
		this.ListMainGoToSkypeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"");
		this.ListMainGoToSkypeBtn.SetText("");
		this.ListMainGoToSkypeBtn.blur();
//		this.ListMainGoToSkypeBtn.DisableOnClick();
	}
	this.IsShownObj = true;

}

SceneminiMainContact.prototype.GetIsShownObj = function(){
	
	return this.IsShownObj;
}



SceneminiMainContact.prototype.RefreshForIndex = function(Index){
	
	this.Status = ENUM_SCENE_STATUS.ACTIVATED;
	
	var currentHighlight = this.ListMainContactView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.ListMainContactBtn:
		case this.ListMainSignOutBtn:
		case this.ListMainGoToSkypeBtn:
			this.highlight(this.list);
			break;
	}
	
	this.list.RefreshForIndex(Index);	
}


//move to main ... 
SceneminiMainContact.prototype.processLeftKey = function() {
	alert("SceneminiMainContact.processLeftKey() ");
	var currentHighlight = this.ListMainContactView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.ListMainSignOutBtn:
			this.highlight(this.ListMainContactBtn);
			break;
		default:
			/*$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).isFocused = false;
			$.sfScene.get("Home").prevService();*/
			$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).processLeftKey();
			break;
	}
}
SceneminiMainContact.prototype.processRightKey = function() {
	alert("SceneminiMainContact.processRightKey() ");
	var currentHighlight = this.ListMainContactView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.ListMainContactBtn:
			this.highlight(this.ListMainSignOutBtn);
			break;
		default:
			/*$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).isFocused = false;
			$.sfScene.get("Home").nextService();*/
			$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).processRightKey();
			break;
	}
}

SceneminiMainContact.prototype.processUpKey = function() {
	alert("SceneminiMainContact.processUpKey() ");
	var currentHighlight = this.ListMainContactView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.ListMainContactBtn:
		case this.ListMainSignOutBtn:
			this.processReturnKey();
			break;

		case this.ListMainGoToSkypeBtn:
			if( this.list.GetTotalDataNum() <= 0 )
				this.highlight(this.ListMainContactBtn);
			else
			this.highlight(this.list);
			break;

		default:
			if(this.list.GetCurIndex() == 0) {
				this.list.blur();
				this.highlight(this.ListMainContactBtn);
			}
			else
				this.list.KeyProcess($.sfKey.UP);
			break;
	}
}
SceneminiMainContact.prototype.processDownKey = function() {
	alert("SceneminiMainContact.processDownKey() ");

	var currentHighlight = this.ListMainContactView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.ListMainContactBtn:
		case this.ListMainSignOutBtn:
			if( this.list.GetTotalDataNum() <= 0 )
				this.highlight(this.ListMainGoToSkypeBtn);
			else
			this.highlight(this.list);
			break;

		default:
			if(this.list.NotifingLabel.GetShowState() == true)
				this.highlight(this.ListMainGoToSkypeBtn);
			else
			this.list.KeyProcess($.sfKey.DOWN);
			break;
	}
}

SceneminiMainContact.prototype.processEnterKey = function() {
	alert("SceneminiMainContact.processEnterKey() ");
	var currentHighlight = this.ListMainContactView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.ListMainContactBtn:
			$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).LC_addEvent("EV014", "SETSTATUS");
		
			this.list.miniLastHighlight = ENUM_SCENE_NAVIGATOR.CONTACT_BTN;
			StateMgr.Start_Mini_Status_Change();
			break;

		case this.ListMainSignOutBtn:
			$.sfScene.get({id:WIDGET.name, scope:WIDGET.id}).LC_addEvent("EV015", "SIGNOUT");
			
			this.list.miniLastHighlight = ENUM_SCENE_NAVIGATOR.SIGNOUT_BTN;
			StateMgr.Start_Signout_State();
			break;

		case this.ListMainGoToSkypeBtn:
			this.list.miniLastHighlight = ENUM_SCENE_NAVIGATOR.GOTO_SKYPE;
			this.ClickGoSkypeBtn();
			break;

		default:
			this.list.miniLastHighlight = ENUM_SCENE_NAVIGATOR.CONTACT_LIST;
			this.selectListItem();
			break;
	}
}

SceneminiMainContact.prototype.selectListItem = function(){
	 alert("SceneminiMainContact.selectListItem()");
	 
	 this.list.KeyProcess($.sfKey.ENTER);
	 
}

SceneminiMainContact.prototype.processReturnKey = function(){
	 alert("SceneminiMainContact.processReturnKey()");
	var obj = this.ListMainContactView.getCurrentHighlight();

	this.list.miniLastHighlight = ENUM_SCENE_NAVIGATOR.RETURN_TAB;
	this.blur();
     ProcMgr.returnTab();
}

SceneminiMainContact.prototype.processRedKey = function(){
    alert("SceneminiMainContact.processRedKey() ");
    
    StateMgr.Start_Signout_State();   
}


SceneminiMainContact.prototype.timerCallback=function()
{
	this.WheelOperation = false;
}

SceneminiMainContact.prototype.processMouseOver = function(obj) {
    alert("SceneminiMainContact.processMouseOver() ");
   var SNS_Scene = $.sfScene.get({id:WIDGET.name, scope:WIDGET.id});
   alert("tabFocus : "+SNS_Scene.tabFocus);
    if (SNS_Scene.tabFocus == true) {
       // SNS_Scene.tabFocus = false;
      //  utilitySet.changeTabBGStatus(WIDGET.id, 'focus', true);
        StateMgr.Focus_Current_State();
    }

    /*
    var currentHighlight = this.ListMainContactView.getCurrentHighlight();
        if(currentHighlight != obj) {*/
    
        this.highlight(obj);
    //}
}
SceneminiMainContact.prototype.processClickEvent = function(obj) {
	alert("SceneminiContactCallMenu.processClickEvent() ");
	var SNS_Scene = $.sfScene.get({id:WIDGET.name, scope:WIDGET.id});
	alert("tabFocus : "+SNS_Scene.tabFocus);
	if(SNS_Scene.tabFocus==true){
		SNS_Scene.tabFocus=false;
			utilitySet.changeTabBGStatus(WIDGET.id,'focus',true);
		}
	
	var currentHighlight = this.ListMainContactView.getCurrentHighlight();
	if(currentHighlight != obj) {
		this.highlight(obj);
	}

	this.processEnterKey();
}

SceneminiMainContact.prototype.ClickGoSkypeBtn=function()
{
    alert("SceneminiMainContact.ClickGoSkypeBtn() ");
	WndMgr.StartCallConfirmPopup(MINI_CALL_CONFIRM_POPUP.GO_TO_SKYPE);
}

