function SceneChangePhoneNumber(options) {
	this.options = options;

	this.ChangePhoneNumberView = null;
	this.ChangePhoneNumberPopupView = null;
	this.ChangePhoneNumberDim = null;

	this.TitleBar = null;
	this.MsgLabel = null;
	this.NameLabel = null;

	this.SkypeName = null;
	this.AssignedIndex = null;
	this.PhoneNumberLabel = null;
	this.InitPhoneNumber = null;

	this.CountryCodeBtn = null;
	this.ArrowLabel = null;
	this.PhoneNumberInputBox = null;
	this.CountryNameLabel = null;
	this.CountryPrefixLabel = null;

	this.OkBtn = null;
	this.CancelBtn = null;
	this.DeleteBtn = null;

	this.flagPWD = false;
	this.initText = "";
	this.maxStringLenght = 50;
	this.callerObj = null;

	this.flagInit = false;
	this.CountryPrefix = "";
	this.CountryCode = "";

	this.flagResetData = true;

	this.ShownFlagList = false;

	this.DefaultHelpBar = null;
	this.InputHelpBar = null;
	this.NumberInputHelpBar = null;
	this.NumberInputDefaultHelpBar = null;

	this.isAddEnable = false;

	this.isCountryHelpBarInsertClickEvent = false;

//	this.CountryListHelpBar = null;

	//2013 add by minseok
	this.NormalizedPhoneNumber = null;

}

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

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

	if(this.flagResetData == true) {
		this.resetData();
	}

	var ThisScene = sf.scene.get("ChangePhoneNumber");
	sf.scene.get("CountryFlagList").Init(FLAG_LIST_TYPE.ADD_CONTACT_PHONENUMBER, 'ChangePhoneNumber', ThisScene.SetCountryFlag, ThisScene.HideCountryHelpbar);

  	var callbackFunction =  function(){
  		sf.scene.get('ChangePhoneNumber').popupTimerCallback();
  	};
  	
	WndMgr.startPopupHideTimer(60000,callbackFunction);
}

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

	this.ChangePhoneNumberDim.hide();

	WndMgr.stopPopupHideTimer();
	
	if(this.ShownFlagList == true) {

//		this.CountryListHelpBar.hiddenObj();
		sf.scene.hide('CountryFlagList');
	}
	this.highlight(null);
}

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

	WndMgr.restartPopupHideTimer();

	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();
	
	if(currentHighlight == null) {
		this.highlight(this.PhoneNumberInputBox);
	} else {
		this.highlight(currentHighlight);
	}

	this.ShownFlagList = false;
}

