var OneBtnPopupIndex ={ 
////invalid pwd (signup) ////////////////////////////////////////////////
        INVALID_PWD_NOT_VALIDATED : 1, 
        INVALID_PWD_TOO_SHORT : 2, 
        INVALID_PWD_TOO_LONG : 3, 
        INVALID_PWD_CONTAINS_INVALID_CHAR : 4, 
        INVALID_PWD_CONTAINS_SPACE : 5  , 
        INVALID_PWD_SAME_AS_USERNAME : 6, 
        INVALID_PWD_CONTAINS_INVALID_WORD : 7,
        INVALID_PWD_TOO_SIMPLE : 8 ,
////invalid email (signup)////////////////////////////////////////////////
        INVALID_EMAIL : 9, 
        
////  lodgged out  ////////////////////////////////////////////////
        LOGGEDOUT_EXTERNAL_NETWORK_CONNECTION_FAIL : 10,
        LOGGEDOUT_SERVER_CONNECTION_FAIL : 11,
        LOGGEDOUT_IMPOSSIBLE : 12,
        
        LOGGEDOUT_INVALID_SKYPENAME : 13,
        LOGGEDOUT_INVALID_EMAIL : 14,
        LOGGEDOUT_SKYPENAME_TAKEN : 15,
        LOGGEDOUT_REJECTED_AS_UNDERAGE : 16,
        LOGGEDOUT_UNACCEPTABLE_PASSWORD : 17,
        
        LOGGEDOUT_NO_SUCH_IDENTITY : 18, 
        LOGGEDOUT_INCORRECT_PASSWORD : 19, 
        LOGGEDOUT_TOO_MANY_LOGIN_ATTEMPTS : 20,
        
        LOGGEDOUT_PASSWORD_HAS_CHANGED : 21,
        LOGGEDOUT_PERIODIC_UIC_UPDATE_FAILED : 22,
        LOGGEDOUT_DB_DISK_FULL : 23,
        LOGGEDOUT_DB_PROBLEM : 24,
		
////  change password  ////////////////////////////////////////////////
        PWD_OK : 31,  
		PWD_INVALID_OLD_PASSWORD : 32, 
		PWD_SERVER_CONNECT_FAILED : 33, 
		PWD_MUST_DIFFER_FROM_OLD : 34, 
		PWD_INVALID_NEW_PWD : 35, 
        PWD_NEW_REPEAT_PWD_NOT_MATCH : 36, 


 ////  edit profile  ////////////////////////////////////////////////
        LIST_MAIN_PROFILE_OK: 41, 
 		LIST_MAIN_PROFILE_INVALID_EMAIL : 42,  
		    
 ////  invalid change password  ////////////////////////////////////////////////       
        PWD_TOO_SHORT : 51,						      
		PWD_TOO_LONG : 52,						    
		PWD_CONTAINS_INVALID_CHAR : 53,	       
		PWD_CONTAINS_SPACE : 54,					
		PWD_SAME_AS_USERNAME : 55,				
		PWD_INVALID_FORMAT : 56,					    
		PWD_CONTAINS_INVALID_WORD : 57,		
		PWD_TOO_SIMPLE : 58,	

//// Change Picture ////
		NO_MORE_PHOTO_AVAILABLE	: 61,	
/// Video Snapshot				
		NO_MORE_PHOTO_AVAILABLE_IN_VIDEO_SNAPSHOT	: 62,				
        
  ////  add contact ////////////////////////////////////////////////     
        
        CONTACT_CANNOT_FOUND : 70,    
        CONTACT_SEARCH_FAILED : 71,
        IS_BLOCKED_SKYPE_NAME : 72,
        IS_MY_SKYPE_NAME : 73,
        IS_ALREADY_EXIST_SKYPE_NAME: 74,
        IS_BLOCKED_PHONE_NUMBER : 75,
        IS_ALREADY_EXIST_PHONE_NUMBER : 76,
        ADD_CONTACT_SENT :77,
        NEW_CONTACT_ADDED :78,
        INVALID_PHONE_NUMBER :79,
		

//// Not Available ////
		NOT_AVAILABLE_IN_CONTACT_LIST : 100,
		NOT_AVAILABLE_IN_HISTORY_LIST : 101,
		NOT_AVAILABLE_IN_CHAT_LIST : 102,		
		NOT_AVAILABLE_DURING_CALL_IN_CONTACT_LIST : 103,
		NOT_AVAILABLE_DURING_CALL_IN_HISTORY_LIST : 104,
		NOT_AVAILABLE_DURING_CALL_IN_CHAT_LIST : 105,
		NOT_AVAILABLE_DURING_CALL :106,
        
        NOT_AVAILABLE_KEY : 110,
		
//// Options Block ////

		OPTIONS_BLOCK_INVALID_NAME : 111,
		OPTIONS_BLOCK_AREADY_LIST : 112, 
		OPTIONS_BLOCK_MYSELF : 113,
		OPTIONS_BLOCK_WAIT_MY_AUTHRIZATION : 114,	
		OPTIONS_BLOCK_INVALID_PHONE_NUMBER : 115,		
		
//// add contact from request ////
		ADDED_NEW_CONTACT : 121,
		BLOCKED_NEW_CONTACT : 122,

//// Options ////
        OPTIONS_COMMITED : 130,
        OPTIONS_COMMIT_FAILED : 131,
        OPTIONS_WRONG_NUMBER: 132,
        OPTIONS_SKYPEOUT_DISABLED: 133,
        OPTIONS_OK: 134, 
		
		EMERGENCY_CALL: 140,
		CALL_ENDED: 141,
		CREATE_CALL_FAIL_NETWORK_ERROR: 142, 
		CREATE_CALL_FAIL_PHONE_NUMBER_ERROR: 143,  
		
//// TOOL  /////
		CONTACT_LIST_BLOCKED : 151,
		CONTACT_LIST_BLOCK_REMOVED : 152,		
		CONTACT_LIST_UNBLOCKED : 153,
		CONTACT_REMOVED : 154,
		HISTORY_LIST_BLOCKED : 155,
		HISTORY_LIST_BLOCK_REMOVED : 156,		
		HISTORY_LIST_UNBLOCKED : 157,
		CHAT_LIST_BLOCKED : 158,
		CHAT_LIST_BLOCK_REMOVED : 159,		
		CHAT_LIST_UNBLOCKED : 160,		
		OPTION_BLOCKED : 161,
		OPTION_UNBLOCKED : 162,
		ADD_REMOVED_CONTACT :163,
		
//// Account /////
		ACCOUNT_INCORRECT_PASSWORD :170,
		ACCOUNT_DELETE_PWD_COMPLETE :171,
		
//// Face Recog  /////
		FACE_RECOG_LOGGEDIN :180,
		FACE_RECOG_RE_REGISTRATION :181,
		FACE_RECOG_INCORRECT_PASSWORD  :182,
		FACE_ALREADY_REGISTERED : 183,
//2013 add by minseok
		FACE_RECOG_CANCELED : 184,
//2013 add by minseok
//// Logged in  /////
		LOGGED_IN_SUCESS :190,

		HISTORY_REMOVED :191,
				
		CALL_START_WITHOUT_CAMERA : 192,

 };
 //2013 add by minseok
 var OneLineCoor = {
 	TOP : 266,
 	LEFT : 301,
 	WIDTH : 677,
 	HEIGHT : 188,
 	BTN_TOP : 106,
 	BTN_LEFT : 258
 }
 var MultiLineCoor = {
 	TOP : 241,
 	LEFT : 342,
 	WIDTH : 596,
 	HEIGHT : 238,
 	BTN_TOP : 156,
 	BTN_LEFT : 217
 }
 var ViewType = {
 	OneLine : 0,
 	MultiLine : 1
 }


