function SceneVideoCallNormal(options) {
	this.options = options;
    
    this.VideoCallNormalView =null;
    
    this.CallDurationTextNorLabel =null;
    this.CallDurationTimeNorLabel =null;
    this.CallQualityGaugeLabel=null;

    this.YourNameNorLabel=null;
    this.MyNameNorLabel=null;

    this.YourThumbnailNorLabel=null;
    this.MyThumbnailNorLabel=null;

    this.CallEndNorBtn=null;
    this.CameraOffBtn=null;
    this.MicVolumeBtn=null;
    this.HoldBtn=null;
    
    this.NormalHelpBar =null;
    
    this.HoldIconLabel = null;
	this.HoldAniLabel = null;

}

SceneVideoCallNormal.prototype.initialize = function () {
	alert("SceneVideoCallNormal.initialize()");
	// this function will be called only once when the scene manager show this scene first time
	// initialize the scene controls and styles, and initialize your variables here 
	// scene HTML and CSS will be loaded before this function is called
    
   this.create();
}

SceneVideoCallNormal.prototype.handleShow = function () {
	alert("SceneVideoCallNormal.handleShow()");
	// this function will be called when the scene manager show this scene 
	this.closeVideoRect();
    this.update();   

  	// window.addEventListener('click', $.sf.returnFocus); 
    
}

SceneVideoCallNormal.prototype.handleHide = function () {
	alert("SceneVideoCallNormal.handleHide()");
	// this function will be called when the scene manager hide this scene  

    this.highlight(null);
    
	// window.removeEventListener('click', $.sf.returnFocus);    
}

SceneVideoCallNormal.prototype.handleFocus = function () {
	alert("SceneVideoCallNormal.handleFocus()");
	// this function will be called when the scene manager focus this scene

    var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
    if(currentHighlight ==null)
    {
        this.highlight(this.CallEndNorBtn);
    }
    else
    {
        this.highlight(currentHighlight);
    }
}

