
function SceneCallEnding(options) {
	this.options = options;
    
    this.FlagEnding = false;
    this.FlagDropped= false;
    this.FlagPopupTextDrop = false;
         
    this.CallEndingView=null;
	this.CallEndingDim=null;
    this.CallEndingMsgLabel = null;
}

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

SceneCallEnding.prototype.handleShow = function () {
	alert("SceneCallEnding.handleShow()");

    this.update();

}

SceneCallEnding.prototype.handleHide = function () {
	alert("SceneCallEnding.handleHide()");
	
	if(this.FlagPopupTextDrop == true)
	{
		this.CallEndingMsgLabel.SetText(IDWS_MOIP_SKYPE_CALL_ENDED);
	    this.FlagPopupTextDrop = false; 
	}
}

SceneCallEnding.prototype.handleFocus = function () {
	alert("SceneCallEnding.handleFocus()");
}

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

SceneCallEnding.prototype.handleKeyDown = function (keyCode) {
	alert("SceneCallEnding.handleKeyDown(" + keyCode + ")");

	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	
	switch (keyCode) {
		case sf.key.LEFT:
		case sf.key.RIGHT:
		case sf.key.UP:
		case sf.key.DOWN:
		case sf.key.ENTER:
			break;
            
        case sf.key.RETURN:
		case sf.key.EXIT:
            sf.key.preventDefault();
			break;
            
       case 147:  //infolink
       case 261:  //contents
       case 115:  //wiselink
            ProcMgr.processInfolinkKey(); 
			break;
	}
}

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

SceneCallEnding.prototype.create = function(){
    alert("SceneCallEnding.create()");
    
    this.CallEndingView = new View("CallEnding");
	this.CallEndingView.SetBgImage(g_Image.IMAGE_POPUP_DIM_BG);
	this.CallEndingView.CreatePopupBG(1,'call_ending_popup_style');
	
    this.CallEndingMsgLabel = new Label(null, "CallEndingMassage");
    
}


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

SceneCallEnding.prototype.setFlagEnding = function(flag_ending)
{
    this.FlagEnding =  flag_ending;
}

SceneCallEnding.prototype.setFlagDropped = function(flag_dropped)
{
    this.FlagDropped =  flag_dropped;
}

SceneCallEnding.prototype.update = function()
{
	alert("SceneCallEnding.update() ");

   if(this.FlagEnding == true)
   {
        this.CallEndingMsgLabel.SetText(IDWS_MOIP_SKYPE_CALL_ENDED);
        this.FlagEnding = false;
   }
   else
   {
        if(this.FlagDropped == true)
        {
            this.CallEndingMsgLabel.SetText(TV_SID_CALL_DROPPED);        
            this.FlagDropped = false;  //init
        }
        else
        {
			this.CallEndingMsgLabel.SetText(IDWS_MOIP_SKYPE_CALL_ENDED);
        }
   }
}




