function SceneSkypeOutCall(options) {
	this.options = options;
    
    this.SkypeOutCallView =null;
    
    this.LogoLabel=null;
    
    this.CallDurationBgLabel =null;
    this.CallDurationTextLabel =null;
    this.CallDurationTimeLabel =null;

    this.YourPhoneNumberLabel=null;

    this.HoldIconLabel = null;
    
    this.MyCreditBgLabel=null;
    this.MyCreditIcon=null;
    this.MyCreditText=null;
    
    this.YourThumbnailLabel=null;
    this.MyThumbnailLabel=null;

    this.CallEndBtn=null;
    this.TVModeBtn=null;
    this.MicOnBtn=null;
    this.MicOffBtn=null;
    //this.ShowDialBtn=null;

    this.Number1Btn=null;
    this.Number2Btn=null;
    this.Number3Btn=null;
    this.Number4Btn=null;
    this.Number5Btn=null;
    this.Number6Btn=null;
    this.Number7Btn=null;
    this.Number8Btn=null;
    this.Number9Btn=null;
    this.Number0Btn=null;
    this.StarBtn=null;
    this.SharpBtn=null;

    this.NumBtnList = new Array(12);
        
	this.flag_press_DTMF = false;
	this.current_DTMF_key = -1;
	this.flag_camera_unplugged = false;
	
	this.flag_selected_number_btn = false;
	this.flag_select_focus_state = false;
	this.currentSelectedObj = null;

	this.TooltipTimer = null;
	this.flag_shown_tooltip = false;	
}

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

SceneSkypeOutCall.prototype.handleShow = function () {
	alert("SceneSkypeOutCall.handleShow()");
	
    this.update();
   
}

SceneSkypeOutCall.prototype.handleHide = function () {
	alert("SceneSkypeOutCall.handleHide()");
    
	this.updateCallDuration(' ');    
	this.highlight(null);

	if(this.TooltipTimer)
	{
		clearTimeout(this.TooltipTimer);
		$('#skype_out_call_btn_tooltip').sfTooltip('hide');
		this.flag_shown_tooltip = false;		
	}		
	
}

SceneSkypeOutCall.prototype.handleFocus = function()
{
	alert("SceneSkypeOutCall.handleFocus()");
  
    var currentHighlight =  this.SkypeOutCallView.getCurrentHighlight();
    if(currentHighlight == null)
    {
        this.highlight(this.CallEndBtn);
    }
    else
    {
        this.highlight(currentHighlight);
    }

	var this_ = sf.scene.get("SkypeOutCall");
	var returnCF =  function(){this_.processReturnKey();};
	WndMgr.SetReturnIconClickCallback(returnCF);      
    
}

SceneSkypeOutCall.prototype.handleBlur = function()
{
	alert("SceneSkypeOutCall.handleBlur()");

    var currentHighlight =  this.SkypeOutCallView.getCurrentHighlight();
     if(currentHighlight != null)
    {
        currentHighlight.blur();
    }
    
	WndMgr.SetReturnIconClickCallback(null);    
}

SceneSkypeOutCall.prototype.handleKeyDown = function (keyCode) {
	alert("SceneSkypeOutCall.handleKeyDown(" + keyCode + ")");
	
	if(this.flag_press_DTMF == true)
	{
		alert('flag_press_DTMF is true!!!!!');
		return;
	}
	
	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.DOWN:
            this.processDownKey();
			break;
			
		case sf.key.UP:
           this.processUpKey();
			break;

			
		case sf.key.ENTER:
            this.processEnterKey();
			break;

		case sf.key.RETURN:
			this.processReturnKey();
		    sf.key.preventDefault();
			break;		
		
		case sf.key.EXIT:        
			this.processExitKey();
		    sf.key.preventDefault();
			break;
            				            
        case sf.key.N1:
        	this.processDTMF(0);
            break;        
        case sf.key.N2:
        	this.processDTMF(1);
            break;        
        case sf.key.N3:
        	this.processDTMF(2);
            break;        
        case sf.key.N4:
        	this.processDTMF(3);
            break;        
        case sf.key.N5:
        	this.processDTMF(4);
            break;        
        case sf.key.N6:
        	this.processDTMF(5);
            break;        
        case sf.key.N7:
        	this.processDTMF(6);
            break;        
        case sf.key.N8:
        	this.processDTMF(7);
            break;        
        case sf.key.N9:
        	this.processDTMF(8);
            break;        
        case sf.key.N0:
        	this.processDTMF(10);
            break;            
        case 35:
		case 650: 			//ttx        
        	this.processDTMF(9);
            break;        
        case 259:			//pre
        	this.processDTMF(11);
            break;
            
        case 147:  //infolink
        case 261:  //contents
        case 115:  //wiselink
            ProcMgr.processInfolinkKey();
			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.MUTE:
        	this.processMuteKey();
            break;
            
        default:
            ProcMgr.processBlockKey(keyCode);
            break;  
        
	}
}

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