SceneChangePhoneNumber.prototype.handleBlur = function() {
	alert("SceneChangePhoneNumber.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene

	var obj = this.ChangePhoneNumberView.getCurrentHighlight();
	if(obj != null) {
		obj.blur();
	}
}

SceneChangePhoneNumber.prototype.handleKeyDown = function(keyCode) {
	alert("SceneChangePhoneNumber.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:
			WndMgr.resetPopupHideTimer
			// this.resetTimer();
			this.processLeftKey();
			break;
		case sf.key.RIGHT:
			WndMgr.resetPopupHideTimer();
			this.processRightKey();
			break;
		case sf.key.UP:
			WndMgr.resetPopupHideTimer
			// this.resetTimer();
			this.processUpKey();
			break;
		case sf.key.DOWN:
			WndMgr.resetPopupHideTimer();
			this.processDownKey();
			break;

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

		case sf.key.RETURN:
			this.processReturnKey();
			//2013 modify by minseok
			sf.key.preventDefault();
			break;

		case sf.key.EXIT:
			this.processExitKey();
			//2013 modify by minseok
			sf.key.preventDefault();
			break;

		case 147:
		//infolink
		case 261:
		//contents
		case 115:
			//wiselink
			ProcMgr.processInfolinkKey();
			break;
	}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////

SceneChangePhoneNumber.prototype.Init = function(Identity,prop,PhoneLabel,PhoneNumber) {
	alert("SkypeName( "+Identity+" ), AssignedIndex( "+prop+" ),  PhoneNumberLabel( "+PhoneLabel+" ),  InitPhoneNumber( "+PhoneNumber+" )==========");
	this.SkypeName = Identity;
	this.AssignedIndex = prop;
	this.PhoneNumberLabel = PhoneLabel;
	this.InitPhoneNumber = PhoneNumber;
	this.flagResetData = true;
}

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

	var NameLabelStr = this.SkypeName + " - " + this.labelString(this.PhoneNumberLabel);
	this.ChangePhoneNumberView = new View("ChangePhoneNumber");
	this.ChangePhoneNumberPopupView = new View("ChangePhoneNumberBG");
	this.ChangePhoneNumberPopupView.CreatePopupBG(0, "ChangePhoneNumber_popup_Bg");
	this.ChangePhoneNumberPopupView.SetTitleTextofPopupBG(TV_CHANGE_PHONE_NUMBER);

	this.ChangePhoneNumberDim = new DimBg("ChangePhoneNumberDim", "ChangePhoneNumber");

	this.NameLabel = new Label(null, "Change_phone_number_name_text");
	this.NameLabel.SetTextStyle("Change_phone_number_name_text_style");
	this.NameLabel.SetText(NameLabelStr);

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

	this.OkBtn = new Button();
	this.OkBtn.SetImageObjId("Change_phone_number_add_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.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_POPUP_BTN_DIM);
	this.OkBtn.SetTextObjId("Change_phone_number_add_btn_text");
	this.OkBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "cPopup_btn_text");
	this.OkBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "cPopup_btn_text_dim");
	this.OkBtn.SetText(SID_OK);
	this.OkBtn.SetOnClickCallbackFunc(clickCF);

	this.CancelBtn = new Button();
	this.CancelBtn.SetImageObjId("Change_phone_number_cancel_btn", 20);
	this.CancelBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
	this.CancelBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);
	this.CancelBtn.SetTextObjId("Change_phone_number_cancel_btn_text");
	this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "cPopup_btn_text");
	this.CancelBtn.SetText(SID_CANCEL);
	this.CancelBtn.SetOnClickCallbackFunc(clickCF);

	this.DeleteBtn = new Button();
	this.DeleteBtn.SetImageObjId("Change_phone_number_delete_btn", 20);
	this.DeleteBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
	this.DeleteBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);
	this.DeleteBtn.SetTextObjId("Change_phone_number_delete_btn_text");
	this.DeleteBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "cPopup_btn_text");
	this.DeleteBtn.SetText(SID_DELETE);
	this.DeleteBtn.SetOnClickCallbackFunc(clickCF);

	this.CountryPrefixLabel = new Label(null,"Change_phone_number_prefix");
    this.CountryPrefixLabel.SetTextStyle("Change_phone_number_prefix_style");
    this.CountryPrefixLabel.SetReverseDisable(true);
	
    this.CountryNameLabel = new Label(null,"Change_phone_number_country_name");
    this.CountryNameLabel.SetTextStyle("Change_phone_number_country_name_style");
	
	this.CountryCodeBtn = new Button();
	this.CountryCodeBtn.SetImageObjId("Change_phone_number_country_code_btn", 20);
	this.CountryCodeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
	this.CountryCodeBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);
	this.CountryCodeBtn.AppendFgImage("Change_phone_number_country_code_btn_icon", "13px", "13px", "42px", "26px");
	this.CountryCodeBtn.SetOnClickCallbackFunc(clickCF);

	this.ArrowLabel = new Label("Change_phone_number_arrow_down", null);
	this.ArrowLabel.SetBgImage(g_Image.IMAGE_ADD_CONTACT_ARROW_ICON);