SceneVideoCallNormal.prototype.handleBlur = function () {
	alert("SceneVideoCallNormal.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene
    
    var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
     if(currentHighlight !=null)
    {
        currentHighlight.blur();
    }
}

SceneVideoCallNormal.prototype.handleKeyDown = function (keyCode) {
	alert("SceneVideoCallNormal.handleKeyDown(" + keyCode + ")");
	// TODO : write an key event handler when this scene get focued
	PluginAPIMgr.PlayAudio(keyCode);
	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	switch (keyCode) {
		case sf.key.LEFT:
            this.processLeftKey();
			break;
		case sf.key.RIGHT:
           this.processRightKey();
			break;
		case sf.key.UP:
			
			break;
		case sf.key.DOWN:
			
			break;

		case sf.key.ENTER:
            this.processEnterKey();
			break;
        
        case sf.key.GREEN:
            this.processGreenKey();
			break;
        
         case sf.key.VOL_DOWN:
        case sf.key.PANEL_VOL_DOWN:
		case sf.key.VOL_UP:
        case sf.key.PANEL_VOL_UP:
             this.processVolumeKey();
             break;
             
        case sf.key.N1:
        case sf.key.N2:
        case sf.key.N3:
        case sf.key.N4:
        case sf.key.N5:
        case sf.key.N6:
        case sf.key.N7:
        case sf.key.N8:
        case sf.key.N9:
        case 35:
		case 650: 
        case sf.key.N0:
        case 259:
            ProcMgr.SendDTMF(keyCode);
            break;  
            
         case sf.key.RED:
            
			break;
			
		case sf.key.BLUE:
			this.processBlueKey();
			break;	
			
		case sf.key.YELLOW:

            break;		
         
		case sf.key.TOOLS:
			alert("KEY_TOOLS");
			this.processToolKey();
			break;
         
       case sf.key.RETURN:
           this.processReturnKey();
            sf.key.block(event);
            break;
            
       case sf.key.EXIT:
            this.processExitKey();
            sf.key.block(event);
			break;
            
        case 147:  //infolink
        case 261:  //contents
        case 115:  //wiselink
            ProcMgr.processInfolinkKey();
			break;

    		//Gesture recognition  >> Scroll
         case 40000002:
         case 40000003:
         case 40000004:
         case 40000005:
			break;
            
        default:
            ProcMgr.processBlockKey(keyCode);
            break;  
	}
}

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

SceneVideoCallNormal.prototype.create = function(){
    alert("SceneVideoCallNormal.create() ");
    this.VideoCallNormalView = new View("VideoCallNormal");
    if(WndMgr.Bg_VideoCallNOR != null)
    {
    	this.VideoCallNormalView.SetBgImage(WndMgr.Bg_VideoCallNOR.src);
    }
    else
    {
    	if(ProcMgr.isGenoaS == false)
    	{
    		this.VideoCallNormalView.SetBgImage(g_Image.IMAGE_VIDEO_CALL_NOR_VIEW_BG);
    	}
    	else
    	{
    		this.VideoCallNormalView.SetBgImage(g_Image.IMAGE_VIDEO_CALL_NOR_VIEW_BG_S);
    	}
    }

    this.CallDurationTextNorLabel = new Label(null,"call_duration_text_nor");
    this.CallDurationTextNorLabel.SetTextStyle("call_duration_nor_text_style");
    this.CallDurationTextNorLabel.SetText(IDWS_MOIP_SKYPE_CALL_DURATION);

    this.CallDurationTimeNorLabel = new Label(null,"call_duration_time_nor");
    this.CallDurationTimeNorLabel.SetTextStyle("call_duration_time_style");
    this.CallDurationTimeNorLabel.SetText("00:00:00");

    this.CallQualityGaugeLabel= new Label("call_quality_gauge_nor", null);
    this.CallQualityGaugeLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_QUALITY_GAUGE1);

    this.YourNameNorLabel = new Label(null,"your_name_nor");
    this.YourNameNorLabel.SetTextStyle("call_member_name_style");
    this.YourNameNorLabel.SetReverseDisable(true);

	if(ProcMgr.isGenoaS== false)
	{	
		this.MyNameNorLabel = new Label(null,"my_name_nor");
	}
	else
	{
		this.MyNameNorLabel = new Label(null,"my_name_nor_s");
	}
    
    this.MyNameNorLabel.SetTextStyle("call_member_name_style");
    this.MyNameNorLabel.SetReverseDisable(true);

    this.YourThumbnailNorLabel= new Label("your_thumbnail_nor", null);
    this.YourThumbnailNorLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_THUMBNAIL_NOR_L);
    this.YourThumbnailNorLabel.visibleObj();

	if(ProcMgr.isGenoaS== false)
	{
	    this.MyThumbnailNorLabel= new Label("my_thumbnail_nor", null);
    	this.MyThumbnailNorLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_THUMBNAIL_NOR_L);	
	}
	else
	{
		this.MyThumbnailNorLabel= new Label("my_thumbnail_nor_s", null);
    	this.MyThumbnailNorLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_THUMBNAIL_NOR_S);	
	}

    this.MyThumbnailNorLabel.visibleObj();

	var this_ = sf.scene.get("VideoCallNormal");
	var clickCF =  function(obj){this_.processClickEvent(obj);};
    
    this.CallEndNorBtn = new Button();
    this.CallEndNorBtn.SetImageObjId("video_call_end_nor_btn");
    this.CallEndNorBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_VIDEO_CALL_END_NOR_BTN_NORMAL);
    this.CallEndNorBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_VIDEO_CALL_END_NOR_BTN_NORMALFOCUS);
	this.CallEndNorBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_VOICE_CALL_TO_VIDEO_CALL_BTN_DIM);	
    this.CallEndNorBtn.SetTextObjId("video_call_end_nor_btn_text");
    this.CallEndNorBtn.SetText(TV_SID_END_CALL);
    this.CallEndNorBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"common_btn_text_f17_normal_style");
	this.CallEndNorBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"common_btn_text_f17_highlight_style");
	this.CallEndNorBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE,"video_call_button_text_dim_style");
    this.CallEndNorBtn.SetOnClickCallbackFunc(clickCF);
    this.CallEndNorBtn.SetOnRightClickCallbackFunc(clickCF);
    
    
    this.CameraOffBtn = new Button();
    this.CameraOffBtn.SetImageObjId("video_call_camera_off_btn");
    this.CameraOffBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_NORMAL);
    this.CameraOffBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_NORMALFOCUS);
	this.CameraOffBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_DIM);	
    this.CameraOffBtn.SetTextObjId("video_call_camera_off_btn_text");
    this.CameraOffBtn.SetText(COM_IDS_STR_STOP_VIDEO_KR_OFF_CAMERA);
    this.CameraOffBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"common_btn_text_f17_normal_style");
	this.CameraOffBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"common_btn_text_f17_highlight_style");
    this.CameraOffBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE,"common_btn_text_f17_dim_style");
    this.CameraOffBtn.SetOnClickCallbackFunc(clickCF);
    this.CameraOffBtn.SetOnRightClickCallbackFunc(clickCF); 

    this.MicVolumeBtn = new Button();
    this.MicVolumeBtn.SetImageObjId("video_call_mic_volume_btn");
    this.MicVolumeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_NORMAL);
    this.MicVolumeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_NORMALFOCUS);
	this.MicVolumeBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_DIM);
    this.MicVolumeBtn.SetTextObjId("video_call_mic_volume_btn_text");
    this.MicVolumeBtn.SetText(TV_SID_MIC_VOL);
    this.MicVolumeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"common_btn_text_f17_normal_style");
	this.MicVolumeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"common_btn_text_f17_highlight_style");
    this.MicVolumeBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE,"common_btn_text_f17_dim_style");
    this.MicVolumeBtn.SetOnClickCallbackFunc(clickCF);
    this.MicVolumeBtn.SetOnRightClickCallbackFunc(clickCF);  

    this.HoldBtn = new Button();
    this.HoldBtn.SetImageObjId("video_call_hold_btn");
    this.HoldBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_NORMAL);
    this.HoldBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_NORMALFOCUS);
	this.HoldBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_VIDEO_CALL_BTN_DIM);		
    this.HoldBtn.SetTextObjId("video_call_hold_btn_text");
    this.HoldBtn.SetText(IDWS_MOIP_SKYPE_HOLD);
    this.HoldBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"common_btn_text_f17_normal_style");
	this.HoldBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"common_btn_text_f17_highlight_style");
	this.HoldBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE,"common_btn_text_f17_dim_style");
    this.HoldBtn.SetOnClickCallbackFunc(clickCF);
    this.HoldBtn.SetOnRightClickCallbackFunc(clickCF);  
        
    this.HoldIconLabel= new Label("video_call_hold_icon", null);
    this.HoldIconLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_HOLD_ICON);
           	
	this.HoldAniLabel= new Label("video_call_hold_animation", null);
	this.HoldAniLabel.AppendFgImage("video_call_hold_animation_icon","0px","0px","108px","108px");
    this.HoldAniLabel.SetFgImage(WndMgr.Bg_LoadingGIF.src);

	this.NormalHelpBar = new HelpBar(HelpBarIndex.VIDEO_CALL_NORMAL_VIEW, "SceneVideoCallNormal");
	this.NormalHelpBar.SetOnClickCallbackFunc(1, function(){this_.processGreenKey();});
	this.NormalHelpBar.SetOnClickCallbackFunc(2, function(){this_.processBlueKey();});
	this.NormalHelpBar.SetOnClickCallbackFunc(3, function(){this_.processToolKey();});
	this.NormalHelpBar.SetOnClickCallbackFunc(4, function(){this_.processReturnKey();});

	this.CallEndNorBtn.registHelpBar( this.NormalHelpBar);
	this.CameraOffBtn.registHelpBar( this.NormalHelpBar);
	this.MicVolumeBtn.registHelpBar( this.NormalHelpBar);
	this.HoldBtn.registHelpBar( this.NormalHelpBar);    
}