function SceneOneButtonPopup(options) {
	this.options = options;
    
    this.PopupType = 0;
    this.PopupCallbackFn = null;
	this.PopupData="";
    
    this.OneBtnPopupView=null;
    this.OneBtnPopupBG=null;
	this.OneButtonPopupDim=null;
    
    this.PopupMsg = null;
    this.OkBtn = null;
	this.PopupMsgWithIcon = null;
	this.WarningIcon = null;
	this.CenterPopupMsg = null;
   
    this.PopupTimer = false;

    //2012 add by minseok
    this.CenterPopupMsg2 = null;
    this.NoTimerFlag = false;

}

SceneOneButtonPopup.prototype.initialize = function () {
	alert("SceneOneButtonPopup.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();
}

SceneOneButtonPopup.prototype.handleShow = function () {
	alert("SceneOneButtonPopup.handleShow()");
	// this function will be called when the scene manager show this scene 
	this.OneButtonPopupDim.show();
    
    
    // this.startTimer();
    // //2012 add by minseok 
     if(this.PopupType==OneBtnPopupIndex.LOGGED_IN_SUCESS){
	    WndMgr.startPopupHideTimer(10000,function(){WndMgr.HideOneBottonPopup(); ProcMgr.StartLoggedInState();});
     }else if(this.PopupType==OneBtnPopupIndex.FACE_RECOG_RE_REGISTRATION){
     	WndMgr.startPopupHideTimer(10000,function(){WndMgr.StopOneBottonPopup();});
     }else if(this.PopupType == OneBtnPopupIndex.FACE_RECOG_LOGGEDIN){
     	WndMgr.startPopupHideTimer(10000,function(){WndMgr.StopOneBottonPopup();});
     }else if(this.PopupType== OneBtnPopupIndex.NOT_AVAILABLE_KEY){
     	//140317 DF140315-00870 while smart keypad working.. skype can not get highlight, so NA popup cannot enter OK
     	// so OK Button will be deleted and reduce timer time
     	WndMgr.startPopupHideTimer(2000);;
     }
     else{
     	WndMgr.startPopupHideTimer(10000);
     }
    
     this.update();
    
}

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

    if(ProcMgr.CallInfo.IsTvMode == true)
    {
    	sf.service.setChannelControl(true);
    }	
}

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

SceneOneButtonPopup.prototype.handleBlur = function () {
	alert("SceneOneButtonPopup.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene
	if(ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.TAM)
	{
		$("#one_button_popup_btn").css('top', "130px");
	}
}

SceneOneButtonPopup.prototype.handleKeyDown = function (keyCode) {
	alert("SceneOneButtonPopup.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:
		case sf.key.RIGHT:
			break;
		case sf.key.UP:

			break;
		case sf.key.DOWN:

			break;

		case sf.key.ENTER:
             this.processEnterKey();
			break;
            
        case sf.key.RETURN:
        case sf.key.EXIT:
            this.processReturnKey();
            //2013 modify by minseok
            sf.key.preventDefault();
            //sf.key.block(event);
			break;

        case 147:  //infolink
        case 261:  //contents
        case 115:  //wiselink
            //2013 modify by minseok
            sf.key.preventDefault();
            //sf.key.block(event);
			break;
	}
}

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

SceneOneButtonPopup.prototype.create = function(){
    alert("SceneOneButtonPopup.create()");
    this.OneBtnPopupBG = new View("OneButtonPopupBG");
    this.OneBtnPopupBG.CreatePopupBG(1,"OneButtonPopup_popup_BG_188");
    this.OneBtnPopupView = new View("OneButtonPopup");
    // this.OneBtnPopupView.SetBgImage(WndMgr.Bg_Popup.src);    
	
	this.OneButtonPopupDim = new DimBg("OneButtonPopupDim", "OneButtonPopup");
    
    this.PopupMsg = new Label(null,"one_button_popup_message");
	// this.PopupMsg.SetIsTextInTable(true);
    this.PopupMsg.SetTextStyle("one_button_popup_message_style");
    this.PopupMsg.SetIsPlainText(true);
	
	this.PopupMsgWithIcon = new Label(null,"one_button_popup_message_with_icon");
    this.PopupMsgWithIcon.SetTextStyle("one_button_popup_message_with_icon_style");
	this.PopupMsgWithIcon.hiddenObj();
	
	this.CenterPopupMsg = new Label(null,"one_button_popup_center_message");
    this.CenterPopupMsg.SetTextStyle("one_button_popup_center_message_style");
    this.CenterPopupMsg.SetIsPlainText(true);
	this.CenterPopupMsg.hiddenObj();
	
	this.CenterPopupMsg2 = new Label(null,"one_button_popup_center_message2");
    this.CenterPopupMsg2.SetTextStyle("one_button_popup_center_message_style2");
    this.CenterPopupMsg2.SetIsPlainText(true);
	this.CenterPopupMsg2.hiddenObj();
	
	var this_ = sf.scene.get("OneButtonPopup");
	var clickCF =  function(obj){this_.processClickEvent(obj);};

    this.OkBtn = new Button();
    this.OkBtn.SetImageObjId("one_button_popup_btn", 20);
    this.OkBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
    this.OkBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);	
    this.OkBtn.SetTextObjId("one_button_popup_btn_text");
    this.OkBtn.SetText(SID_OK);
	this.OkBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.OkBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.OkBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.OkBtn.SetOnClickCallbackFunc(clickCF);
    
	this.WarningIcon= new Label("one_button_popup_warning_icon", null);
    this.WarningIcon.SetBgImage(g_Image.IMAGE_BUTTON_POPUP_WARNING_ICON);
	this.WarningIcon.hiddenObj();
}

SceneOneButtonPopup.prototype.highlight=function(obj)
{
	//140317 because of NA popup
	if(obj.GetFlagVisible()){
	    this.OneBtnPopupView.setCurrenHighlight(obj);
	}	

}

SceneOneButtonPopup.prototype.processEnterKey = function(){
    alert("SceneOneButtonPopup.processEnterKey() ");
    
    var currentHighlight =  this.OneBtnPopupView.getCurrentHighlight();
    
    switch(currentHighlight)
    {
        case this.OkBtn:
            WndMgr.StopOneBottonPopup(); 
            break;
    }
}

SceneOneButtonPopup.prototype.processReturnKey = function(){
    alert("SceneOneButtonPopup.processReturnKey() ");
    
    WndMgr.StopOneBottonPopup(); 
}

SceneOneButtonPopup.prototype.callBack = function()
{
    if(this.PopupCallbackFn != null)
    {
        this.PopupCallbackFn();
    }
}

