var PHONE_TYPE = {
	HOME : 1,
	OFFICE : 2,
	MOBILE : 3,
	OTHER : 4
}
function SceneProfilePhoneNumberSet(options) {
	this.options = options;

	this.ProfilePhoneNumberSetView = null;
	this.ProfilePhoneNumberSetViewBg = null;
	this.ProfilePhoneNumberSetDim = null;

	this.PhoneNumberInputBox = null;
	this.CountryCodeBtn = null;
	this.CountryNameLabel = null;
	this.CountryPrefixLabel = null;
	
	this.SaveBtn = null;
	this.CancelBtn = null;

	this.CountryCode = null;
	this.CountryPrefix = "";

	this.Init_PhoneNumber = "";
	this.Init_PhoneLocalNumber = "";
	this.Init_PhoneCountryCode = "";
	this.Init_PhoneLocalCode = "";

	this.IsChangeCountryCode = false;
	this.IsChangePhoneNumber = false;
	this.ShownCountryList = false;

	this.PhoneType = PHONE_TYPE.HOME;
	this.IsEnableSaveBtn = true;
	
	this.addedprefix =false;
}

SceneProfilePhoneNumberSet.prototype.initialize = function() {
	alert("SceneProfilePhoneNumberSet.initialize()");

	this.create();
}

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

	this.ProfilePhoneNumberSetDim.show();
	this.InitProfilePhoneNumberSet();

	this.IsChangeCountryCode = false;
	this.IsChangePhoneNumber = false;
	this.setSaveBtnEnable(false);

	WndMgr.startPopupHideTimer(60000);
}

SceneProfilePhoneNumberSet.prototype.handleHide = function() {
	alert("SceneProfilePhoneNumberSet.handleHide()");

	WndMgr.stopPopupHideTimer();

	//hide flag list
	if(this.ShownCountryList == true) {
		sf.scene.hide('CountryFlagList');
		this.ShownCountryList = false;
	}

	this.highlight(null);
	this.PhoneType = null;
	this.ProfilePhoneNumberSetDim.hide();
}

SceneProfilePhoneNumberSet.prototype.handleFocus = function() {
	alert("SceneProfilePhoneNumberSet.handleFocus()");

	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();
	if(currentHighlight == null) {
		if(this.IsEnableSaveBtn == false) {
			this.highlight(this.PhoneNumberInputBox);
		} else {
			this.highlight(this.CancelBtn);
		}
	} else {
		this.highlight(currentHighlight);
	}

	this.ShownCountryList = false;
}

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

	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();

	if(currentHighlight != null) {
		currentHighlight.blur();
	}

}

SceneProfilePhoneNumberSet.prototype.handleKeyDown = function(keyCode) {
	alert("SceneProfilePhoneNumberSet.handleKeyDown(" + keyCode + ")");
	PluginAPIMgr.PlayAudio(keyCode);
	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	switch (keyCode) {
		case sf.key.LEFT:
			WndMgr.resetPopupHideTimer();
			this.processLeftKey();
			break;

		case sf.key.RIGHT:
			WndMgr.resetPopupHideTimer();
			this.processRightKey();
			break;

		case sf.key.UP:
			WndMgr.resetPopupHideTimer();
			this.processUpKey();
			break;

		case sf.key.DOWN:
			WndMgr.resetPopupHideTimer();
			this.processDownKey();
			break;

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

		case sf.key.RETURN:
		case sf.key.EXIT:
			this.processReturnKey();
			sf.key.preventDefault();
			break;

		case 147:
			//infolink
			sf.key.preventDefault();
			break;
	}
}

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

	StateMgr.Stop_ProfilePhoneNumberSet_State(true);

	//Check.... add callback function
}

SceneProfilePhoneNumberSet.prototype.processEnterKey = function() {
	alert("SceneProfilePhoneNumberSet.processEnterKey() ");

	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.CountryCodeBtn:
			this.showCountryList();
			break;
		case this.PhoneNumberInputBox:
			break;
		case this.SaveBtn:
			this.SavePhoneNumber();
			break;
		case this.CancelBtn:
			this.processReturnKey();
			break;

	}
}

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

	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.PhoneNumberInputBox:
			this.highlight(this.CountryCodeBtn);
			break;
		case this.CountryCodeBtn:
			break;
		case this.SaveBtn:
			break;
		case this.CancelBtn:
			if(this.IsEnableSaveBtn)
				this.highlight(this.SaveBtn);
			break;

	}
}