SceneSkypeOutCall.prototype.create = function(){
    alert("SceneSkypeOutCall.create() ");
    this.SkypeOutCallView = new View("SkypeOutCall");
    this.SkypeOutCallView.SetBgImage(g_Image.IMAGE_TEST_VIEW_BG);

    this.LogoLabel= new Label("skype_out_call_logo", null);
    this.LogoLabel.SetBgImage(g_Image.IMAGE_CALL_SKYPE_LOGO);

    this.CallDurationBgLabel = new Label("skype_out_call_duration_bg",null);
	this.CallDurationBgLabel.SetBgImage(g_Image.IMAGE_CALL_DURATION_BG);

	this.CallDurationTextLabel = new Label(null,"skype_out_call_duration_text");	
	this.CallDurationTextLabel.SetText(IDWS_MOIP_SKYPE_CALL_DURATION); 
	
    this.CallDurationTimeLabel = new Label(null,"skype_out_call_duration_time");

	var CurLangID = ResMgr.GetCurLanguage();
	if(CurLangID == ENUM_TV_LANGUAGE.VIE || CurLangID == ENUM_TV_LANGUAGE.IND || CurLangID == ENUM_TV_LANGUAGE.KAZ || CurLangID == ENUM_TV_LANGUAGE.LIT ||
		CurLangID == ENUM_TV_LANGUAGE.MKD || CurLangID == ENUM_TV_LANGUAGE.MAY || CurLangID == ENUM_TV_LANGUAGE.POL || CurLangID == ENUM_TV_LANGUAGE.ALB ||
		CurLangID == ENUM_TV_LANGUAGE.TAM || CurLangID == ENUM_TV_LANGUAGE.XHO || CurLangID == ENUM_TV_LANGUAGE.ZUL)
	{
		$('#skype_out_call_duration_text').css('left','18px');
		$('#skype_out_call_duration_text').css('width','220px');
		
		$('#skype_out_call_duration_time').css('left','210px');
	}

    this.MyCreditBgLabel = new Label("skype_out_call_my_credit",null);
	this.MyCreditBgLabel.SetBgImage(g_Image.IMAGE_SKYPE_CREDIT_BG);
    
    this.MyCreditIcon = new Label("skype_out_call_my_credit_icon",null);    
    this.MyCreditIcon.SetBgImage(g_Image.IMAGE_SKYPE_CREDIT_ICON);
    
    this.MyCreditText = new Label(null,"skype_out_call_my_credit_text"); 
    this.MyCreditText.SetReverseDisable(true);

    this.YourPhoneNumberLabel = new Label(null,"skype_out_call_your_phone_number");
    this.YourPhoneNumberLabel.SetReverseDisable(true);

    this.HoldIconLabel = new Label("skype_out_call_hold_icon", null);
    this.HoldIconLabel.SetBgImage(g_Image.IMAGE_VIDEO_CALL_HOLD_ICON);

    var this_ = sf.scene.get("SkypeOutCall");
	var clickCF =  function(obj){this_.processClickEvent(obj);};

    this.TVModeBtn = new Button();
    this.TVModeBtn.SetImageObjId("skype_out_call_tv_mode_btn");
    this.TVModeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_CALL_TV_MODE_BTN_NORMAL);
    this.TVModeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_CALL_TV_MODE_BTN_NORMALFOCUS);	
  	this.TVModeBtn.SetOnClickCallbackFunc(clickCF);
    $('#skype_out_call_tv_mode_btn').bind('mouseover',function(){this_.processTVModeBtnOver();});
    	  	
	this.MicOnBtn = new Button();
    this.MicOnBtn.SetImageObjId("skype_out_call_mic_on_btn");
    this.MicOnBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_CALL_MIC_BTN_NORMAL);
    this.MicOnBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_CALL_MIC_BTN_NORMALFOCUS);
	this.MicOnBtn.SetOnClickCallbackFunc(clickCF);
    $('#skype_out_call_mic_on_btn').bind('mouseover',function(){this_.processMicOnBtnOver();});
    
	this.MicOffBtn = new Button();
    this.MicOffBtn.SetImageObjId("skype_out_call_mic_off_btn");
    this.MicOffBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_CALL_MIC_BLCOK_BTN_NORMAL);
    this.MicOffBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_CALL_MIC_BLCOK_BTN_NORMALFOCUS);
	this.MicOffBtn.SetOnClickCallbackFunc(clickCF);
    $('#skype_out_call_mic_off_btn').bind('mouseover',function(){this_.processMicOffBtnOver();});
    	
    this.CallEndBtn = new Button();
    this.CallEndBtn.SetImageObjId("skype_out_call_end_btn");
    this.CallEndBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_CALL_END_BTN_NORMAL);
    this.CallEndBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_CALL_END_BTN_NORMALFOCUS);	
	this.CallEndBtn.SetOnClickCallbackFunc(clickCF);	
	$('#skype_out_call_end_btn').bind('mouseover',function(){this_.processCallEndBtnOver();});
		    