SceneVideoCallNormal.prototype.update=function()
{
    this.YourNameNorLabel.SetText(PluginAPIMgr.GetCallMemberDisplayName());
    this.MyNameNorLabel.SetText(PluginAPIMgr.GetMyDisplayName());
	this.UpdateCallQuality();
	
    this.toggleCameraOffBtnEnable();
    this.toggleMyVideo();
    this.toggleYourVideo();	
    
      if(g_Data.GetCallLocalHold() == true)
     {
        this.LocalHold();
     }
     else if(g_Data.GetCallRemoteHold() == true)
     {
        this.RemoteHold();
     }
     else
     {
	 	if(ProcMgr.callHoldTimer == true)
		{
			this.StartLocalHoldWait();
		}
		else
		{
			this.StopLocalHoldWait();
		}
	
        this.Resume();
     }       
}

SceneVideoCallNormal.prototype.updateCallDuration = function(time)
{
     this.CallDurationTimeNorLabel.SetText(time);
}

SceneVideoCallNormal.prototype.UpdateCallQuality= function()
{
	var level = g_Data.GetCallQualityGauge();
    alert("SceneVideoCallNormal.UpdateCallQuality() " + level);
	
    if(level ==1)
    {
        this.CallQualityGaugeLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_QUALITY_GAUGE1);
    }
    
    if(level ==2)
    {
        this.CallQualityGaugeLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_QUALITY_GAUGE2);
    }
    
    if(level ==3)
    {
        this.CallQualityGaugeLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_QUALITY_GAUGE3);
    }
    
    if(level ==4)
    {
        this.CallQualityGaugeLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_QUALITY_GAUGE4);
    }
    
    if(level ==5)
    {
        this.CallQualityGaugeLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_VIEW_QUALITY_GAUGE5);
    }
    
}