SceneProfilePhoneNumberSet.prototype.processRightKey = function() {
	alert("SceneProfilePhoneNumberSet.processRightKey() ");

	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.CountryCodeBtn:
			this.highlight(this.PhoneNumberInputBox);
			break;
		case this.PhoneNumberInputBox:
			break;
		case this.SaveBtn:
			this.highlight(this.CancelBtn);
			break;
		case this.CancelBtn:
			break;
	}
}
SceneProfilePhoneNumberSet.prototype.processUpKey = function() {
	alert("SceneProfilePhoneNumberSet.processUpKey() ");

	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();

	if(currentHighlight == this.SaveBtn) {
		this.highlight(this.CountryCodeBtn);
	} else if(currentHighlight == this.CancelBtn)
		this.highlight(this.PhoneNumberInputBox);

}

SceneProfilePhoneNumberSet.prototype.processDownKey = function() {
	alert("SceneProfilePhoneNumberSet.processDownKey() ");

	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();

	if(currentHighlight == this.PhoneNumberInputBox) {
		this.highlight(this.CancelBtn);
	} else if(currentHighlight == this.CountryCodeBtn) {
		if(this.IsEnableSaveBtn == false) {
			this.highlight(this.CancelBtn);
		} else {
			this.highlight(this.SaveBtn);
		}
	}
}

SceneProfilePhoneNumberSet.prototype.processClickEvent = function(obj) {
	alert("SceneProfilePhoneNumberSet.processClickEvent() ");
	WndMgr.resetPopupHideTimer();
	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();
	if(currentHighlight != obj) {
		this.highlight(obj);
	}
	if(obj != this.PhoneNumberInputBox)
		this.processEnterKey();
}

SceneProfilePhoneNumberSet.prototype.processMouseOver = function(obj) {
	var currentHighlight = this.ProfilePhoneNumberSetView.getCurrentHighlight();
	//add : smartcontrol highlight issue(130926)
	if(PluginAPIMgr.FlagSmartControlNumber()==1){
		return;
	}
	if(currentHighlight != obj) {
		this.highlight(obj);
	}
	WndMgr.resetPopupHideTimer();
}
SceneProfilePhoneNumberSet.prototype.highlight = function(obj) {
	alert("SceneProfilePhoneNumberSet.highlight() ");
	this.ProfilePhoneNumberSetView.setCurrenHighlight(obj);
	switch(obj) {
		case this.PhoneNumberInputBox:
			break;
		case this.CountryCodeBtn:
		case this.SaveBtn:
		case this.CancelBtn:
			this.ChangeHelpbar(0);
			break;
	}
}

SceneProfilePhoneNumberSet.prototype.comebackCallScene = function() {
	alert("SceneProfilePhoneNumberSet.comebackCallScene() ");
////////////????????????????????????
}

SceneProfilePhoneNumberSet.prototype.showCountryList = function() {
	alert("SceneProfilePhoneNumberSet.showCountryList() ");
	
	var Index = g_Data.GetCountryIndexWithCode(this.Init_PhoneCountryCode);
	sf.scene.get("CountryFlagList").Init(FLAG_LIST_TYPE.LIST_MAIN_CALL, 'ProfilePhoneNumberSet', this.SetCountryList, null);
	sf.scene.get("CountryFlagList").SetCurIndex(Index);
	sf.scene.show('CountryFlagList');

	setTimeout("CancelTimerCF()", 0);
	CancelTimerCF = function() {
		sf.scene.focus('CountryFlagList');
	}
	this.ShownCountryList = true;
}

SceneProfilePhoneNumberSet.prototype.SetCountryList = function() {
	alert("SceneProfilePhoneNumberSet.SetCountryList() ");

	var Scene = sf.scene.get("CountryFlagList");
	var this_ = sf.scene.get("ProfilePhoneNumberSet");
	var FlagImage = this.GetCountryFlag();
	var CountryCode = this.GetCountryCode();
	var Prefix = this.GetPrefix();
	var CountryName = Scene.GetCountryName();

	this_.SetCountryData(CountryCode, Prefix, CountryName, FlagImage);
}