/////Dial pad /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    
    this.Number1Btn = new Button();
    this.Number1Btn.SetImageObjId("skype_out_call_with_dial_number_1_btn");
    this.Number1Btn.SetTextObjId("skype_out_call_with_dial_number_1_btn_text");  
    this.Number1Btn.SetText("1");
    	
    this.Number2Btn = new Button();
    this.Number2Btn.SetImageObjId("skype_out_call_with_dial_number_2_btn");
    this.Number2Btn.SetTextObjId("skype_out_call_with_dial_number_2_btn_text");
    this.Number2Btn.SetText("2");

    this.Number3Btn = new Button();
    this.Number3Btn.SetImageObjId("skype_out_call_with_dial_number_3_btn");
    this.Number3Btn.SetTextObjId("skype_out_call_with_dial_number_3_btn_text");
    this.Number3Btn.SetText("3");    
    
    this.Number4Btn = new Button();
    this.Number4Btn.SetImageObjId("skype_out_call_with_dial_number_4_btn");
    this.Number4Btn.SetTextObjId("skype_out_call_with_dial_number_4_btn_text");
    this.Number4Btn.SetText("4"); 

    this.Number5Btn = new Button();
    this.Number5Btn.SetImageObjId("skype_out_call_with_dial_number_5_btn");
    this.Number5Btn.SetTextObjId("skype_out_call_with_dial_number_5_btn_text");
    this.Number5Btn.SetText("5");     

    this.Number6Btn = new Button();
    this.Number6Btn.SetImageObjId("skype_out_call_with_dial_number_6_btn");
    this.Number6Btn.SetTextObjId("skype_out_call_with_dial_number_6_btn_text");
    this.Number6Btn.SetText("6");

    this.Number7Btn = new Button();
    this.Number7Btn.SetImageObjId("skype_out_call_with_dial_number_7_btn");
    this.Number7Btn.SetTextObjId("skype_out_call_with_dial_number_7_btn_text");
    this.Number7Btn.SetText("7");

    this.Number8Btn = new Button();
    this.Number8Btn.SetImageObjId("skype_out_call_with_dial_number_8_btn");
    this.Number8Btn.SetTextObjId("skype_out_call_with_dial_number_8_btn_text");
    this.Number8Btn.SetText("8");

    this.Number9Btn = new Button();
    this.Number9Btn.SetImageObjId("skype_out_call_with_dial_number_9_btn");
    this.Number9Btn.SetTextObjId("skype_out_call_with_dial_number_9_btn_text");
    this.Number9Btn.SetText("9"); 

    this.StarBtn = new Button();
    this.StarBtn.SetImageObjId("skype_out_call_with_dial_star_btn");	
    this.StarBtn.SetTextObjId("skype_out_call_with_dial_star_btn_text");
    this.StarBtn.SetText("*");

    this.Number0Btn = new Button();
    this.Number0Btn.SetImageObjId("skype_out_call_with_dial_number_0_btn");
    this.Number0Btn.SetTextObjId("skype_out_call_with_dial_number_0_btn_text");
    this.Number0Btn.SetText("0");

    this.SharpBtn = new Button();
    this.SharpBtn.SetImageObjId("skype_out_call_with_dial_sharp_btn");
    this.SharpBtn.SetTextObjId("skype_out_call_with_dial_sharp_btn_text");
    this.SharpBtn.SetText("#");

    var a=0;
     for(a=0; a<this.NumBtnList.length; a++)
     {
         this.NumBtnList[a]=new Object();
     }
     
     this.NumBtnList[0].obj =  this.Number1Btn;
     this.NumBtnList[1].obj =  this.Number2Btn;
     this.NumBtnList[2].obj =  this.Number3Btn;
     this.NumBtnList[3].obj =  this.Number4Btn;
     this.NumBtnList[4].obj =  this.Number5Btn;
     this.NumBtnList[5].obj =  this.Number6Btn;
     this.NumBtnList[6].obj =  this.Number7Btn;
     this.NumBtnList[7].obj =  this.Number8Btn;
     this.NumBtnList[8].obj =  this.Number9Btn;
     this.NumBtnList[9].obj =  this.StarBtn;
     this.NumBtnList[10].obj =  this.Number0Btn;
     this.NumBtnList[11].obj =  this.SharpBtn;
    
     for(a=0; a<this.NumBtnList.length; a++)
     {
         this.NumBtnList[a].obj.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_SKYPE_OUT_CALL_NUMBER_KEY_BTN_NORMAL);
         this.NumBtnList[a].obj.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_SKYPE_OUT_CALL_NUMBER_KEY_BTN_NORMALFOCUS);
         this.NumBtnList[a].obj.SetBgImage(BtnImgIndex.BTN_SELECTED_IMG, g_Image.IMAGE_SKYPE_OUT_CALL_NUMBER_KEY_BTN_SELECTED);
         this.NumBtnList[a].obj.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"skype_out_dial_number_normal_style");
         this.NumBtnList[a].obj.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"skype_out_dial_number_focus_style");
         this.NumBtnList[a].obj.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_SELECTED_STYLE,"skype_out_dial_number_select_style");
		 this.NumBtnList[a].obj.SetOnClickCallbackFunc(clickCF);
     }

	$('#skype_out_call_btn_tooltip').sfTooltip({
		text : TV_SID_END_CALL,
		orientation : 'down'
	});
     
}