SceneOneButtonPopup.prototype.processClickEvent = function(obj){
	alert("SceneOneButtonPopup.processClickEvent() ");
	
	this.processEnterKey();
}

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

SceneOneButtonPopup.prototype.initPopup = function(typeIndex, data)
{
    this.PopupType =  typeIndex;
    //2012 add by minseok
	this.NoTimerFlag = false;
	if(data)
	{
		this.PopupData=data;
	}
	else
	{
		this.PopupData="";
	}
}
//2012 add by minseok
SceneOneButtonPopup.prototype.setNoTimerFlag = function(flag){
	if(flag){
		this.NoTimerFlag = flag;
	}else{
		this.NoTimerFlag = false;
	}
}
SceneOneButtonPopup.prototype.update = function()
{
    alert("SceneOneButtonPopup.update() ");
    //2013 add by minseok
    this.ChangeView(ViewType.OneLine);
	
	this.PopupMsg.SetTextStyle("one_button_popup_message_style");
	this.PopupMsg.visibleObj();
	this.PopupMsgWithIcon.hiddenObj();
	this.WarningIcon.hiddenObj();
	this.CenterPopupMsg.hiddenObj();
	this.CenterPopupMsg2.hiddenObj();
	
    this.updatePopupMsg();
    this.updatePopupCallbakcFn();
    
    if(ProcMgr.CallInfo.IsTvMode == true)
    {
    	sf.service.setChannelControl(false);
    }
}