SceneVideoCallNormal.prototype.updateCallMemberInfo = function()
{
	this.YourNameNorLabel.SetText(PluginAPIMgr.GetCallMemberDisplayName());
}

SceneVideoCallNormal.prototype.toggleCameraOffBtnEnable=function()
{
    alert("SceneVideoCallNormal.toggleCameraOffBtnEnable() ");
    
    var camera_state = PluginAPIMgr.GetCameraState();
    
    if(camera_state == ENUM_CAM_STATE.CAM_STATE_DISCONNECTED || camera_state == ENUM_CAM_STATE.CAM_STATE_CONNECTING)
    {
        alert("SceneVideoCallNormal.toggleCameraOffBtnEnable() Dim : true ->  camera_state : "+ camera_state );

         var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
        if(currentHighlight ==  this.CameraOffBtn)
        {
            if(this.CameraOffBtn.flag_highlight == true)
            {
                this.highlight(this.CallEndNorBtn);
            }
            else
            {
                this.highlight(null);
            }
        }
        
        this.CameraOffBtn.SetFlagDim(true);
        
        if(currentHighlight ==  this.MicVolumeBtn)
        {
             if(this.MicVolumeBtn.flag_highlight == true)
            {
                this.highlight(this.CallEndNorBtn);
            }
            else
            {
                this.highlight(null);
            }
        }
        this.MicVolumeBtn.SetFlagDim(true);
    }
    else
    {
        alert("SceneVideoCallNormal.toggleCameraOffBtnEnable() Dim :  false ");
        if(PluginAPIMgr.IsInCall()==1)
		{
			PluginAPIMgr.StartRecord();
		}
		
		if(this.CameraOffBtn.GetFlagDim()==true)
		{
			if(g_Data.GetCallLocalHold() !=true && g_Data.GetCallRemoteHold() !=true)
			{
				this.CameraOffBtn.SetFlagDim(false);
			}				
		}
		
		if(this.MicVolumeBtn.GetFlagDim() == true)
		{
			this.MicVolumeBtn.SetFlagDim(false);
		}
    }    
}

SceneVideoCallNormal.prototype.toggleYourVideo = function()
{
    var is_receiving_video =    ProcMgr.IsReceivingVideo(); 
    
    if(is_receiving_video == true)
    {
        this.YourThumbnailNorLabel.hiddenObj();
    }
    else
    {
        this.YourThumbnailNorLabel.visibleObj();
    }
}

SceneVideoCallNormal.prototype.toggleMyVideo = function()
{
    var is_sending_video = PluginAPIMgr.IsSendingVideo(); 
    
    if(is_sending_video == 1)
    {
        this.CameraOffBtn.SetText(COM_IDS_STR_STOP_VIDEO_KR_OFF_CAMERA);
        this.MyThumbnailNorLabel.hiddenObj();
    }
    else
    {
        this.CameraOffBtn.SetText(TV_SID_START_VIDEO_KR_ON_CAMERA);
        this.MyThumbnailNorLabel.visibleObj();
    }
	
	if(this.CameraOffBtn.flag_highlight == true)
	{
		this.CameraOffBtn.changeHelpBar( this.NormalHelpBar);
	}
		
}

SceneVideoCallNormal.prototype.toggleCameraOnOff= function()
{
    var is_sending_video = PluginAPIMgr.IsSendingVideo(); 
    
    if(is_sending_video == 1)
    {
        ProcMgr.StopSendVideo();
    }
    else
    {       
        ProcMgr.StartSendVideo();
    }
}

SceneVideoCallNormal.prototype.closeVideoRect= function()
{
    $("#VideoCallNormal").css('background-color' , 'rgb(0,0,0)');
     this.YourThumbnailNorLabel.visibleObj();
     this.MyThumbnailNorLabel.visibleObj();
}

SceneVideoCallNormal.prototype.openVideoRect= function()
{
    $("#VideoCallNormal").css('background-color' , 'transparent');
}


SceneVideoCallNormal.prototype.highlight=function(obj)
{
    this.VideoCallNormalView.setCurrenHighlight(obj);
}