//	var scene = sf.scene.get("ChangePhoneNumber");
	this.PhoneNumberInputBox = new NumberInputBox();
	this.PhoneNumberInputBox.SetButtonObjId("Change_phone_number_input_box", 30);
	this.PhoneNumberInputBox.SetButtonTextObjId("Change_phone_number_input_text");
	this.PhoneNumberInputBox.SetInputBoxObjId("Change_phone_number_input_text_editor");
	this.PhoneNumberInputBox.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_INPUT_BOX_NORMAL);
	this.PhoneNumberInputBox.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_INPUT_BOX_NORMALFOCUS);
	this.PhoneNumberInputBox.setPrevEventOnLeftFunc(function() {
		this_.moveToCountryCodeBtn();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnRightFunc(function() {
		//this_.moveToCountryCodeBtn();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnDownFunc(function() {
		this_.moveToAddCancelBtn();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnUpFunc(function() {
		//this_.moveToNameInputBox();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnReturnFunc(function() {
		this_.processReturnKey()
	});
	this.PhoneNumberInputBox.setPrevEventOnExitFunc(function() {
		this_.processExitKey()
	});
	this.PhoneNumberInputBox.setEnterFunc(function() {
		WndMgr.restartPopupHideTimer();
		// scene.processEnterKey()
	});
	this.PhoneNumberInputBox.setAnyKeyFunc(function(keyCode) {
//		scene.checkAddEnable();
		this_.checkOkBtnEnable();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.SetOnClickCallbackFunc(clickCF);
	this.PhoneNumberInputBox.SetReverseDisable(true);
	this.PhoneNumberInputBox.SetHelpbarChangeEnable("ChangePhoneNumber");
	
	this.OkBtn.SetOnMouseOverCallbackFunc(function(obj) {this_.processMouseOver(obj);});
	this.CancelBtn.SetOnMouseOverCallbackFunc(function(obj) {this_.processMouseOver(obj);});
	this.DeleteBtn.SetOnMouseOverCallbackFunc(function(obj) {this_.processMouseOver(obj);});
	this.CountryCodeBtn.SetOnMouseOverCallbackFunc(function(obj) {this_.processMouseOver(obj);});
	this.PhoneNumberInputBox.SetOnMouseOverCallbackFunc(function(obj) {this_.processMouseOver(obj);});
}

SceneChangePhoneNumber.prototype.setResetFlag = function(reset_flag) {
	this.flagResetData = reset_flag;
}

SceneChangePhoneNumber.prototype.labelString = function(label) {
	alert("SceneChangePhoneNumber.labelString : " + label);

	if(label == "mobile")
		return IDWS_MOIP_MOBILE;
	else if(label == "office")
		return IDWS_MOIP_OFFICE;
	else if(label == "home")
		return SID_HOME_KR_HOMEPHONE;
	else if(label == "other")
		return SID_COUNTRY_OTHER;
}

SceneChangePhoneNumber.prototype.resetData = function() {
	
	var phonNumber = PluginAPIMgr.GetLocalNumber(this.InitPhoneNumber);
	this.CountryCode = PluginAPIMgr.FindCountryCodeByNumber(this.InitPhoneNumber);
	this.CountryPrefix = PluginAPIMgr.GetISOCountryPrefix(this.CountryCode);
	
	//this.CountryCode = PluginAPIMgr.GetMyCountryCode();
	//this.CountryPrefix = PluginAPIMgr.GetISOCountryPrefix(this.CountryCode);
	this.CountryCodeBtn.SetFgImage(PluginAPIMgr.GetMyCountryFlag());
	/*************************for testing*********************************/
	// this.CountryCode = "+82";
	// this.CountryPrefix = "82";
	// var path = g_Image.base_flag_image_path + "kr.png";
	// this.CountryCodeBtn.SetFgImage(path);

//	var CountryName = PluginAPIMgr.GetISOCountryName(this.CountryCode);
 	this.CountryNameLabel.SetText(PluginAPIMgr.GetISOCountryName(this.CountryCode));
     
//	this.CountryPrefix	= PluginAPIMgr.GetISOCountryPrefix(this.CountryCode);
//	this.CountryPrefixLabel.SetText(PluginAPIMgr.GetISOCountryPrefix(this.CountryCode));
	
	this.CountryPrefix = PluginAPIMgr.GetISOCountryPrefix(this.CountryCode);
 	this.CountryCodeBtn.SetFgImage(g_Image.base_flag_image_path + this.CountryCode.toUpperCase() + ".png");
 
	if(this.CountryPrefix.length > 0 && this.CountryPrefix != "0" )
	{
		this.CountryPrefixLabel.SetText("+" + this.CountryPrefix);
	}
	else
	{
		this.CountryPrefixLabel.SetText("");
	}	 	

	this.NameLabel.SetText(this.SkypeName + " - " + this.labelString(this.PhoneNumberLabel));
	this.PhoneNumberInputBox.setInitString(phonNumber);

	this.checkOkBtnEnable();
	this.flagResetData = false;
}

SceneChangePhoneNumber.prototype.highlight = function(obj) {
	if(obj == this.OkBtn) {
		this.checkOkBtnEnable();
		if(this.OkBtn.GetFlagDim())
			return;
	}
	this.ChangePhoneNumberView.setCurrenHighlight(obj);
	if(obj == this.PhoneNumberInputBox)
		this.ChangeHelpbar(2);
	else
		this.ChangeHelpbar(0);
}
/*
SceneChangePhoneNumber.prototype.startTextInput = function() {
	alert("SceneChangePhoneNumber.startTextInput() ");

	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.TextInputBox:

			WndMgr.stopPopupHideTimer();

			WndMgr.StartTextEditor(this.TextInputBox, "ChangePhoneNumber", this.ChangePhoneNumberDim);
			break;
	}
}
*/
SceneChangePhoneNumber.prototype.processLeftKey = function() {
	alert("SceneChangePhoneNumber.processLeftKey() ");
	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.PhoneNumberInputBox:
			this.highlight(this.CountryCodeBtn);
			break;
		case this.CancelBtn:
				this.highlight(this.OkBtn);
			
			break;
		case this.DeleteBtn:
			this.highlight(this.CancelBtn);
			break;
	}
}
SceneChangePhoneNumber.prototype.processRightKey = function() {
	alert("SceneChangePhoneNumber.processRightKey() ");

	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.CountryCodeBtn:
			this.highlight(this.PhoneNumberInputBox);
			break;
		case this.OkBtn:
			this.highlight(this.CancelBtn);
			break;
		case this.CancelBtn:
			this.highlight(this.DeleteBtn);
			break;
	}
}

SceneChangePhoneNumber.prototype.processUpKey = function() {
	alert("SceneChangePhoneNumber.processUpKey() ");
	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.OkBtn:
		case this.CancelBtn:
		case this.DeleteBtn:
			this.highlight(this.PhoneNumberInputBox);
			break;
	}
}
SceneChangePhoneNumber.prototype.processDownKey = function() {
	alert("SceneChangePhoneNumber.processDownKey() ");

	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.CountryCodeBtn:
		case this.PhoneNumberInputBox:
			if(!this.OkBtn.GetFlagDim()) {
					this.highlight(this.OkBtn);
				} else {
				this.highlight(this.CancelBtn);
				}
			break;
	}
}

SceneChangePhoneNumber.prototype.processEnterKey = function() {
	alert("SceneChangePhoneNumber.processEnterKey() ");
	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.CountryCodeBtn:
			this.showFlagList();
			break;

		case this.OkBtn:
			var input_phone_number = this.PhoneNumberInputBox.GetText();
			if(input_phone_number.length > 0) {
				var add_prefix_phone_number = this.addCountryPrefix(input_phone_number);
				var normalized_phone_number = PluginAPIMgr.NormalizeIdentity(add_prefix_phone_number);

				alert("SkypeName( "+this.SkypeName+" ), AssignedIndex( "+this.AssignedIndex+" ),  PhoneNumberLabel( "+this.PhoneNumberLabel+" ),  normalized_phone_number( "+normalized_phone_number+" )");
				if(normalized_phone_number.length > 0) {
				    PluginAPIMgr.SetAssignedPhoneNumber(this.SkypeName,this.AssignedIndex,this.PhoneNumberLabel,normalized_phone_number);	    		
					this.processReturnKey();
					//added 10.5
					var scene = sf.scene.get(WndMgr.GetMainSubSceneID());	
						scene.Activation();
				}
			}
			break;
			
		case this.DeleteBtn:
			this.DeletePhoneNumber();
			break;

		case this.CancelBtn:
			this.processReturnKey();
			break;
	}
}

