function SceneChangePictureConfirm(options) {

	this.options = options;

	this.ChangePictureConfirmView = null;
	this.ChangePictureConfirmViewBG = null;
	this.ChangePictureConfirmDim = null;

	this.ThumbnailBox = null;
	this.BodyMsg = null;
	this.YesBtn = null;
	this.NoBtn = null;

	this.AvatarImg = null;


	//timer

}

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

SceneChangePictureConfirm.prototype.handleShow = function() {
	alert("SceneChangePictureConfirm.handleShow()");
	this.ChangePictureConfirmDim.show();
	this.SetData();

	WndMgr.startPopupHideTimer(60000);

}

SceneChangePictureConfirm.prototype.handleHide = function() {
	alert("SceneChangePictureConfirm.handleHide()");
	this.ChangePictureConfirmDim.hide();

	WndMgr.stopPopupHideTimer();

}

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

	var currentHighlight = this.ChangePictureConfirmView.getCurrentHighlight();

	if(currentHighlight == null) {
		this.highlight(this.YesBtn);
	} else {
		this.highlight(currentHighlight);
	}
}

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

SceneChangePictureConfirm.prototype.handleKeyDown = function(keyCode) {

	alert("SceneChangePictureConfirm.handleKeyDown(" + keyCode + ")");
	PluginAPIMgr.PlayAudio(keyCode);
	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	switch (keyCode) {
		case sf.key.LEFT:
		case sf.key.RIGHT:
			WndMgr.resetPopupHideTimer();
			this.processLEFTKey();
			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
		case 261:
		//contents
		case 115:
			//wiselink
			ProcMgr.processInfolinkKey();
			break;
	}

}
///////////////////////////////////////////////////////////////////////////////////////////////////////////

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

	this.ChangePictureConfirmView = new View("ChangePictureConfirm");
	this.ChangePictureConfirmViewBG = new View("ChangePictureConfirmBG");
	this.ChangePictureConfirmViewBG.CreatePopupBG(0, "ChangePictureConfirm_popup_BG");
	this.ChangePictureConfirmDim = new DimBg("ChangePictureConfirmDim", "ChangePictureConfirm");
	this.ChangePictureConfirmViewBG.SetTitleTextofPopupBG(TV_SID_CHANGE_PICTURE);

	this.ThumbnailBox = new CompBase();
	this.ThumbnailBox.CreateBG("pictureConfirm_Box");
	this.ThumbnailBox.SetBGImage(g_Image.IMAGE_CHANGE_PICTURE_LARGE_THUMB_HIGHLIGHT);
	this.ThumbnailBox.AddJPGImageLayer("pictureConfirm_Avatar");

	this.BodyMsg = new TextLayer("pictureConfirm_Msg");
	this.BodyMsg.SetText(TV_SID_SET_THIS_PICTURE_AS_YOUR_CONTACTS_WILL_SEE);

	var CurLangID = ResMgr.GetCurLanguage();

	if(CurLangID == ENUM_TV_LANGUAGE.THA) {
		$("#pictureConfirm_Msg").css('word-break', "break-all");
	}

	var scene = sf.scene.get("ChangePictureConfirm");

	this.YesBtn = new Button();
	this.YesBtn.SetImageObjId("pictureConfirm_YesButton", 20);
	this.YesBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
	this.YesBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);
	this.YesBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_POPUP_BTN_DIM);
	this.YesBtn.SetTextObjId("pictureConfirm_YesButtonText");
	this.YesBtn.SetText(SID_YES);
	this.YesBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.YesBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.YesBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.YesBtn.SetOnClickCallbackFunc(function() {
		scene.ClickYesBtn();
	});

	this.NoBtn = new Button();
	this.NoBtn.SetImageObjId("pictureConfirm_NoButton", 20);
	this.NoBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
	this.NoBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);
	this.NoBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_POPUP_BTN_DIM);
	this.NoBtn.SetTextObjId("pictureConfirm_NoButtonText");
	this.NoBtn.SetText(SID_NO);
	this.NoBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.NoBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.NoBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.NoBtn.SetOnClickCallbackFunc(function() {
		scene.processReturnKey();
	});
	this.YesBtn.SetOnMouseOverCallbackFunc(function(obj) {
		scene.processMouseOver(obj);
	});
	this.NoBtn.SetOnMouseOverCallbackFunc(function(obj) {
		scene.processMouseOver(obj);
	});

}

SceneChangePictureConfirm.prototype.processMouseOver = function(obj) {
	var currentHighlight = this.ChangePictureConfirmView.getCurrentHighlight();
	if(currentHighlight != obj) {
		this.highlight(obj);
	}
	WndMgr.resetPopupHideTimer();
}
SceneChangePictureConfirm.prototype.SetData = function() {
	this.ThumbnailBox.SetImageLayer(1, this.AvatarImg + g_Data.GetImgSuffixPath());
}

SceneChangePictureConfirm.prototype.SetAvatarPath = function(ImgPath) {

	this.AvatarImg = ImgPath;
}

SceneChangePictureConfirm.prototype.highlight = function(obj) {

	//alert("SceneChangePictureConfirm.highlight()");
	this.ChangePictureConfirmView.setCurrenHighlight(obj);

}

SceneChangePictureConfirm.prototype.processEnterKey = function() {
	//alert("SceneChangePictureConfirm.processEnterKey() ");

	alert("processEnterKey >>> AvatarImg =" + this.AvatarImg);

	var currentHighlight = this.ChangePictureConfirmView.getCurrentHighlight();

	if(currentHighlight == this.YesBtn) {

		this.ClickYesBtn();
	} else if(currentHighlight == this.NoBtn) {
		this.processReturnKey();
	}

}

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

	this.highlight(null);
	sf.scene.hide('ChangePictureConfirm');
	StateMgr.Start_Change_Picture_State();

}

SceneChangePictureConfirm.prototype.processLEFTKey = function() {
	alert("SceneChangePictureConfirm.processLEFTKey() ");

	var currentHighlight = this.ChangePictureConfirmView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.YesBtn:
			this.highlight(this.NoBtn);
			break;

		case this.NoBtn:
			this.highlight(this.YesBtn);
			break;
	}

}

SceneChangePictureConfirm.prototype.ClickYesBtn = function() {

	sf.scene.get("ChangePicture").ResetLastIndex();
	ProcMgr.SetAvatar(this.AvatarImg);
	sf.scene.get("ListMainProfile").SetPictureImg(PluginAPIMgr.GetMyAvataImageForMain());
	sf.scene.get("ListMain").updateAvata();
	sf.scene.hide('ChangePictureConfirm');
	WndMgr.ReturnMain();
}