SceneOneButtonPopup.prototype.updatePopupMsg = function()
{
    alert("SceneOneButtonPopup.updatePopupMsg() ");
    
    var CurLangID = ResMgr.GetCurLanguage();
	var FinalString = "";
    
    //140317 DF140315-00870
	this.OkBtn.visibleObj();
    switch(this.PopupType)
    {
 /// INVALID_PWD
    case OneBtnPopupIndex.INVALID_PWD_NOT_VALIDATED : 
    	FinalString = IDWS_MOIP_NEW_PASS_INVALID;
        break;
    case OneBtnPopupIndex.INVALID_PWD_TOO_SHORT :
    	FinalString = TV_SID_TOO_SHORT_6_CHARACTERS_MIN; 
        break;
    case OneBtnPopupIndex.INVALID_PWD_TOO_LONG : 
    	FinalString = TV_SID_6_20_CHARACTERS_NEEDED; ; //TV_SID_TOO_LONG_20_CHARACTERS_MAX <- Don't use this SID because this condition can not reproduce.(for menutree)
        break;
    case OneBtnPopupIndex.INVALID_PWD_CONTAINS_INVALID_CHAR : 
    	FinalString = IDWS_MOIP_PASSWORD_INVALID_CHARACTERS;  
        break;
    case OneBtnPopupIndex.INVALID_PWD_CONTAINS_SPACE :   
    	FinalString = IDWS_MOIP_PASSWORD_CONTAINS_SPACE; 
        break;
    case OneBtnPopupIndex.INVALID_PWD_SAME_AS_USERNAME : 
    	FinalString = TV_SID_PASSWORD_IS_TOO_SIMILAR_TO_SKYPE_NAME; 
        break;
   
   //No Use....
    case OneBtnPopupIndex.INVALID_PWD_CONTAINS_INVALID_WORD : 
		// if(ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.GRE)
		// {
			// this.PopupMsg.SetTextStyle("one_button_popup_message_small_style");
		// }
		FinalString = IDWS_MOIP_PWD_CONTAIN_INVALID_WORD; 
        break;
    case OneBtnPopupIndex.INVALID_PWD_TOO_SIMPLE :  
    	FinalString = TV_SID_USE_AT_LEAST_1LETTER_AND_1NUMBER; 
        break;
  /// INVALID_Eamil   
    case OneBtnPopupIndex.INVALID_EMAIL :
     	FinalString = TV_SID_MAIL_ADDRESS_NOT_VALID_MSG; 
        break;
/// Logged out       
    case OneBtnPopupIndex.LOGGEDOUT_EXTERNAL_NETWORK_CONNECTION_FAIL : 
    	FinalString = IDWS_MOIP_PROBLEM_WITH_EXTERNAL_NETWORK; 
        //this.PopupMsg.SetText(IDWS_MOIP_PROBLEM_WITH_EXTERNAL_NETWORK);
        
        break;
    case OneBtnPopupIndex.LOGGEDOUT_SERVER_CONNECTION_FAIL :
    	FinalString = IDWS_MOIP_UNABLE_TO_CONNECT_TO_THE_NETWORK; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_IMPOSSIBLE :
    	FinalString = IDWS_MOIP_LOGIN_FAIL_IMPOSSIBLE; 
        break;

    case OneBtnPopupIndex.LOGGEDOUT_INVALID_SKYPENAME :
    case OneBtnPopupIndex.OPTIONS_BLOCK_INVALID_NAME :	
    	FinalString = IDWS_MOIP_LOGIN_FAIL_INVALID_SKYPENAME; 
        break;
		
    case OneBtnPopupIndex.OPTIONS_BLOCK_INVALID_PHONE_NUMBER :
    	FinalString = IDWS_MOIP_SKYPEOUT_FAIL2; 	
        break;
		
    case OneBtnPopupIndex.LOGGEDOUT_INVALID_EMAIL : 
    	FinalString = TV_SID_MAIL_ADDRESS_NOT_VALID_MSG; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_SKYPENAME_TAKEN :
    	FinalString = TV_SID_SORRY_SKYPE_NAME_ALREADY_TAKEN; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_REJECTED_AS_UNDERAGE :
    	FinalString = IDWS_MOIP_LOGIN_FAIL_REJECTED_AS_UNDERAGE; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_UNACCEPTABLE_PASSWORD :
    	FinalString = IDWS_MOIP_UNACCEPTABLE_PASSWORD; 
        break;

    case OneBtnPopupIndex.LOGGEDOUT_NO_SUCH_IDENTITY :
    	FinalString = IDWS_MOIP_LOGIN_FAIL_NO_SUCH_IDENTITY; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_INCORRECT_PASSWORD :
    	FinalString = TV_SID_SKYPE_NAME_OF_PASSWORD_INCORRECT_MSG; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_TOO_MANY_LOGIN_ATTEMPTS : 
    	FinalString = IDWS_MOIP_LOGIN_FAIL_TOO_MANY_LOGIN_ATTEMPTS; 
        break;

    case OneBtnPopupIndex.LOGGEDOUT_PASSWORD_HAS_CHANGED : 
    	FinalString = IDWS_MOIP_LOGIN_FAIL_PASSWORD_HAS_CHANGED; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_PERIODIC_UIC_UPDATE_FAILED : 
    	FinalString = IDWS_MOIP_UNABLE_TO_CONNECT_TO_THE_NETWORK; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_DB_DISK_FULL : 
    	FinalString = IDWS_MOIP_NOT_ENOUGH_SPACE_LEFT_IN_DISK; 
        break;
    case OneBtnPopupIndex.LOGGEDOUT_DB_PROBLEM :
    	FinalString = IDWS_MOIP_PROBLEM_HAS_BEEN_FOUND_DATABASE; 
        break;
		
    case OneBtnPopupIndex.CONTACT_LIST_BLOCKED :
    case OneBtnPopupIndex.OPTION_BLOCKED :
	case OneBtnPopupIndex.HISTORY_LIST_BLOCKED :
	case OneBtnPopupIndex.CHAT_LIST_BLOCKED :		 
	case OneBtnPopupIndex.BLOCKED_NEW_CONTACT :
	 			    
		FinalString = g_Data.CombinateStrings(SID_MIX_BLOCKED_FROM_CONTACTS, this.PopupData)
        break;		
				
    case OneBtnPopupIndex.CONTACT_LIST_BLOCK_REMOVED :
	case OneBtnPopupIndex.HISTORY_LIST_BLOCK_REMOVED :
	case OneBtnPopupIndex.CHAT_LIST_BLOCK_REMOVED :	
		
		FinalString = g_Data.CombinateStrings(TV_SID_MIX_BLOCKED_AND_REMOVED_FROM_CONTACTS, this.PopupData)
        break;	
		
    case OneBtnPopupIndex.CONTACT_REMOVED :          
		if(this.PopupData.length > 15){
			
			var finalName = this.PopupData.slice(0,14) + '...';
			FinalString = g_Data.CombinateStrings(SID_MIX_REMOVED_FROM_CONTACTS, finalName)
		}
		else {
			FinalString = g_Data.CombinateStrings(SID_MIX_REMOVED_FROM_CONTACTS, this.PopupData)
		}
        break;		
		
    case OneBtnPopupIndex.HISTORY_REMOVED :          
		FinalString = TV_SID_THE_SELECTED_ITEM_HAS_BEEN_REMOVED_FROM_ENTRY;
        break;		
		
    case OneBtnPopupIndex.CONTACT_LIST_UNBLOCKED :   
    case OneBtnPopupIndex.OPTION_UNBLOCKED :  	
    case OneBtnPopupIndex.HISTORY_LIST_UNBLOCKED : 	
	case OneBtnPopupIndex.CHAT_LIST_UNBLOCKED :
		       
		FinalString = g_Data.CombinateStrings(SID_MIX_IS_NOW_UNBLOCKED, this.PopupData)
        break;

    case OneBtnPopupIndex.ADD_REMOVED_CONTACT : 	
	       
		FinalString = IDWS_MOIP_CONTACT_ADDED;
        break;		
				
/// change pwd
/// 2013 modify by minseok : for multiline message        
    case OneBtnPopupIndex.PWD_OK :  
    	FinalString = TV_SID_THE_NEW_PASSWORD_HAS_BEEN_SAVED; 
        break;
    case OneBtnPopupIndex.PWD_INVALID_OLD_PASSWORD :
    	FinalString = TV_SID_OLD_PASSWORD_NOT_VALID_MSG; 
        break;
    case OneBtnPopupIndex.PWD_MUST_DIFFER_FROM_OLD :
    	FinalString = IDWS_MOIP_SAME_OLD_NEW_PASS; 
        break;
    case OneBtnPopupIndex.PWD_INVALID_NEW_PWD : 
    	FinalString = IDWS_MOIP_NEW_PASS_INVALID; 
        break;
    case OneBtnPopupIndex. PWD_NEW_REPEAT_PWD_NOT_MATCH :
    	FinalString = TV_SID_PASSWORDS_DONT_MATCH; 
    //
        break;
    case OneBtnPopupIndex.PWD_SERVER_CONNECT_FAILED :
    	FinalString = IDWS_MOIP_PROBLEM_WITH_EXTERNAL_NETWORK;//IDWS_MOIP_NETWORK_ERROR;   
        break;
        
 /// edit profile       
   case OneBtnPopupIndex.LIST_MAIN_PROFILE_OK :
		FinalString = TV_SID_THE_NEW_SETTING_HAS_BEEN_SAVED;
        break;
            
    case OneBtnPopupIndex.LIST_MAIN_PROFILE_INVALID_EMAIL :
    	FinalString = TV_SID_MAIL_ADDRESS_NOT_VALID_MSG;
        break;
  
   /// add contact     
   case OneBtnPopupIndex.CONTACT_CANNOT_FOUND :
	FinalString = TV_SID_NOT_FOUND;
        break;
    case OneBtnPopupIndex.CONTACT_SEARCH_FAILED :
     	FinalString = TV_SID_CONTACK_SEARCH_FAILED;
        break;
    case OneBtnPopupIndex.IS_BLOCKED_SKYPE_NAME :
    	FinalString = IDWS_MOIP_SORRY_BLOCKED_THIS_PERSON; 
   		break;
    case OneBtnPopupIndex.IS_MY_SKYPE_NAME :
    	FinalString = IDWS_MOIP_CAN_NOT_ADD_YOURSELF;
        break;
    case OneBtnPopupIndex.IS_ALREADY_EXIST_SKYPE_NAME:
    	FinalString = g_Data.CombinateStrings(IDWS_MOIP_ALREADY_IN_YOUR_CONTACT, this.PopupData); 
   		break;
    case OneBtnPopupIndex.IS_BLOCKED_PHONE_NUMBER : 
    	FinalString = IDWS_MOIP_SORRY_BLOCKED_THIS_PERSON;
        break;
    case OneBtnPopupIndex.IS_ALREADY_EXIST_PHONE_NUMBER :
    	FinalString = g_Data.CombinateStrings(IDWS_MOIP_ALREADY_IN_YOUR_CONTACT, this.PopupData); 
        break;
            
    case OneBtnPopupIndex.INVALID_PHONE_NUMBER : 

		FinalString = TV_SID_THE_PHONE_NUMBER_INVALID_PLEASE_CORRECT_IT;
            break;
            
     case OneBtnPopupIndex.ADD_CONTACT_SENT :

			FinalString = TV_YOUR_REQUEST_HAS_BEEN_SENT+" "+TV_MAY_NOT_CONTACT_UNTIL_CONFIRM_MSG;
			break;
    case OneBtnPopupIndex.NEW_CONTACT_ADDED :
    	FinalString = IDWS_MOIP_CONTACT_ADDED;
        break;
            
            
/// options
    case OneBtnPopupIndex.OPTIONS_COMMITED :  
    	FinalString = TV_SID_THE_NEW_SETTING_HAS_BEEN_SAVED;	       
        break;			
					
    case OneBtnPopupIndex.OPTIONS_COMMIT_FAILED :
    	FinalString = TV_SID_NEW_SETTING_COMMIT_FAILED;  	       
        break;		

    case OneBtnPopupIndex.OPTIONS_WRONG_NUMBER: 
    	FinalString = IDWS_MOIP_CALLS_CANNOT_BE_FORWARDED; 	
        break;			        

    case OneBtnPopupIndex.OPTIONS_SKYPEOUT_DISABLED:  
    	FinalString = IDWS_MOIP_WARNIING_SKYPEOUT;
        break;
        
     case OneBtnPopupIndex.OPTIONS_OK:
     	FinalString = TV_SID_THE_NEW_SETTING_HAS_BEEN_SAVED;
        break;

		
//// Options Block ////		
		
    case OneBtnPopupIndex.OPTIONS_BLOCK_AREADY_LIST :
    	FinalString = SID_THIS_PERSON_IS_ALREADY_BLOCKED;  	       
        break;			
					
    case OneBtnPopupIndex.OPTIONS_BLOCK_MYSELF :  
    	FinalString = SID_CANNOT_BLOCK_YOURSELF;	       
        break;		

    case OneBtnPopupIndex.OPTIONS_BLOCK_WAIT_MY_AUTHRIZATION: 
    	FinalString = TV_SID_ADDED_AS_A_NEW_CONTACT; 	       
        break;	
		
////  invalid change password  ////////////////////////////////////////////////       
    case OneBtnPopupIndex.PWD_TOO_SHORT : 
    	FinalString = TV_SID_TOO_SHORT_6_CHARACTERS_MIN;
        break;
    case OneBtnPopupIndex.PWD_TOO_LONG : 
    	FinalString = TV_SID_6_20_CHARACTERS_NEEDED;//TV_SID_TOO_LONG_20_CHARACTERS_MAX <- Don't use this SID because this condition can not reproduce.(for menutree)
        break;
    case OneBtnPopupIndex.PWD_CONTAINS_INVALID_CHAR :
    	FinalString = IDWS_MOIP_PASSWORD_INVALID_CHARACTERS; 	
        break;
    case OneBtnPopupIndex.PWD_CONTAINS_SPACE :
    	FinalString = IDWS_MOIP_PASSWORD_CONTAINS_SPACE; 
        break;
    case OneBtnPopupIndex.PWD_SAME_AS_USERNAME : 
    	FinalString = TV_SID_PASSWORD_IS_TOO_SIMILAR_TO_SKYPE_NAME;
        break;
    case OneBtnPopupIndex.PWD_INVALID_FORMAT : 
    	FinalString = IDWS_MOIP_NEW_PASS_INVALID;
        break;
    case OneBtnPopupIndex.PWD_CONTAINS_INVALID_WORD : 
    
    	this.ChangeView(ViewType.MultiLine);
    	this.PopupMsg.hiddenObj();
		this.CenterPopupMsg2.visibleObj();
		if(CurLangID == ENUM_TV_LANGUAGE.GRE || CurLangID == ENUM_TV_LANGUAGE.POR || CurLangID == ENUM_TV_LANGUAGE.RUS)
		{
			this.PopupMsg.SetTextStyle("one_button_popup_message_small_style");
		}
		else if(CurLangID == ENUM_TV_LANGUAGE.TAM)
		{
			/*$("#one_button_popup_message").css('top', "30px" );
			$("#one_button_popup_message").css('height', "100px" );
			$("#one_button_popup_btn").css('top', "145px");*/
			this.PopupMsg.SetTextStyle("one_button_popup_message_long_style");
		}
					
        this.CenterPopupMsg2.SetText( IDWS_MOIP_PWD_CONTAIN_INVALID_WORD);
        break;
    case OneBtnPopupIndex.PWD_TOO_SIMPLE : 
    	FinalString = TV_SID_USE_AT_LEAST_1LETTER_AND_1NUMBER;	
        break;		
    case OneBtnPopupIndex.NO_MORE_PHOTO_AVAILABLE :
	case OneBtnPopupIndex.NO_MORE_PHOTO_AVAILABLE_IN_VIDEO_SNAPSHOT :
		FinalString = IDWS_MOIP_NO_MORE_PHOTO_AVAILABLE;
        break;		
	
    case OneBtnPopupIndex.NOT_AVAILABLE_IN_CONTACT_LIST : 
    case OneBtnPopupIndex.NOT_AVAILABLE_IN_HISTORY_LIST : 
    case OneBtnPopupIndex.NOT_AVAILABLE_IN_CHAT_LIST :
    	FinalString = SID_NOT_AVAILABLE;
        break;					

    case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL_IN_CONTACT_LIST : 
    case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL_IN_HISTORY_LIST : 
    case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL_IN_CHAT_LIST :
	case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL :
		FinalString = TV_SID_THIS_FEATURE_IS_NOT_AVAILABLE_DURING_THE_CALL;
        break;
			
    case OneBtnPopupIndex.ADDED_NEW_CONTACT : 	
    	FinalString = IDWS_MOIP_CONTACT_ADDED;
        break;	
        
     case OneBtnPopupIndex.NOT_AVAILABLE_KEY :
     
     	this.ChangeView(ViewType.MultiLine);
		
	 	this.PopupMsgWithIcon.SetText(SID_NOT_AVAILABLE);
	 	
		this.PopupMsg.hiddenObj();	
		this.PopupMsgWithIcon.visibleObj();
		this.WarningIcon.visibleObj();
		//140317 DF140315-00870
		 this.OkBtn.hiddenObj();

        break;		
	
	 case OneBtnPopupIndex.EMERGENCY_CALL :  
	 	FinalString = SID_EMERGENCY_CALL;
		break;	
		
	 case OneBtnPopupIndex.CALL_ENDED : 
	 	FinalString = IDWS_MOIP_SKYPE_CALL_ENDED;
		break;
		
	 case OneBtnPopupIndex.CREATE_CALL_FAIL_NETWORK_ERROR : 
	 	FinalString = IDWS_MOIP_PROBLEM_WITH_EXTERNAL_NETWORK;//IDWS_MOIP_NETWORK_ERROR; 
		break;	
	case OneBtnPopupIndex.CREATE_CALL_FAIL_PHONE_NUMBER_ERROR:
		FinalString = IDWS_MOIP_SKYPEOUT_FAIL12;
		break;	
		
	case OneBtnPopupIndex.ACCOUNT_INCORRECT_PASSWORD:
		FinalString = TV_THAT_ISNT_THE_RIGHT_PASSWORD_TRY_AGAIN;
		break;
		
	case OneBtnPopupIndex.ACCOUNT_DELETE_PWD_COMPLETE:
		FinalString = TV_SID_YOUR_FACE_DELETED_FROM_ACCOUNT;
		break;
		
	case OneBtnPopupIndex.FACE_RECOG_LOGGEDIN:
		FinalString = g_Data.CombinateStrings(TV_MIX_YOU_ARE_LOGGED_IN_AS, PluginAPIMgr.GetMySkyeName());
		 break;	
		 
	case OneBtnPopupIndex.FACE_RECOG_RE_REGISTRATION:
		FinalString = TV_SCAN_FACE_AGAIN_MSG;
		 break;	
		 
	 case OneBtnPopupIndex.FACE_RECOG_INCORRECT_PASSWORD:
	 	FinalString = TV_THAT_ISNT_THE_RIGHT_PASSWORD_TRY_AGAIN;
		break;
		
	case OneBtnPopupIndex.FACE_ALREADY_REGISTERED:
		if(ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.BUL || ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.DEU 
		|| ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.GRE || ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.POL)
		{
			this.PopupMsg.SetTextStyle("one_button_popup_message_small_style");
		}
		else if(ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.TAM)
		{
			this.PopupMsg.SetTextStyle("one_button_popup_message_long_style");
		}
		
 		this.PopupMsg.SetText(TV_YOU_HAVE_ALREADY_REGISTERED_YOUR_FACE+" "+TV_FIRST_DELETE_STORED_IMAGE_MSG);
		break;
	case OneBtnPopupIndex.FACE_RECOG_CANCELED:
		FinalString = TV_FACE_REGISTRATION_CANCELED_MSG;
		break;
	case OneBtnPopupIndex.LOGGED_IN_SUCESS:
		this.ChangeView(ViewType.MultiLine);
		
		this.PopupMsg.hiddenObj();
		this.CenterPopupMsg2.visibleObj();	
		if(StateMgr.GetCurrentState() == "CreateAccount") {
			this.CenterPopupMsg2.SetText(g_Data.DATA_CREATE_ACCOUNT_INPUT_INFO.id + "<br>" + TV_SID_SIGNED_IN_SUCCESSFULLY);
		} else {
			this.CenterPopupMsg2.SetText(g_Data.DATA_SIGNIN_INPUT_INFO.id + "<br>" + TV_SID_SIGNED_IN_SUCCESSFULLY);
		}
		break;
	case OneBtnPopupIndex.CALL_START_WITHOUT_CAMERA:
		FinalString = TV_SID_CAMERA_DISCONNECTED_MSG;
		break;
    }
    
    if(FinalString.length==0)
    	return;
    	
	if(this.CheckMultiLine(FinalString)){
		this.ChangeView(ViewType.MultiLine);
		this.PopupMsg.hiddenObj();
		this.CenterPopupMsg2.visibleObj();	
		this.CenterPopupMsg2.SetText(FinalString);
	}else{
		this.PopupMsg.SetText(FinalString);
	}
	FinalString="";
	
}