SceneProfilePhoneNumberSet.prototype.SetCountryData = function(code, prefix, name, flagImage) {
	this.CountryPrefix = prefix;
	//Set UI
	if(code != this.Init_PhoneCountryCode) {
		this.IsChangeCountryCode = true;
		this.Init_PhoneCountryCode = code;
	} else
		this.IsChangeCountryCode = false;
	this.CountryCodeBtn.SetFgImage(flagImage);
	this.CountryPrefixLabel.SetText(prefix);
	this.CountryNameLabel.SetText(name);

	this.IsChange("COUNTRYCODE");
}

SceneProfilePhoneNumberSet.prototype.SavePhoneNumber = function() {
	alert("SceneProfilePhoneNumberSet.SavePhoneNumber()");
	var input_number = this.PhoneNumberInputBox.GetText();
	var profile_ = sf.scene.get("ListMainProfile");
	var phoneNumber = this.GetPhoneNumber(input_number);
	if(this.addedprefix==false){
		this.Init_PhoneCountryCode = "";
	}else{
		this.Init_PhoneCountryCode =	PluginAPIMgr.FindCountryCodeByNumber(phoneNumber);
	}
	if(phoneNumber!=null){
		switch(this.PhoneType) {
			case PHONE_TYPE.HOME:
				PluginAPIMgr.SetHomePhone(phoneNumber);
				profile_.SetHomePhone(phoneNumber);
				//alert("KJY : this.CountryCode = "+this.CountryCode);
				profile_.SetHomePhoneCountryCode(this.Init_PhoneCountryCode);
				if(phoneNumber.length == 0)
					profile_.SetHomePhoneCountryCode("");
	
				break;
			case PHONE_TYPE.OFFICE:
				PluginAPIMgr.SetOfficePhone(phoneNumber);
				profile_.SetOfficePhone(phoneNumber);
				profile_.SetOfficePhoneCountryCode(this.Init_PhoneCountryCode);
				if(phoneNumber.length == 0)
					profile_.SetOfficePhoneCountryCode("");
	
				break;
			case PHONE_TYPE.MOBILE:
				PluginAPIMgr.SetMobilePhone(phoneNumber);
				profile_.SetMobilePhone(phoneNumber);
				profile_.SetMobilePhoneCountryCode(this.Init_PhoneCountryCode);
				if(phoneNumber.length == 0)
					profile_.SetMobilePhoneCountryCode("");
				break;
			case PHONE_TYPE.OTHER:
				break;
		}
	}
	this.processReturnKey();
}
SceneProfilePhoneNumberSet.prototype.GetPhoneNumber = function(input_number) {
	this.addedprefix =false;
	if(input_number != null && input_number.length > 0) {
		if(input_number.indexOf("+") == 0) {
			this.addedprefix =true;
			return input_number;
		} else if(input_number.indexOf("00") == 0) {
			return input_number;
		} else if(input_number.indexOf("011") == 0) {
			return input_number;
		} else {
			if(this.CountryPrefix != "0") {
				this.addedprefix =true;
				return "+" + this.CountryPrefix + input_number;
			} else {
				return input_number;
			}
		}
	} else {
		return input_number;
	}
}
SceneProfilePhoneNumberSet.prototype.IsChange = function(caller) {
	alert("SceneProfilePhoneNumberSet.IsChange() ");
	switch(caller) {
		case "PHONE":
			if((this.PhoneNumberInputBox.GetText() != this.Init_PhoneLocalCode) || this.IsChangeCountryCode) {
				this.setSaveBtnEnable(true);
				this.IsChangePhoneNumber = true;
			} else {
				this.setSaveBtnEnable(false);
				this.IsChangePhoneNumber = false;
			}
			break;
		case "COUNTRYCODE":
			if(this.IsChangeCountryCode || this.IsChangePhoneNumber)
				this.setSaveBtnEnable(true);
			else
				this.setSaveBtnEnable(false);
			break;
	}
}

SceneProfilePhoneNumberSet.prototype.setSaveBtnEnable = function(flag_enable) {
	alert("SceneProfilePhoneNumberSet.setSaveBtnEnable() : " + flag_enable);
	if(flag_enable == true) {
		this.SaveBtn.SetFlagDim(false);
		this.IsEnableSaveBtn = true;
	} else if(flag_enable == false) {
		this.SaveBtn.SetFlagDim(true);
		this.IsEnableSaveBtn = false;
	}
}