SceneSkypeOutCall.prototype.update = function()
{
	var call_member_display_name =  PluginAPIMgr.GetCallMemberDisplayName();
	var call_member_id = PluginAPIMgr.GetCallMemberID() ;
	
	this.YourPhoneNumberLabel.SetText(call_member_id);
	this.CallDurationTimeLabel.SetText("00:00:00");
	
	this.MyCreditText.SetText(PluginAPIMgr.GetMyCredit());
	
	this.updateCallDuration(g_Data.GetCallDuration());
     
	this.toggleMicVolumeBtnEnable();
     
}

 SceneSkypeOutCall.prototype.updateCallDuration = function(time)
{
     this.CallDurationTimeLabel.SetText(time);
}

 SceneSkypeOutCall.prototype.updateCredit = function()
{
     this.MyCreditText.SetText(PluginAPIMgr.GetMyCredit());
}

SceneSkypeOutCall.prototype.toggleMicVolumeBtnEnable=function()
{
    alert("SceneSkypeOutCall.toggleMicVolumeBtnEnable() ");

	this.getCameraState();

	var currentHighlight =  this.SkypeOutCallView.getCurrentHighlight();
	
	//Set Mute Btn
    if(this.flag_camera_unplugged == false)
    {	
		this.MicOffBtn.hiddenObj();
		this.MicOnBtn.visibleObj();
		
	    if(currentHighlight == this.MicOffBtn)
	    {
            this.highlight(this.MicOnBtn);
            this.MicOffBtn.blur();
	    }
				
	}
	else{
		this.MicOnBtn.hiddenObj();
		this.MicOffBtn.visibleObj();

	    if(currentHighlight == this.MicOnBtn)
	    {
            this.highlight(this.MicOffBtn);
            this.MicOnBtn.blur();
	    }		
	}

}