SceneVideoCallNormal.prototype.processLeftKey=function()
{
    alert("SceneVideoCallNormal.processLeftKey() ");
    var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
    
    switch(currentHighlight)
    {
        case this.CallEndNorBtn:
            this.highlight(this.HoldBtn);
            break;
         case this.CameraOffBtn:
            this.highlight(this.CallEndNorBtn);
            break;
        case this.MicVolumeBtn:        
               if( this.CameraOffBtn.GetFlagDim() ==true)
             {
                this.highlight(this.CallEndNorBtn);
             }
             else
             {
               this.highlight(this.CameraOffBtn);
             }
            break; 

         case this.HoldBtn:

		 	if( this.MicVolumeBtn.GetFlagDim()==true)
			{
				this.highlight(this.CallEndNorBtn);
			}
			else
			{
				this.highlight(this.MicVolumeBtn);
			}                
            break;                       
    }
}

SceneVideoCallNormal.prototype.processRightKey=function()
{
    alert("SceneVideoCallNormal.processRightKey() ");
    var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
    
    switch(currentHighlight)
    {
        case this.CallEndNorBtn:
             if( this.CameraOffBtn.GetFlagDim() ==true )
             {
			 	if(this.MicVolumeBtn.GetFlagDim() ==true)
				{
				 	this.highlight(this.HoldBtn);	
				}
				else
				{
					this.highlight(this.MicVolumeBtn);
				}            
             }
             else
             {
               this.highlight(this.CameraOffBtn);
             }
            break;
         case this.CameraOffBtn:
            this.highlight(this.MicVolumeBtn);
            break;
        case this.MicVolumeBtn:
            this.highlight(this.HoldBtn);
            break; 

         case this.HoldBtn:
            this.highlight(this.CallEndNorBtn);
            break;                       
    }
}

SceneVideoCallNormal.prototype.processEnterKey=function()
{
    alert("SceneVideoCallNormal.processEnterKey() ");
    var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
    
    switch(currentHighlight)
    {
        case this.CallEndNorBtn:
            this.closeVideoRect();
            ProcMgr.DisconnectCall();
            break;
			
         case this.CameraOffBtn:
           this.toggleCameraOnOff();
            break;
			
        case this.MicVolumeBtn:
             StateMgr.Start_Volume_Mic_State();
            break;
			 	
         case this.HoldBtn:
             ProcMgr.ToggleLocalHold(); 
            break;                      
    }
}

/*
SceneVideoCallNormal.prototype.ProcessEndCallNorBtn = function()
{
    alert("SceneVideoCallNormal.ProcessEndCallNorBtn() ");
    
	var this_ = sf.scene.get("VideoCallNormal");
	
	this_.highlight(this_.CallEndNorBtn);
    this_.closeVideoRect();
    ProcMgr.DisconnectCall();
}

SceneVideoCallNormal.prototype.ProcessCameraOffBtn = function()
{
    alert("SceneVideoCallNormal.ProcessCameraOffBtn() ");
    
	var this_ = sf.scene.get("VideoCallNormal");
	
	this_.highlight(this_.CameraOffBtn);
    this_.toggleCameraOnOff();
}

SceneVideoCallNormal.prototype.ProcessMicVolumeBtn = function()
{
    alert("SceneVideoCallNormal.ProcessMicVolumeBtn() ");
    
	var this_ = sf.scene.get("VideoCallNormal");
	
	this_.highlight(this_.MicVolumeBtn);
    StateMgr.Start_Volume_Mic_State();
}

SceneVideoCallNormal.prototype.ProcessHoldBtn = function()
{
    alert("SceneVideoCallNormal.ProcessHoldBtn() ");
    
	var this_ = sf.scene.get("VideoCallNormal");
	
	this_.highlight(this_.HoldBtn);
    ProcMgr.ToggleLocalHold();
}
*/

SceneVideoCallNormal.prototype.processGreenKey=function()
{
    alert("SceneVideoCallNormal.processGreenKey() ");

	this.closeVideoRect();
    $("#VideoCallNormal").css('background-color' , 'rgb(0,0,0)');
 
	WndMgr.ChangeVideoCallScreen(); 
}

SceneVideoCallNormal.prototype.processVolumeKey=function()
{
    alert("SceneVideoCallNormal.processVolumeKey() ");

    StateMgr.Start_Volume_Speaker_State();
}