SceneProfilePhoneNumberSet.prototype.ChangeHelpbar = function(type,str) {
	alert("SceneProfilePhoneNumberSet.prototype.ChangeHelpbar");
	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;
		}
	}
	if(dataInfo.length!=0)
		this.ProfilePhoneNumberSetViewBg.SetHelpbarContentsOfPopupBG(dataInfo);
}
/*
		
SceneProfilePhoneNumberSet.prototype.checkHelpbarForInputBox = function(){
	alert("SceneProfilePhoneNumberSet.checkHelpbarForInputBox()");
	var posOfCaret = this.PhoneNumberInputBox.GetPosOfCaret();
	if(posOfCaret==0){		//no string '+' : show, delete : hide
		this.ChangeHelpbar(2);
	}else{						//exist string -> '+' : hide, delete : show						
		this.ChangeHelpbar(1);
	}
}*/


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

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

	this.ProfilePhoneNumberSetViewBg = new View("ProfilePhoneNumberSetBg");
	this.ProfilePhoneNumberSetViewBg.CreatePopupBG(0, "ProfilePhoneNumberSetBg");

	this.ProfilePhoneNumberSetView = new View("ProfilePhoneNumberSet");
	this.ProfilePhoneNumberSetDim = new DimBg("ProfilePhoneNumberSetDim", "ProfilePhoneNumberSetBG");

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

	this.CountryCodeBtn = new Button();
	this.CountryCodeBtn.SetImageObjId("phonenumberset_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.SetBgImage(BtnImgIndex.BTN_TEXT_DIM_STYLE, g_Image.IMAGE_POPUP_BTN_DIM);

	this.CountryCodeBtn.SetIconObjId("phonenumberset_country_code_btn_arrow");
	this.CountryCodeBtn.SetBgIcon(0, g_Image.IMAGE_POPUP_BTN_ARROW_DOWN);
	this.CountryCodeBtn.SetBgIcon(1, g_Image.IMAGE_POPUP_BTN_ARROW_DOWN);
	this.CountryCodeBtn.AppendFgImage("phonenumberset_country_code_btn_icon");
	this.CountryCodeBtn.SetOnClickCallbackFunc(clickCF);

	this.CountryPrefixLabel= new Label(null, "phonenumberset_country_prefix_label");
	this.CountryPrefixLabel.SetTextStyle("phonenumberset_country_name_label_style");
	this.CountryNameLabel = new Label(null, "phonenumberset_country_name_label");
	this.CountryNameLabel.SetTextStyle("phonenumberset_country_name_label_style");

	this.PhoneNumberInputBox = new NumberInputBox();
	this.PhoneNumberInputBox.SetButtonObjId("phonenumberset_input_box", 30);
	this.PhoneNumberInputBox.SetButtonTextObjId("phonenumberset_input_box_text");
	this.PhoneNumberInputBox.SetInputBoxObjId("phonenumberset_input_box_editor");
	//this.PhoneNumberInputBox.setFlagPhoneNumber(true);
	this.PhoneNumberInputBox.setMaxLength(30);
	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_.processLeftKey();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnRightFunc(function() {
		this_.processRightKey();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnDownFunc(function() {
		this_.processDownKey();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnUpFunc(function() {
		this_.processUpKey();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setPrevEventOnReturnFunc(function() {
		this_.processReturnKey();
	});
	this.PhoneNumberInputBox.setPrevEventOnExitFunc(function() {
		this_.processReturnKey();
	});
	this.PhoneNumberInputBox.setEnterFunc(function() {
		this_.processEnterKey();
		WndMgr.resetPopupHideTimer();
	});
	this.PhoneNumberInputBox.setAnyKeyFunc(function(keyCode) {
		this_.IsChange("PHONE");
		//this_.checkHelpbarForInputBox();
		WndMgr.resetPopupHideTimer();
	});
	
	this.PhoneNumberInputBox.SetOnClickCallbackFunc(clickCF);
	this.PhoneNumberInputBox.SetReverseDisable(true);
	this.PhoneNumberInputBox.SetHelpbarChangeEnable("ProfilePhoneNumberSet");

	this.SaveBtn = new Button();
	this.SaveBtn.SetImageObjId("phonenumberset_save_btn", 20);
	this.SaveBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
	this.SaveBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);
	this.SaveBtn.SetBgImage(BtnImgIndex.BTN_TEXT_DIM_STYLE, g_Image.IMAGE_POPUP_BTN_DIM);

	this.SaveBtn.SetTextObjId("phonenumberset_save_btn_text");
	this.SaveBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.SaveBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.SaveBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.SaveBtn.SetText(SID_SAVE);
	this.SaveBtn.SetOnClickCallbackFunc(clickCF);

	this.CancelBtn = new Button();
	this.CancelBtn.SetImageObjId("phonenumberset_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.SetBgImage(BtnImgIndex.BTN_TEXT_DIM_STYLE, g_Image.IMAGE_POPUP_BTN_DIM);

	this.CancelBtn.SetTextObjId("phonenumberset_cancel_btn_text");
	this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.CancelBtn.SetText(SID_CANCEL);
	this.CancelBtn.SetOnClickCallbackFunc(clickCF);

	this.CountryCode = PluginAPIMgr.GetMyCountryCode();
	this.CountryCodeBtn.SetFgImage(PluginAPIMgr.GetMyCountryFlag());
	var CountryName = PluginAPIMgr.GetISOCountryName(this.CountryCode);
	this.CountryPrefix = PluginAPIMgr.GetISOCountryPrefix(this.CountryCode);
	if(this.CountryPrefix != null && this.CountryPrefix.length > 0 && this.CountryPrefix != "0")
		var prefix = "+" + this.CountryPrefix;
	else
		var prefix = "";
	this.CountryPrefixLabel.SetText(prefix);
	this.CountryNameLabel.SetText(CountryName);
	
	this.PhoneNumberInputBox.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.CountryCodeBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.SaveBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.CancelBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	
}

SceneProfilePhoneNumberSet.prototype.InitProfilePhoneNumberSet = function() {
	alert("SceneProfilePhoneNumberSet.InitProfilePhoneNumberSet()");
	var profile_ = sf.scene.get("ListMainProfile");
	this.PhoneType = profile_.GetPhoneType();
	var title = "";
	switch(this.PhoneType){
		case PHONE_TYPE.HOME:
			title = IDWS_MOIP_HOME_PHONE;
			this.Init_PhoneNumber = profile_.GetHomePhone();
			this.Init_PhoneCountryCode = profile_.GetHomePhoneCountryCode();
			break;
		case PHONE_TYPE.OFFICE:
			title = IDWS_MOIP_OFFICE_PHONE;
			this.Init_PhoneNumber = profile_.GetOfficePhone();
			this.Init_PhoneCountryCode = profile_.GetOfficePhoneCountryCode();
			break;
		case PHONE_TYPE.MOBILE:
			title = IDWS_MOIP_MOBILE_PHONE;
			this.Init_PhoneNumber = profile_.GetMobilePhone();
			this.Init_PhoneCountryCode = profile_.GetMobilePhoneCountryCode();
			break;
	}
	if(this.Init_PhoneCountryCode == null || this.Init_PhoneCountryCode.length == 0) {
		this.Init_PhoneCountryCode = this.CountryCode;
	}
	this.ProfilePhoneNumberSetViewBg.SetTitleTextofPopupBG(title);

	if(this.Init_PhoneNumber != null && this.Init_PhoneNumber.length >= 0)
		this.Init_PhoneLocalCode = PluginAPIMgr.GetLocalNumber(this.Init_PhoneNumber);
	if(this.Init_PhoneLocalCode != null && this.Init_PhoneLocalCode.length >= 0)
		this.PhoneNumberInputBox.setInitString(this.Init_PhoneLocalCode);
	
	this.CountryCodeBtn.SetFgImage(g_Image.base_flag_image_path + this.Init_PhoneCountryCode.toUpperCase() + ".png");

	var CountryName = PluginAPIMgr.GetISOCountryName(this.Init_PhoneCountryCode);
	this.CountryNameLabel.SetText(CountryName);

	this.CountryPrefix = PluginAPIMgr.GetISOCountryPrefix(this.Init_PhoneCountryCode);
	if(this.CountryPrefix != null && this.CountryPrefix.length > 0 && this.CountryPrefix != "0")
		var prefix = "+" + this.CountryPrefix;
	else
		var prefix = "";
	this.CountryPrefixLabel.SetText(prefix);
	this.CountryNameLabel.SetText(CountryName);
}