SceneSkypeOutCall.prototype.highlight=function(obj)
{
    this.SkypeOutCallView.setCurrenHighlight(obj);

    if(obj)
    {
    	this.ShowTooltip(obj);
    }    
}

SceneSkypeOutCall.prototype.processLeftKey=function()
{
    alert("SceneSkypeOutCall.processLeftKey() ");

    if(this.flag_selected_number_btn == true)
    {
    	switch(this.currentSelectedObj)
	    {
	        case this.Number2Btn:
	            this.select(this.Number1Btn);
	            break;            
	        case this.Number3Btn:
	            this.select(this.Number2Btn);
	            break;
	        case this.Number5Btn:
	            this.select(this.Number4Btn);
	            break;        
	        case this.Number6Btn:
	            this.select(this.Number5Btn);
	            break;      
	        case this.Number8Btn:
	            this.select(this.Number7Btn);
	            break;        
	        case this.Number9Btn:
	            this.select(this.Number8Btn);
	            break;
	        case this.Number0Btn:
	            this.select(this.StarBtn);
	            break;
	        case this.SharpBtn:
	            this.select(this.Number0Btn);
	            break;
	    }    
    }
    else
    {
	    var currentHighlight =  this.SkypeOutCallView.getCurrentHighlight();
	    
	    switch(currentHighlight)
	    {
	        case this.CallEndBtn:
	        	if(this.MicOnBtn.GetFlagVisible() == true)
	        	{
	            	this.highlight(this.MicOnBtn);        		
	        	}
	        	else{
	            	this.highlight(this.MicOffBtn);         		
	        	}
	            break;
	        case this.MicOnBtn:
	        case this.MicOffBtn:
	            this.highlight(this.TVModeBtn);
	            break;
		}
    }
}

SceneSkypeOutCall.prototype.processRightKey=function()
{
    alert("SceneSkypeOutCall.processRightKey() ");
    
    if(this.flag_selected_number_btn == true)
    {
    	switch(this.currentSelectedObj)
	    {
	        case this.Number1Btn:
	            this.select(this.Number2Btn);
	            break;            
	        case this.Number2Btn:
	            this.select(this.Number3Btn);
	            break;
	        case this.Number4Btn:
	            this.select(this.Number5Btn);
	            break;        
	        case this.Number5Btn:
	            this.select(this.Number6Btn);
	            break;        
	        case this.Number7Btn:
	            this.select(this.Number8Btn);
	            break;        
	        case this.Number8Btn:
	            this.select(this.Number9Btn);
	            break;
	        case this.Number0Btn:
	            this.select(this.SharpBtn);
	            break;
	        case this.StarBtn:
	            this.select(this.Number0Btn);
	            break;
	    }    	
    }
    else
    {
		var currentHighlight =  this.SkypeOutCallView.getCurrentHighlight();
    
	    switch(currentHighlight)
	    {
	        case this.MicOnBtn:
	        case this.MicOffBtn:
	            this.highlight(this.CallEndBtn);
	            break;
	        case this.TVModeBtn:
	        	if(this.MicOnBtn.GetFlagVisible() == true)
	        	{
	            	this.highlight(this.MicOnBtn);        		
	        	}
	        	else{
	            	this.highlight(this.MicOffBtn);
	        	}
	            break;
	            
		}
    }
}