SceneChangePhoneNumber.prototype.addCountryPrefix = function(input_phone_number) {
	alert("SceneChangePhoneNumber.addCountryPrefix() --> this.CountryPrefix : " + this.CountryPrefix);

	if(input_phone_number.indexOf("+") == 0) {
		return input_phone_number;
	} else if(input_phone_number.indexOf("00") == 0) {
		return input_phone_number;
	} else if(input_phone_number.indexOf("011") == 0) {
		return input_phone_number;
	} else {
		if(this.CountryPrefix != "0") {
			return "+" + this.CountryPrefix + input_phone_number;
		} else {
			return input_phone_number;
		}
	}
}
/*

SceneChangePhoneNumber.prototype.checkAddEnable = function() {
	var input_text = this.PhoneNumberInputBox.GetText();

	if(input_text.length == 0) {
		this.isAddEnable = false;
	} else {
		this.isAddEnable = true;
	}

	if(this.isAddEnable == true) {
		this.PhoneNumberInputBox.changeHelpBar(this.NumberInputHelpBar);
		this.OkBtn.SetFlagDim(false);
	} else {
		this.PhoneNumberInputBox.changeHelpBar(this.NumberInputDefaultHelpBar);
		this.OkBtn.SetFlagDim(true);
	}

	alert("SceneChatMsgSend.checkAddEnable()  :  " + this.isAddEnable);
}
*/