SceneVideoCallNormal.prototype.processReturnKey = function(){
    alert("SceneVideoCallNormal.processReturnKey() ");
	
    if(ProcMgr.isGenoaS==false)
	{
		StateMgr.Start_Main_State();
	}
	else
	{
		StateMgr.Start_Call_Switch_State(); 
	}      
}

SceneVideoCallNormal.prototype.processExitKey = function(){
    alert("SceneVideoCallNormal.processExitKey() ");
   
   StateMgr.Start_Exit_State(false);
}

SceneVideoCallNormal.prototype.processBlueKey = function(){
    alert("SceneVideoCallNormal.processBlueKey() ");

	if(ProcMgr.isGenoaS==false)
	{
		StateMgr.Start_Live_Contact_List_State();
	}	
}

SceneVideoCallNormal.prototype.processToolKey=function()
{
    alert("SceneVideoCallNormal.processToolKey() ");
	
	StateMgr.Start_List_Tools_State(TOOL_MENU_LIST_TYPE.VIDEO_CALL);    
}


SceneVideoCallNormal.prototype.StartLocalHoldWait=function()
{
	alert("SceneVideoCallNormal.StartLocalHoldWait() "); 
	this.HoldAniLabel.visibleObj();
	
	var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
	if(currentHighlight ==  this.CameraOffBtn)
    {
        if(this.CameraOffBtn.flag_highlight == true)
        {
            this.highlight(this.CallEndNorBtn);
        }
        else
        {
            this.highlight(null);
        }
    }
	this.CameraOffBtn.SetFlagDim(true);  
}

SceneVideoCallNormal.prototype.StopLocalHoldWait=function()
{
	alert("SceneVideoCallNormal.StopLocalHoldWait() "); 
	this.HoldAniLabel.hiddenObj();
}

SceneVideoCallNormal.prototype.LocalHold=function()
{
    alert("SceneVideoCallNormal.LocalHold() "); 
	this.StopLocalHoldWait();  
    this.HoldIconLabel.visibleObj();
    this.HoldBtn.SetText(SID_RESUME);
    this.CallDurationTextNorLabel.SetText(IDWS_MOIP_CALL_ON_HOLD);
	
	var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
	if(currentHighlight ==  this.CameraOffBtn)
    {
        if(this.CameraOffBtn.flag_highlight == true)
        {
            this.highlight(this.CallEndNorBtn);
        }
        else
        {
            this.highlight(null);
        }
    }
	this.CameraOffBtn.SetFlagDim(true);    
}

SceneVideoCallNormal.prototype.RemoteHold=function()
{
    alert("SceneVideoCallNormal.RemoteHold() ");
	this.StopLocalHoldWait();  
    this.HoldIconLabel.visibleObj();
    this.HoldBtn.SetText(IDWS_MOIP_SKYPE_HOLD);
    this.CallDurationTextNorLabel.SetText(TV_SID_YOU_ARE_ON_HOLD); 
	
	var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
    if(currentHighlight ==  this.CameraOffBtn)
    {
        if(this.CameraOffBtn.flag_highlight == true)
        {
            this.highlight(this.CallEndNorBtn);
        }
        else
        {
            this.highlight(null);
        }
    }
    
    this.CameraOffBtn.SetFlagDim(true);
}

SceneVideoCallNormal.prototype.Resume=function()
{
    alert("SceneVideoCallNormal.Resume() ");  
    this.HoldIconLabel.hiddenObj();
    this.HoldBtn.SetText(IDWS_MOIP_SKYPE_HOLD);
    this.CallDurationTextNorLabel.SetText(IDWS_MOIP_SKYPE_CALL_DURATION); 
	
	var camera_state = PluginAPIMgr.GetCameraState();
    if(camera_state != ENUM_CAM_STATE.CAM_STATE_DISCONNECTED && camera_state != ENUM_CAM_STATE.CAM_STATE_CONNECTING)
	{
		this.CameraOffBtn.SetFlagDim(false);
	}
}


SceneVideoCallNormal.prototype.processClickEvent = function(obj){
	alert("SceneVideoCallNormal.processClickEvent() ");
	
	var currentHighlight =  this.VideoCallNormalView.getCurrentHighlight();
    if(currentHighlight != obj)
    {
    	this.highlight(obj);
    }
	
	if(event.button==2)
	{
		alert("SceneVideoCallNormal.processClickEvent() -> right button ");
		this.processToolKey();
	}
	else
	{
		alert("SceneVideoCallNormal.processClickEvent() -> left button ");
		this.processEnterKey();
	}
}