SceneSkypeOutCall.prototype.processEnterKey=function()
{
    alert("SceneSkypeOutCall.processEnterKey() ");
    
    if(this.flag_selected_number_btn == true)
    {
	   	switch(this.currentSelectedObj)
	    {
	        case this.Number1Btn:
	            this.processDTMF(0);
	            break;            
	        case this.Number2Btn:
	            this.processDTMF(1);
	            break;            
	        case this.Number3Btn:
	            this.processDTMF(2);
	            break;            
	        case this.Number4Btn:
	            this.processDTMF(3);
	            break;        
	        case this.Number5Btn:
	            this.processDTMF(4);
	            break;        
	        case this.Number6Btn:
	            this.processDTMF(5);
	            break;
	        case this.Number7Btn:
	            this.processDTMF(6);
	            break;        
	        case this.Number8Btn:
	            this.processDTMF(7);
	            break;        
	        case this.Number9Btn:
	            this.processDTMF(8);
	            break;
	        case this.Number0Btn:
	            this.processDTMF(10);
	            break;
	        case this.StarBtn:
	            this.processDTMF(9);
	            break;
	        case this.SharpBtn:
	            this.processDTMF(11);
	            break;
	    }     	
    }
    else
    {
	    var currentHighlight =  this.SkypeOutCallView.getCurrentHighlight();
	    
	    switch(currentHighlight)
	    {
	        case this.CallEndBtn:
				ProcMgr.DisconnectCall();
	            break;
	
	        case this.MicOnBtn:
	        case this.MicOffBtn:
	            this.changeMicBtn();
	            break;
	            
	        case this.TVModeBtn:
	        	this.changeTVmode();
	            break;
	    }
    }
}

SceneSkypeOutCall.prototype.RemoteHold=function()
{
    alert("SceneSkypeOutCall.RemoteHold() ");  
}


SceneSkypeOutCall.prototype.processClickEvent = function(obj){
	alert("SceneSkypeOutCall.processClickEvent() ");
	
     for(a=0; a<this.NumBtnList.length; a++)
     {
     	if(obj == this.NumBtnList[a].obj)
     	{
     		if(this.flag_press_DTMF == false)
     		{
     			this.processDTMF(a);
     		}
     		return;
     	}
     }

	this.processEnterKey();
}


//0~9 : 0~8,10
//*	  : 9
//#   : 11
SceneSkypeOutCall.prototype.processDTMF = function(keyValue)
{
	
	if(keyValue < 0 || keyValue > 11)
	{
		alert('processDTMF -- error ')
		return;
	}
		
	this.current_DTMF_key = keyValue;
	
	if(this.NumBtnList[keyValue].obj == this.currentSelectedObj)
	{
		this.flag_select_focus_state = true;
	}
	this.NumBtnList[keyValue].obj.highlight();

	this.flag_press_DTMF = true;
		
	ProcMgr.SendDTMF(keyValue);
	
	setTimeout("TimerCallBackFunction()", 500);
	TimerCallBackFunction = function(){

		sf.scene.get('SkypeOutCall').UnblockDTMF();   		
    }		
}

SceneSkypeOutCall.prototype.UnblockDTMF = function()
{	
	if(	this.current_DTMF_key == -1)
	{
		alert('current_DTMF_key is -1 >> error~~!!');
		return;
	}
	
	if(this.flag_select_focus_state == true)
	{
		this.NumBtnList[this.current_DTMF_key].obj.select();
		this.flag_select_focus_state = false;
	}
	else
	{
		this.NumBtnList[this.current_DTMF_key].obj.blur();
	}
		
	this.current_DTMF_key = -1;

	this.flag_press_DTMF = false;
}