SceneChangePhoneNumber.prototype.processReturnKey = function() {
	alert("SceneChangePhoneNumber.processReturnKey() ");

	this.highlight(null);	
	StateMgr.Stop_Change_Phone_Number_State(true);
	sf.key.preventDefault();
	
	//Check....
	/*
	var scene = sf.scene.get(WndMgr.GetMainSubSceneID());	
		scene.Activation();	*/
	
}

SceneChangePhoneNumber.prototype.processExitKey = function() {
	alert("SceneChangePhoneNumber.processExitKey() ");
	this.highlight(null);
	StateMgr.Stop_Change_Contact_State(true);
	// //2013 modify by minseok
	sf.key.preventDefault();
}

SceneChangePhoneNumber.prototype.moveToCountryCodeBtn = function() {
	alert("SceneChangePhoneNumber.moveToCountryCodeBtn() ");

	this.highlight(this.CountryCodeBtn);
	sf.scene.focus('ChangePhoneNumber');
	//$.sf.returnFocus();
}
/*
SceneChangePhoneNumber.prototype.moveToNameInputBox = function() {
	alert("SceneChangePhoneNumber.moveToNameInputBox() ");

	this.highlight(this.TextInputBox);
}
*/
SceneChangePhoneNumber.prototype.moveToAddCancelBtn = function() {
	alert("SceneChangePhoneNumber.moveToAddCancelBtn() ");
	if(this.OkBtn.GetFlagDim()) {
		this.highlight(this.CancelBtn);
	} else {
		this.highlight(this.OkBtn);
	}
}
SceneChangePhoneNumber.prototype.showFlagList = function() {
	alert("SceneChangePhoneNumber.showFlagList() ");

	var ThisScene = sf.scene.get("ChangePhoneNumber");
	var Index = g_Data.GetCountryIndexWithCode(ThisScene.CountryCode);

	sf.scene.get("CountryFlagList").SetCurIndex(Index);
	sf.scene.show('CountryFlagList');
	sf.scene.focus('CountryFlagList');

	ThisScene.ShownFlagList = true;
/*
	if(ThisScene.isCountryHelpBarInsertClickEvent == false) {
		ThisScene.CountryListHelpBar = new HelpBar(HelpBarIndex.CHANGE_PHONE_NUMBER_COUNTRY_LIST, "CountryFlagList");
		ThisScene.CountryListHelpBar.SetOnClickCallbackFunc(1, function() {
			ThisScene.closeCountryList();
		});

		ThisScene.isCountryHelpBarInsertClickEvent = true;
	}
	ThisScene.CountryListHelpBar.visibleObj();
*/
}

SceneChangePhoneNumber.prototype.SetCountryFlag = function() {
	alert("SceneChangePhoneNumber.SetCountryFlag() ");

	var Scene = sf.scene.get("CountryFlagList");
	var FlagImage = Scene.GetCountryFlag();

	var This_ = sf.scene.get("ChangePhoneNumber");
	This_.CountryCodeBtn.SetFgImage(FlagImage);
	This_.CountryPrefix = Scene.GetPrefix();
	This_.CountryCode = Scene.GetCountryCode();
	
	if(This_.CountryPrefix.length > 0 && This_.CountryPrefix != "0" )
	{
		This_.CountryPrefixLabel.SetText("+" + This_.CountryPrefix);
	}
	else
	{
		This_.CountryPrefixLabel.SetText("");
	}	 	
	This_.CountryNameLabel.SetText(PluginAPIMgr.GetISOCountryName(This_.CountryCode));

}

SceneChangePhoneNumber.prototype.HideCountryHelpbar = function() {
	alert("SceneChangePhoneNumber.HideCountryHelpbar() ");
	This_ = sf.scene.get("ChangePhoneNumber");
//	This_.CountryListHelpBar.hiddenObj();
}

SceneChangePhoneNumber.prototype.popupTimerCallback = function() {
	alert("SceneChangePhoneNumber.popupTimerCallback() ");

	//modify by minseok - don't work event.stopPropagation() T.T
	this.processReturnKey();
	
	// this.highlight(null);
	// WndMgr.BackStepAddContact();
	// // //2013 modify by minseok
	// sf.key.preventDefault();
}