SceneOneButtonPopup.prototype.updatePopupCallbakcFn = function()
{
    alert("SceneOneButtonPopup.updatePopupCallbakcFn() ");
	
	this.PopupCallbackFn = null; //init
	
    switch(this.PopupType)
    {
 /// INVALID_PWD
        case OneBtnPopupIndex.INVALID_PWD_NOT_VALIDATED : 
        case OneBtnPopupIndex.INVALID_PWD_TOO_SHORT : 
        case OneBtnPopupIndex.INVALID_PWD_TOO_LONG : 
        case OneBtnPopupIndex.INVALID_PWD_CONTAINS_INVALID_CHAR :  
        case OneBtnPopupIndex.INVALID_PWD_CONTAINS_SPACE :   
        case OneBtnPopupIndex.INVALID_PWD_SAME_AS_USERNAME :  
        case OneBtnPopupIndex.INVALID_PWD_CONTAINS_INVALID_WORD : 
        case OneBtnPopupIndex.INVALID_PWD_TOO_SIMPLE :  
    
        //  << don't use this message >>
		
        break;
/// INVALID_Eamil        
        case OneBtnPopupIndex.INVALID_EMAIL :
        //  << don't use this message >>
		
        break;
/// Logged out               
        case OneBtnPopupIndex.LOGGEDOUT_EXTERNAL_NETWORK_CONNECTION_FAIL :
        case OneBtnPopupIndex.LOGGEDOUT_SERVER_CONNECTION_FAIL :
        case OneBtnPopupIndex.LOGGEDOUT_IMPOSSIBLE :
        case OneBtnPopupIndex.LOGGEDOUT_PASSWORD_HAS_CHANGED : 
        case OneBtnPopupIndex.LOGGEDOUT_PERIODIC_UIC_UPDATE_FAILED : 
        case OneBtnPopupIndex.LOGGEDOUT_DB_DISK_FULL : 
        case OneBtnPopupIndex.LOGGEDOUT_DB_PROBLEM :

			if(StateMgr.GetCurrentState() =="CreateAccount")
			{
				this.PopupCallbackFn = function(){WndMgr.ReturnCreateAccount();};
				
			}
			else
			{
				if(StateMgr.GetCurrentState() =="Signin")
				{
					this.PopupCallbackFn = function(){WndMgr.ReturnSignin()};
				}
				else if(StateMgr.GetCurrentState() =="FaceRecogSignin"){
					this.PopupCallbackFn = function(){WndMgr.ReturnFaceRecogSignin()};
				}
				else
				{
					//this.PopupCallbackFn = function(){StateMgr.Start_Signin_State()};
					this.PopupCallbackFn = function(){StateMgr.Start_Welcome_State()};
				}				
			}
			
            break;
            
        case OneBtnPopupIndex.LOGGEDOUT_INVALID_SKYPENAME :
             //  << don't use this message >>
             break;
        case OneBtnPopupIndex.LOGGEDOUT_INVALID_EMAIL :
             //  << don't use this message >>
            break;
        case OneBtnPopupIndex.LOGGEDOUT_UNACCEPTABLE_PASSWORD : 
             //  << don't use this message >>
            break;
        case OneBtnPopupIndex.LOGGEDOUT_SKYPENAME_TAKEN :

			this.PopupCallbackFn =function() {WndMgr.SuggestionStepCreateAccount()};

            break;
        case OneBtnPopupIndex.LOGGEDOUT_REJECTED_AS_UNDERAGE : 

			this.PopupCallbackFn = function(){WndMgr.ReturnCreateAccount()};

            break;
        case OneBtnPopupIndex.LOGGEDOUT_INCORRECT_PASSWORD :

			if(StateMgr.GetCurrentState() =="Signin")
			{
				this.PopupCallbackFn = function(){
					sf.scene.get('Signin').InputPWDAgain();
					WndMgr.ReturnSignin();
					};
			}
			else if(StateMgr.GetCurrentState() =="FaceRecogSignin")
			{
				this.PopupCallbackFn = function(){
					ProcMgr.InputPwdAgainforFaceSignin();
					};
			}


            break;
        case OneBtnPopupIndex.LOGGEDOUT_NO_SUCH_IDENTITY :
        case OneBtnPopupIndex.LOGGEDOUT_TOO_MANY_LOGIN_ATTEMPTS : 

			if(StateMgr.GetCurrentState() =="Signin")
			{
				this.PopupCallbackFn = function(){WndMgr.ReturnSignin()};
			}
			else if(StateMgr.GetCurrentState() =="FaceRecogSignin")
			{
				this.PopupCallbackFn = function(){WndMgr.InputInfoStepFaceRecogSignin();};
			}
     
            break;
 
	    case OneBtnPopupIndex.CONTACT_LIST_BLOCKED :                
	    case OneBtnPopupIndex.CONTACT_LIST_UNBLOCKED : 	 		
							       
			this.PopupCallbackFn = function(){						
				sf.scene.focus("ListMainContact");				
				sf.scene.get("ListMainContact").Activation();
			};
	        break;

	    case OneBtnPopupIndex.CONTACT_REMOVED : 	
	    case OneBtnPopupIndex.CONTACT_LIST_BLOCK_REMOVED : 		
							       
			this.PopupCallbackFn = function(){
				
				var ContactScene = sf.scene.get("ListMainContact");				
				ContactScene.Activation();
				
				if(ContactScene.list.GetNumOfVisibleItem() > 0){
					
					sf.scene.focus("ListMainContact");	
				}
				else{
					
					WndMgr.ReturnSubToMain();
				}
								
			};
	        break;

	    case OneBtnPopupIndex.HISTORY_REMOVED : 		
							       
			this.PopupCallbackFn = function(){
				
				var HistoryScene = sf.scene.get("ListMainHistory");				
				HistoryScene.Activation();
				
				if(HistoryScene.list.GetNumOfVisibleItem() > 0){
					
					sf.scene.focus("ListMainHistory");	
				}
				else{
					
					WndMgr.ReturnSubToMain();
				}
								
			};
	        break;

		case OneBtnPopupIndex.OPTION_BLOCKED :			
	    case OneBtnPopupIndex.OPTION_UNBLOCKED : 	
					       
			this.PopupCallbackFn = function(){
				sf.scene.focus("SettingsBlockedContacts");
			};
	        break;

		case OneBtnPopupIndex.HISTORY_LIST_BLOCKED :			
	    case OneBtnPopupIndex.HISTORY_LIST_UNBLOCKED : 
	    case OneBtnPopupIndex.HISTORY_LIST_BLOCK_REMOVED :			
					       
			this.PopupCallbackFn = function(){

				var HistoryScene = sf.scene.get("ListMainHistory");				
				HistoryScene.Activation();
				
				if(HistoryScene.list.GetNumOfVisibleItem() > 0){
					
					sf.scene.focus("ListMainHistory");	
				}
				else{
					
					WndMgr.ReturnSubToMain();
				}				
				
			};
	        break;
			
		case OneBtnPopupIndex.CHAT_LIST_BLOCKED :			
	    case OneBtnPopupIndex.CHAT_LIST_UNBLOCKED : 
	    case OneBtnPopupIndex.CHAT_LIST_BLOCK_REMOVED :			
					       
			this.PopupCallbackFn = function(){

				var ChatScene = sf.scene.get("ListMainProfile");				
				ChatScene.Activation();
				
				if(ChatScene.list.GetNumOfVisibleItem() > 0){
					
					sf.scene.focus("ListMainProfile");	
				}
				else{
					
					WndMgr.ReturnSubToMain();
				}				
				
			};
	        break;

	    case OneBtnPopupIndex.ADD_REMOVED_CONTACT : 	
					       
			this.PopupCallbackFn = function(){
				//TEMPCODE
				var Scene = sf.scene.get(WndMgr.GetMainSubSceneID());	
				Scene.Activation();
				sf.scene.focus(WndMgr.GetMainSubSceneID());					
			};
	        break;			
			            
		case OneBtnPopupIndex.BLOCKED_NEW_CONTACT : 	
					       
			this.PopupCallbackFn = function(){				
				sf.scene.get("ListMainContact").Refresh();	
				sf.scene.focus("ListMainContact");					
			};
	        break;
						
 ////  change password  ////////////////////////////////////////////////              
        case OneBtnPopupIndex.PWD_OK :  
            this.PopupCallbackFn = function(){StateMgr.Stop_Change_Password_State(true)};
            break;
        case OneBtnPopupIndex.PWD_INVALID_OLD_PASSWORD :
            this.PopupCallbackFn = function(){sf.scene.get('ChangePassword').InputOldPWDAgain(); WndMgr.BackStepChangePassword()};
            break;

        case OneBtnPopupIndex.PWD_MUST_DIFFER_FROM_OLD : 
        case OneBtnPopupIndex.PWD_INVALID_NEW_PWD : 
        case OneBtnPopupIndex. PWD_NEW_REPEAT_PWD_NOT_MATCH : 
            this.PopupCallbackFn = function(){sf.scene.get('ChangePassword').InputNewPWDAgain(); WndMgr.BackStepChangePassword()};
            break;

        case OneBtnPopupIndex.PWD_SERVER_CONNECT_FAILED :  
            this.PopupCallbackFn = function(){WndMgr.BackStepChangePassword()};
            break;
            
 ////  edit profile ////////////////////////////////////////////////    
        case OneBtnPopupIndex.LIST_MAIN_PROFILE_OK :
            this.PopupCallbackFn = function(){sf.scene.focus('ListMainProfile');};
            break;

        case OneBtnPopupIndex.LIST_MAIN_PROFILE_INVALID_EMAIL :
            this.PopupCallbackFn = function(){sf.scene.focus('ListMainProfile');};
            break;
            
 ////  add contact  ////////////////////////////////////////////////    
        case OneBtnPopupIndex.CONTACT_CANNOT_FOUND :
        case OneBtnPopupIndex.CONTACT_SEARCH_FAILED :
            this.PopupCallbackFn = function(){WndMgr.BackStepAddContact()};
            break;
            
       case OneBtnPopupIndex.IS_BLOCKED_SKYPE_NAME : 
        case OneBtnPopupIndex.IS_MY_SKYPE_NAME :
        case OneBtnPopupIndex.IS_ALREADY_EXIST_SKYPE_NAME: 
                   this.PopupCallbackFn = function(){WndMgr.StartAddContactSkypeNameStep()};
                break;
        case OneBtnPopupIndex.IS_BLOCKED_PHONE_NUMBER : 
        case OneBtnPopupIndex.IS_ALREADY_EXIST_PHONE_NUMBER : 
        case OneBtnPopupIndex.INVALID_PHONE_NUMBER : 
                   this.PopupCallbackFn = function(){WndMgr.StartAddContactPhoneNumberStep()};
                break;
                
        case OneBtnPopupIndex.ADD_CONTACT_SENT :
        case OneBtnPopupIndex.NEW_CONTACT_ADDED :
                     this.PopupCallbackFn = function(){ StateMgr.Start_Main_State();};
            break;
                
   ////  options ////////////////////////////////////////////////                  
        case OneBtnPopupIndex.OPTIONS_COMMITED: 	
               this.PopupCallbackFn = function(){ WndMgr.SettingsSuccessCallBack();};
                break;

	    case OneBtnPopupIndex.OPTIONS_COMMIT_FAILED: 	
               this.PopupCallbackFn = function(){ WndMgr.SettingsFailCallBack();};
                break;   

        case OneBtnPopupIndex.OPTIONS_WRONG_NUMBER: 	
               this.PopupCallbackFn = function(){ WndMgr.SettingsFailCallBack();};
                break;        

        case OneBtnPopupIndex.OPTIONS_SKYPEOUT_DISABLED:
                this.PopupCallbackFn = function(){
                	//WndMgr.SettingsFailCallBack(); 
                	sf.scene.get("SettingsCallForwarding").SaveCallForwardingData();
                };
                break; 
                
        case OneBtnPopupIndex.OPTIONS_OK :
            this.PopupCallbackFn = function(){ WndMgr.SettingsSuccessCallBack();};
            break;
            
////  options block ////			
        case OneBtnPopupIndex.OPTIONS_BLOCK_INVALID_NAME :
		case OneBtnPopupIndex.OPTIONS_BLOCK_INVALID_PHONE_NUMBER:		 
        case OneBtnPopupIndex.OPTIONS_BLOCK_AREADY_LIST : 
        case OneBtnPopupIndex.OPTIONS_BLOCK_MYSELF : 	    
        case OneBtnPopupIndex.OPTIONS_BLOCK_WAIT_MY_AUTHRIZATION : 			

			this.PopupCallbackFn = function(){
				sf.scene.focus("SettingsBlockedContacts");
			};
	        break;
						
 ////  invalid change password  ////////////////////////////////////////////////                  
        case OneBtnPopupIndex.PWD_TOO_SHORT : 
        case OneBtnPopupIndex.PWD_TOO_LONG : 
        case OneBtnPopupIndex.PWD_CONTAINS_INVALID_CHAR : 	    
        case OneBtnPopupIndex.PWD_CONTAINS_SPACE : 
        case OneBtnPopupIndex.PWD_SAME_AS_USERNAME : 
        case OneBtnPopupIndex.PWD_INVALID_FORMAT : 
        case OneBtnPopupIndex.PWD_CONTAINS_INVALID_WORD : 
        case OneBtnPopupIndex.PWD_TOO_SIMPLE : 
            this.PopupCallbackFn = function(){sf.scene.get('ChangePassword').InputNewPWDAgain(); WndMgr.BackStepChangePassword()};
            break;
			

 ////  Change Picture  /////////////////////////                  
        case OneBtnPopupIndex.NO_MORE_PHOTO_AVAILABLE :			
            this.PopupCallbackFn = function(){WndMgr.StartChangePictureStep();};
            break;

 ////  Video snapshot  /////////////////////////                  
        case OneBtnPopupIndex.NO_MORE_PHOTO_AVAILABLE_IN_VIDEO_SNAPSHOT :			
            this.PopupCallbackFn = function(){StateMgr.Start_Change_Picture_State();};
            break;


 ////  not available  /////////////////////////			
    	case OneBtnPopupIndex.NOT_AVAILABLE_IN_CONTACT_LIST : 
    	case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL_IN_CONTACT_LIST :		
		 	this.PopupCallbackFn = function(){sf.scene.focus('ListMainContact');};
            break;	
			
    	case OneBtnPopupIndex.NOT_AVAILABLE_IN_HISTORY_LIST : 
    	case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL_IN_HISTORY_LIST :		
			 this.PopupCallbackFn = function(){sf.scene.focus('ListMainHistory');};
            break;
				
    	case OneBtnPopupIndex.NOT_AVAILABLE_IN_CHAT_LIST :
    	case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL_IN_CHAT_LIST :		
			 this.PopupCallbackFn = function(){sf.scene.focus('ListMainProfile');};
            break;	
			
    	case OneBtnPopupIndex.ADDED_NEW_CONTACT :		
			 this.PopupCallbackFn = function(){sf.scene.focus('ListMainContact');};
            break;	

		case OneBtnPopupIndex.NOT_AVAILABLE_DURING_CALL :	            
		case OneBtnPopupIndex.NOT_AVAILABLE_KEY :
		case OneBtnPopupIndex.EMERGENCY_CALL :
		case OneBtnPopupIndex.CALL_ENDED :  
		case OneBtnPopupIndex.CREATE_CALL_FAIL_NETWORK_ERROR :
		case OneBtnPopupIndex.CALL_START_WITHOUT_CAMERA :
			this.PopupCallbackFn = function(){StateMgr.ReturnToMainState();};
			break;
			
		case OneBtnPopupIndex.CREATE_CALL_FAIL_PHONE_NUMBER_ERROR:	
			this.PopupCallbackFn = function(){StateMgr.Start_Main_State();};
			break;
								
		case OneBtnPopupIndex.ACCOUNT_INCORRECT_PASSWORD:	
			this.PopupCallbackFn = function(){WndMgr.NextStepAccountManager();};
			break;
			
		case OneBtnPopupIndex.ACCOUNT_DELETE_PWD_COMPLETE:
			this.PopupCallbackFn = function(){/*StateMgr.Stop_SettingsFaceRecognition_State(true);*/ StateMgr.Start_SettingsFaceRecognition_State(true);};
			break;
		
		case OneBtnPopupIndex.FACE_RECOG_LOGGEDIN:
			this.PopupCallbackFn = function(){ProcMgr.StartLoggedInState();};
		 break;
		 
	 	case OneBtnPopupIndex.FACE_RECOG_RE_REGISTRATION:
		 	this.PopupCallbackFn = function(){ProcMgr.StartFaceRecogRegistration();};
		 break;
		 
		case OneBtnPopupIndex.FACE_RECOG_INCORRECT_PASSWORD:
			this.PopupCallbackFn = function(){WndMgr.NextStepFaceRecogSignin();};
			break;
			
		case OneBtnPopupIndex.FACE_ALREADY_REGISTERED:
 			this.PopupCallbackFn = function(){WndMgr.NextStepAccountManager();};
		break;
		case OneBtnPopupIndex.FACE_RECOG_CANCELED:
 			this.PopupCallbackFn = function(){WndMgr.BackStepFaceRecogSignin();};
		break;
		/////////////////////////logged in//////////////////
		case OneBtnPopupIndex.LOGGED_IN_SUCESS:
 			this.PopupCallbackFn = function(){ProcMgr.StartLoggedInState();};
		break;

    }
}
//2013 add by minseok
SceneOneButtonPopup.prototype.ChangeView = function(type){
	alert("SceneOneButtonPopup.prototype.ChangeView() : "+type);
	switch(type){
		case ViewType.OneLine:
			this.OneBtnPopupView.ChangeClass(OneLineCoor.TOP,OneLineCoor.LEFT,OneLineCoor.WIDTH,OneLineCoor.HEIGHT);
		    this.OneBtnPopupBG.ChangePopupBGSize("OneButtonPopup_popup_BG_188");
			this.OkBtn.SetLeft(OneLineCoor.BTN_LEFT);
		    this.OkBtn.SetTop(OneLineCoor.BTN_TOP);
			break;
		case ViewType.MultiLine:
			this.OneBtnPopupView.ChangeClass(MultiLineCoor.TOP,MultiLineCoor.LEFT,MultiLineCoor.WIDTH,MultiLineCoor.HEIGHT);
		    this.OneBtnPopupBG.ChangePopupBGSize("OneButtonPopup_popup_BG_238");
			this.OkBtn.SetLeft(MultiLineCoor.BTN_LEFT);
		    this.OkBtn.SetTop(MultiLineCoor.BTN_TOP);
			break;
	}
}
SceneOneButtonPopup.prototype.CheckMultiLine = function(String){
	alert("SceneOneButtonPopup.prototype.CheckMultiLine() : "+String);
	var HTMLString = "<div id='test'></div>";
	$("#OneButtonPopup").append(HTMLString);
	$("#test").text(String);
	$("#test").css(	{
				'float' : 'left',
				'font-size' : '24px',
				'text-shadow' : '0px 1px 1px rgb(0,0,0)',
				'white-space' : 'nowrap',
			});
	
	var width = parseInt($("#test").css('width').replace(/[^-\d\.]/g, ''));
	alert("width is "+width);
	var div_width = parseInt($("#one_button_popup_message").css('width').replace(/[^-\d\.]/g, ''));
	alert("div_width is "+div_width);
	$("#test").remove();
	if(width>div_width){
		return true;
	}else{
		return false;
	}
	
	
}