SceneSkypeOutCall.prototype.Resume=function()
{
    alert("SceneSkypeOutCall.Resume() ");  
    //this.HoldIconLabel.hiddenObj();
    //this.HoldBtn.SetText(IDWS_MOIP_SKYPE_HOLD);
    //this.CallDurationTextLabel.SetText(IDWS_MOIP_SKYPE_CALL_DURATION); 
}


SceneSkypeOutCall.prototype.getCameraState = function()
{
    var camera_state = PluginAPIMgr.GetCameraState();    
    if(camera_state == ENUM_CAM_STATE.CAM_STATE_DISCONNECTED || camera_state == ENUM_CAM_STATE.CAM_STATE_CONNECTING)
    {
    	this.flag_camera_unplugged = true;
    }
    else{
    	this.flag_camera_unplugged = false;
    }
}

SceneSkypeOutCall.prototype.changeMicBtn = function()
{
    alert("SceneVideoCall.changeMicBtn() ");
    
    if(this.flag_camera_unplugged == true)
    {
    	return;
    }
       
	if( this.MicOnBtn.GetFlagVisible() == true)
	{
		this.MicOnBtn.hiddenObj();
		this.MicOnBtn.blur();		
		this.highlight(this.MicOffBtn);	
		this.MicOffBtn.visibleObj();	
		PluginAPIMgr.MuteMic(true);		
	}
	else
	{
		this.MicOffBtn.hiddenObj();
		this.MicOffBtn.blur();		
		this.highlight(this.MicOnBtn);			
		this.MicOnBtn.visibleObj();
		PluginAPIMgr.MuteMic(false);
	}
}

SceneSkypeOutCall.prototype.processReturnKey = function(){
    alert("SceneVideoCall.processReturnKey() ");
    
	if(g_Data.WIDGET_PARAM.start == true)
	{
		ProcMgr.GoOutWithSignIn(false);
	}
	else
	{
		StateMgr.Start_Main_State();
	} 
}

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

SceneSkypeOutCall.prototype.changeTVmode = function(){
    alert("SceneVideoCall.changeTVmode() ");
        
    ProcMgr.ChangeSourceMode(true);
    
	StateMgr.Start_Video_Call_State();	
}

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

	//unmute
	if(ProcMgr.CallInfo.IsSpeakerMute == true)
	{
	    ProcMgr.processVolumeMute(false);
	}
        
	StateMgr.Start_Volume_Speaker_State(VOLUME_MODE.MASTER);
}

SceneSkypeOutCall.prototype.processUpKey = function()
{
    alert("SceneSkypeOutCall.processUpKey()");

    if(this.flag_selected_number_btn == false)
    {
    	this.highlight(null);
    	this.select(this.Number0Btn);
    	this.flag_selected_number_btn = true;
    }
    else
    {
	    switch(this.currentSelectedObj)
	    {  
	        case this.Number4Btn:
	            this.select(this.Number1Btn);
	            break;        
	        case this.Number5Btn:
	            this.select(this.Number2Btn);
	            break;        
	        case this.Number6Btn:
	            this.select(this.Number3Btn);
	            break;
	        case this.Number7Btn:
	            this.select(this.Number4Btn);
	            break;        
	        case this.Number8Btn:
	            this.select(this.Number5Btn);
	            break;        
	        case this.Number9Btn:
	            this.select(this.Number6Btn);
	            break;
	        case this.Number0Btn:
	            this.select(this.Number8Btn);
	            break;
	        case this.StarBtn:
	            this.select(this.Number7Btn);
	            break;
	        case this.SharpBtn:
	            this.select(this.Number9Btn);
	            break;            
	    }    	
    } 
        
}