SceneChangePhoneNumber.prototype.processMouseOver = function(obj) {
	alert("SceneChangePhoneNumber.processMouseOver");	
	
	//add : smartcontrol highlight issue(130926)
	if(PluginAPIMgr.FlagSmartControlNumber()==1){
		return;
	}
	
	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();
	if(currentHighlight != obj) {
		this.highlight(obj);
		WndMgr.resetPopupHideTimer();
	}
}

SceneChangePhoneNumber.prototype.processClickEvent = function(obj) {
	alert("SceneChangePhoneNumber.processClickEvent() ");

	// this.resetTimer();

	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();

	if(currentHighlight != obj) {
		this.highlight(obj);
	}

	if(obj == this.PhoneNumberInputBox) {
		return;
	}

	this.processEnterKey();
}

SceneChangePhoneNumber.prototype.startKeypad = function() {
	alert("SceneChangePhoneNumber.startKeypad() ");

	var currentHighlight = this.ChangePhoneNumberView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.PhoneNumberInputBox:

			WndMgr.stopPopupHideTimer();

			var stopCF = function() {
				WndMgr.restartPopupHideTimer();
			};

			WndMgr.StartKeypad(currentHighlight, "ChangePhoneNumber", stopCF);
			break;
	}
}

SceneChangePhoneNumber.prototype.inputDelete = function() {
	alert("SceneChangePhoneNumber.inputDelete() ");

	var currentHighlight = this.PhoneNumberInputBox.getCurrentHighlight();

	switch(currentHighlight) {
		case this.PhoneNumberInputBox:

			WndMgr.resetPopupHideTimer();

			currentHighlight.processPreChKey();
			break;
	}
}

SceneChangePhoneNumber.prototype.DeletePhoneNumber = function()
{
	alert("SceneChangePhoneNumber.DeletePhoneNumber()");
	
	alert("SkypeName = " + this.SkypeName);
	alert("AssignedIndex = " + this.AssignedIndex);		
			
	PluginAPIMgr.SetAssignedPhoneNumber(this.SkypeName,this.AssignedIndex,null,null);	    		

	this.processReturnKey();
}

SceneChangePhoneNumber.prototype.closeCountryList = function() {
//	this.CountryListHelpBar.hiddenObj();

	sf.scene.focus('ChangePhoneNumber');
	sf.scene.hide('CountryFlagList');

}

SceneChangePhoneNumber.prototype.checkOkBtnEnable = function() {
	alert("SceneChangePhoneNumber.checkOkBtnEnable() ");
	var input_phone_number = this.PhoneNumberInputBox.GetText();
	if(input_phone_number.length > 0) {
		var add_prefix_phone_number = this.addCountryPrefix(input_phone_number);
		alert("add_prefix_phone_number : " + add_prefix_phone_number);
		this.NormalizedPhoneNumber = PluginAPIMgr.NormalizeIdentity(add_prefix_phone_number);
		if(this.NormalizedPhoneNumber.length > 0) {
			var is_emergency_call = PluginAPIMgr.IsEmergencyCall(this.NormalizedPhoneNumber);
			if(is_emergency_call == 1) {
				this.OkBtn.SetFlagDim(true);
			} else {
				this.OkBtn.SetFlagDim(false);
			}
		} else {
			this.OkBtn.SetFlagDim(true);
		}
	} else {
			this.OkBtn.SetFlagDim(true);
	}
}

SceneChangePhoneNumber.prototype.ChangeHelpbar = function(type,str) {
	var dataInfo="";
	if(str){
		dataInfo = str;
	}else{
		switch(type){
			case 0:
				dataInfo = {
					'return' : SID_RETURN
				};
				break;
			case 1:
				dataInfo = {
			'ff' : SID_NUMBER,
					'play' : SID_DELETE, //not support
			'return' : SID_RETURN
		};
				break;
			case 2:
				dataInfo = {
			'ff' : SID_NUMBER,
					'stop' : "+",
			'return' : SID_RETURN
		};
				break;
			case 3:
				dataInfo = {
					'ff' : SID_NUMBER,
			'return' : SID_RETURN
		};
				break;
		}
	}
	if(dataInfo.length!=0)
		this.ChangePhoneNumberPopupView.SetHelpbarContentsOfPopupBG(dataInfo);
}