SceneSkypeOutCall.prototype.processDownKey = function()
{
    alert("SceneSkypeOutCall.processDownKey()");
    
    if(this.flag_selected_number_btn == true)
    {
	    switch(this.currentSelectedObj)
	    {
	        case this.Number1Btn:
	            this.select(this.Number4Btn);
	            break;            
	        case this.Number2Btn:
	            this.select(this.Number5Btn);
	            break;            
	        case this.Number3Btn:
	            this.select(this.Number6Btn);
	            break;            
	        case this.Number4Btn:
	            this.select(this.Number7Btn);
	            break;        
	        case this.Number5Btn:
	            this.select(this.Number8Btn);
	            break;        
	        case this.Number6Btn:
	            this.select(this.Number9Btn);
	            break;
	        case this.Number7Btn:
	            this.select(this.StarBtn);
	            break;        
	        case this.Number8Btn:
	            this.select(this.Number0Btn);
	            break;        
	        case this.Number9Btn:
	            this.select(this.SharpBtn);
	            break;
	        case this.Number0Btn:
	        case this.StarBtn:
	        case this.SharpBtn:
	        	this.select(null);
	            this.highlight(this.CallEndBtn);
	            this.flag_selected_number_btn = false;
	            break;            
	    }
    }

}


SceneSkypeOutCall.prototype.select=function(obj)
{
    alert("SceneSkypeOutCall.select()");
    
	if(this.currentSelectedObj)
	{
		this.currentSelectedObj.blur();
	}
	
	if(obj)
	{
		obj.select();	
	}
	
	this.currentSelectedObj = obj;
}

SceneSkypeOutCall.prototype.ShowTooltip = function(btn_obj)
{		
	var tooltip_text;
	var tooltip_left;
	
	//1st. show
	if(this.flag_shown_tooltip == false)
	{
		$('#skype_out_call_btn_tooltip').sfTooltip('show');
		this.flag_shown_tooltip = true;
	}	
	
	if(btn_obj == this.TVModeBtn)
	{
		tooltip_text = TV_SID_SHOW_TV;
		tooltip_left = '538px';
	}
	if(btn_obj == this.MicOnBtn)
	{
		tooltip_text = IDWS_MOIP_SKYPE_MUTE_MIC;
		tooltip_left = '640px';
	}
	if(btn_obj == this.MicOffBtn)
	{
		tooltip_text = IDWS_MOIP_SKYPE_UNMUTE_MIC;
		tooltip_left = '640px';
	}		
	else if(btn_obj == this.CallEndBtn)
	{
		tooltip_text = TV_SID_END_CALL;
		tooltip_left = '744px';
	}

	$('#skype_out_call_btn_tooltip').sfTooltip('setText',tooltip_text);
	$('#skype_out_call_btn_tooltip').css('left',tooltip_left);
	
	if(this.TooltipTimer)
	{
		clearTimeout(this.TooltipTimer);
	}
    
	this.TooltipTimer = setTimeout("HideToolTipCallBack()", 6000);
	
	HideToolTipCallBack = function(){
		$('#skype_out_call_btn_tooltip').sfTooltip('hide');
		sf.scene.get('SkypeOutCall').flag_shown_tooltip = false;
    }
}

SceneSkypeOutCall.prototype.processBtnOver = function(obj){
	
	var currentHighlight =  this.SkypeOutCallView.getCurrentHighlight();
    if(currentHighlight != obj)
    {
    	this.highlight(obj);
    }
}

SceneSkypeOutCall.prototype.processTVModeBtnOver = function(){
	this.processBtnOver(this.TVModeBtn);
}

SceneSkypeOutCall.prototype.processMicOnBtnOver = function(){
    this.processBtnOver(this.MicOnBtn);
}

SceneSkypeOutCall.prototype.processMicOffBtnOver = function(){
    this.processBtnOver(this.MicOffBtn);
}

SceneSkypeOutCall.prototype.processCallEndBtnOver = function(){
    this.processBtnOver(this.CallEndBtn);
}

SceneSkypeOutCall.prototype.processMuteKey = function()
{
	alert("SceneSkypeOutCall.processMuteKey()");

	if(ProcMgr.CallInfo.IsSpeakerMute == false)
	{
	    ProcMgr.processVolumeMute(true);
	    StateMgr.Start_Volume_Speaker_State(VOLUME_MODE.MASTER_MUTE);
	}
	else
	{
		ProcMgr.processVolumeMute(false);
    	StateMgr.Start_Volume_Speaker_State(VOLUME_MODE.MASTER);
	}
}
