function SceneSettingsVoicemail(options) {
	this.options = options;
	this.sceneId = "SettingsVoicemail";
	this.SettingsVoicemailDim = null;
	this.SettingsVoicemailView = null;
	this.SettingsVoicemailBG = null;
	this.OfflineLabel = null;
	this.VoicemailSettingLabel = null;
	this.RespondLabel = null;
	this.SecLabel = null;
	this.RejectLabel = null;
	this.BusyLabel = null;
	this.AttentionLabel = null;

	this.OfflineBtn = null;
	this.RespondBox = null;
	this.RejectBtn = null;
	this.BusyBtn = null;
	this.Init_Offline = null;
	this.Init_Respond = null;
	this.Init_Reject = null;
	this.Init_Busy = null;

	this.IsChangeOffline = false;
	this.IsChangeRespond = false;
	this.IsChangeReject = false;
	this.IsChangeBusy = false;

	this.SaveBtn = null;
	this.CancelBtn = null;
	this.BeforeBtn = null;

	this.IsEnableSaveBtn = true;
	this.ShownOnOffSubList = false;
	
	this.IsEnable = true;
}

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

SceneSettingsVoicemail.prototype.handleShow = function() {
	alert("SceneSettingsVoicemail.handleShow()");
	// this function will be called when the scene manager show this scene
	this.SettingsVoicemailDim.show();
	this.InitBase();
	this.InitVoicemail();
	this.setSaveBtnEnable(false);
	WndMgr.startPopupHideTimer(60000);
}
SceneSettingsVoicemail.prototype.handleFocus = function() {
	alert("SceneSettingsVoicemail.handleFocus()");
	// this function will be called when the scene manager focus this scene
	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	if(currentHighlight != null)
		this.highlight(currentHighlight);
	else{
		this.highlight(this.OfflineBtn);
		this.ChangeHelpbar(0);
	}
		

	this.ShownOnOffSubList = false;
}

SceneSettingsVoicemail.prototype.handleHide = function() {
	alert("SceneSettingsVoicemail.handleHide()");
	// this function will be called when the scene manager hide this scene
	if(this.ShownOnOffSubList) {
		WndMgr.HideSettingsOnOffSubList();
	}
	this.SettingsVoicemailDim.hide();
	this.highlight(null);
	WndMgr.stopPopupHideTimer();
}

SceneSettingsVoicemail.prototype.handleBlur = function() {
	alert("SceneSettingsVoicemail.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene
	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	if(currentHighlight != null) {
		currentHighlight.blur();
	}
	/*
	if(this.ShownOnOffSubList) {
		this.setSaveBtnEnable(false);
		}*/
	
}

SceneSettingsVoicemail.prototype.handleKeyDown = function(keyCode) {
	alert("SceneSettingsVoicemail.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.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
		case 261:
		//contents
		case 115:
			//wiselink
			//ProcMgr.processInfolinkKey();
			break;
	}
}

SceneSettingsVoicemail.prototype.processReturnKey = function() {
	alert("SceneSettingsVoicemail.processReturnKey() ");
	StateMgr.Stop_SettingsVoicemail_State(true);
}

SceneSettingsVoicemail.prototype.processMouseOver = function(obj) {
	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	if(currentHighlight != obj) {
		this.highlight(obj);
	}
	WndMgr.resetPopupHideTimer();
}

SceneSettingsVoicemail.prototype.highlight = function(obj) {
	this.SettingsVoicemailView.setCurrenHighlight(obj);
	switch(obj){
		case this.RespondBox:
			this.ChangeHelpbar(1);
			break;
		default:
			this.ChangeHelpbar(0);
			break;
	}
}

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

	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	if(currentHighlight != obj) {
		this.highlight(obj);
		if(obj!=this.RespondBox)
			this.processEnterKey();
	}else
		this.processEnterKey();
}
SceneSettingsVoicemail.prototype.processUpKey = function() {
	alert("SceneSettingsVoicemail.processUpKey()");
	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.OfflineBtn:
			break;
		case this.RespondBox:
			this.highlight(this.OfflineBtn);
			break;
		case this.RejectBtn:
			this.highlight(this.RespondBox);
			break;
		case this.BusyBtn:
			this.highlight(this.RejectBtn);
			break;
		case this.SaveBtn:
			break;
		case this.CancelBtn:
			if(this.IsEnableSaveBtn == true)
				this.highlight(this.SaveBtn);
			break;
	}
}
SceneSettingsVoicemail.prototype.processDownKey = function() {
	alert("SceneSettingsVoicemail.processDownKey()");
	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.OfflineBtn:
			if(this.IsEnable)
				this.highlight(this.RespondBox);
			break;
		case this.RespondBox:
			this.highlight(this.RejectBtn);
			break;
		case this.RejectBtn:
			this.highlight(this.BusyBtn);
			break;
		case this.BusyBtn:
			break;
		case this.SaveBtn:
			this.highlight(this.CancelBtn);
			break;
		case this.CancelBtn:
			break;
	}
}
SceneSettingsVoicemail.prototype.processLeftKey = function() {
	alert("SceneSettingsVoicemail.processLeftKey()");
	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.OfflineBtn:
			break;
		case this.RespondBox:
			break;
		case this.RejectBtn:
			break;
		case this.BusyBtn:
			break;
		case this.SaveBtn:
			if(this.BeforeBtn && this.IsEnable)
				this.highlight(this.BeforeBtn);
			else
				this.highlight(this.OfflineBtn);
			break;
		case this.CancelBtn:
			if(this.IsEnable == true) {
				if(this.BeforeBtn)
					this.highlight(this.BeforeBtn);
				else
					this.highlight(this.BusyBtn);
			}else{
				this.highlight(this.OfflineBtn);
			}
			break;
	}
}

SceneSettingsVoicemail.prototype.processRightKey = function() {
	alert("SceneSettingsVoicemail.processRightKey()");
	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.OfflineBtn:
			this.BeforeBtn = this.OfflineBtn;
			if(this.IsEnableSaveBtn == true)
				this.highlight(this.SaveBtn);
			else
				this.highlight(this.CancelBtn);
			break;
		case this.RespondBox:
			this.BeforeBtn = this.RespondBox;
			if(this.IsEnableSaveBtn == true)
				this.highlight(this.SaveBtn);
			else
				this.highlight(this.CancelBtn);
			break;
		case this.RejectBtn:
			this.BeforeBtn = this.RejectBtn;
			if(this.IsEnableSaveBtn == true)
				this.highlight(this.SaveBtn);
			else
				this.highlight(this.CancelBtn);
			break;
		case this.BusyBtn:
			this.BeforeBtn = this.BusyBtn;
			if(this.IsEnableSaveBtn == true)
				this.highlight(this.SaveBtn);
			else
				this.highlight(this.CancelBtn);
			break;
		case this.SaveBtn:
			break;
		case this.CancelBtn:
			break;
	}
}
SceneSettingsVoicemail.prototype.processEnterKey = function() {
	alert("SceneSettingsVoicemail.processEnterKey()");

	var currentHighlight = this.SettingsVoicemailView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.OfflineBtn:
			this.ShownOnOffSubList = true;
			WndMgr.StartSettingsOnOffSubList(this.OfflineBtn, this.sceneId, this.SettingsVoicemailView, this.OfflineBtnCallBack, this.OfflineBtn.GetText());
			break;
		case this.RespondBox:
			break;
		case this.RejectBtn:
			this.ShownOnOffSubList = true;
			WndMgr.StartSettingsOnOffSubList(this.RejectBtn, this.sceneId, this.SettingsVoicemailView, this.RejectBtnCallBack, this.RejectBtn.GetText());
			break;
		case this.BusyBtn:
			this.ShownOnOffSubList = true;
			WndMgr.StartSettingsOnOffSubList(this.BusyBtn, this.sceneId, this.SettingsVoicemailView, this.BusyBtnCallBack, this.BusyBtn.GetText());
			break;
		case this.SaveBtn:
			this.SaveVoicemail();
			break;
		case this.CancelBtn:
			this.processReturnKey();
			break;
	}
}
SceneSettingsVoicemail.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.SettingsVoicemailBG.SetHelpbarContentsOfPopupBG(dataInfo);
}
SceneSettingsVoicemail.prototype.SaveSuccess = function() {
	alert("SceneSettingsVoicemail.SaveSuccess");
	this.Init_Offline = this.OfflineBtn.GetText();
	this.Init_Respond = this.RespondBox.GetText();
	this.Init_Reject = this.RejectBtn.GetText();
	this.Init_Busy = this.BusyBtn.GetText();
	StateMgr.Stop_SettingsVoicemail_State(true);
}
SceneSettingsVoicemail.prototype.SaveVoicemail = function() {
	alert("SceneSettingsVoicemail.SaveVoicemail");
	var isChanged = false;

	if(this.IsEnable) {
		if(this.IsChangeOffline) {
			isChanged = true;
			PluginAPIMgr.SetVoicemailForward(this.OfflineBtn.GetText());
		}

		if(this.IsChangeReject) {
			isChanged = true;
			PluginAPIMgr.SetVoicemailForReject(this.RejectBtn.GetText());
		}
		if(this.IsChangeBusy) {
			isChanged = true;
			PluginAPIMgr.SetVoicemailInBusy(this.BusyBtn.GetText());
		}
		}
    //if(isChanged == true){
			PluginAPIMgr.SetVoicemailForward(this.OfflineBtn.GetText());
    PluginAPIMgr.SetVoicemailForReject(this.RejectBtn.GetText());
    PluginAPIMgr.SetVoicemailInBusy(this.BusyBtn.GetText());
    PluginAPIMgr.SetCallForwardTimer(this.RespondBox.GetText());

		WndMgr.SetCurrentPopupSceneId(this.sceneId);
		WndMgr.HideSettingsVoicemail();
		WndMgr.StartOneBottonPopup(OneBtnPopupIndex.OPTIONS_OK);
    //}

}
SceneSettingsVoicemail.prototype.enable = function() {
	alert("SceneSettingsVoicemail.enable");
	if(this.IsEnable == true)
		return;
	this.RespondBox.SetFlagDim(false);
	this.RejectBtn.SetFlagDim(false);
	this.BusyBtn.SetFlagDim(false);
	this.IsEnable = true;
}

SceneSettingsVoicemail.prototype.disable = function() {
	alert("SceneSettingsVoicemail.disable");
	if(this.IsEnable == false)
		return;
	this.RespondBox.SetFlagDim(true);
	this.RejectBtn.SetFlagDim(true);
	this.BusyBtn.SetFlagDim(true);
	this.IsEnable = false;
}
SceneSettingsVoicemail.prototype.setSaveBtnEnable = function(flag_enable) {
	alert("SceneSettingsVoicemail.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;
	}
}
SceneSettingsVoicemail.prototype.IsChange = function(caller) {
	alert("SceneSettingsVoicemail.IsChange() " + caller);
	switch(caller) {
		case "OFFLINE":
			if(this.IsChangeOffline) {
				this.setSaveBtnEnable(true);
			} else if(this.IsChangeOffline==false&&(this.IsChangeReject || this.IsChangeBusy || this.IsChangeRespond)) {
				this.setSaveBtnEnable(true);
			}else{
				this.setSaveBtnEnable(false);	
			}
			break;
		case "REJECT":
			if(this.IsChangeReject) {
				this.setSaveBtnEnable(true);
			} else if(this.IsChangeReject==false&&(this.IsChangeOffline || this.IsChangeBusy || this.IsChangeRespond)) {
				this.setSaveBtnEnable(true);
			}else{
				this.setSaveBtnEnable(false);	
			}
			break;
		case "BUSY":
			if(this.IsChangeBusy) {
				this.setSaveBtnEnable(true);
			} else if(this.IsChangeBusy==false&&(this.IsChangeOffline || this.IsChangeReject || this.IsChangeRespond)) {
				this.setSaveBtnEnable(true);
			}else{
				this.setSaveBtnEnable(false);	
			}
			break;
		case "RESPOND":
			if(this.Init_Respond != this.RespondBox.GetText()) {
				this.setSaveBtnEnable(true);
				this.IsChangeRespond = true;
			} else if(this.Init_Respond == this.RespondBox.GetText()&&(this.IsChangeOffline || this.IsChangeReject || this.IsChangeBusy)) {
				this.setSaveBtnEnable(true);
				this.IsChangeRespond = false;
			}else{
				this.setSaveBtnEnable(false);
				this.IsChangeRespond = false;
			}
			break;
	}
}
SceneSettingsVoicemail.prototype.OfflineBtnCallBack = function(text) {
	alert("SceneSettingsVoicemail.OfflineBtnCallBack()"+text);
	var this_ = sf.scene.get("SettingsVoicemail");
	if(this_.Init_Offline != text) {
		this_.IsChangeOffline = true;
	} else {
		this_.IsChangeOffline = false;
	}
	if(text === SID_OFF) {
		this_.disable();
	} else {
		this_.enable();
	}
	this_.RejectBtn.SetText(SID_OFF);
    this_.BusyBtn.SetText(SID_OFF);
    
    if(this_.Init_Reject != SID_OFF) {
        this_.IsChangeReject = true;
    } else {
        this_.IsChangeReject = false;
    }
    if(this_.Init_Busy != SID_OFF) {
        this_.IsChangeBusy = true;
    } else {
        this_.IsChangeBusy = false;
    }
	
	this_.IsChange("OFFLINE");
}
SceneSettingsVoicemail.prototype.RejectBtnCallBack = function(text) {
	alert("SceneSettingsVoicemail.RejectBtnCallBack()");
	var this_ = sf.scene.get("SettingsVoicemail");
	if(this_.Init_Reject != text) {
		this_.IsChangeReject = true;
	} else {
		this_.IsChangeReject = false;
	}
	this_.IsChange("REJECT");
}
SceneSettingsVoicemail.prototype.BusyBtnCallBack = function(text) {
	alert("SceneSettingsVoicemail.BusyBtnCallBack()");
	var this_ = sf.scene.get("SettingsVoicemail");
	if(this_.Init_Busy != text) {
		this_.IsChangeBusy = true;
	} else {
		this_.IsChangeBusy = false;
	}
	this_.IsChange("BUSY");
}
SceneSettingsVoicemail.prototype.InitBase = function() {
	alert("SceneSettingsVoicemail.InitBase");
	this.Init_Offline = PluginAPIMgr.GetVoicemailForward();
	this.Init_Reject = PluginAPIMgr.GetVoicemailForReject();
	this.Init_Busy = PluginAPIMgr.GetVoicemailInBusy();
	this.IsChangeOffline = false;
	this.IsChangeRespond = false;
	this.IsChangeReject = false;
	this.IsChangeBusy = false;
}

SceneSettingsVoicemail.prototype.InitVoicemail = function() {
	alert("SceneSettingsVoicemail.InitVoicemail");
	this.OfflineBtn.SetText(this.Init_Offline);
	this.Init_Respond = PluginAPIMgr.GetCallForwardTimer();
	this.RespondBox.SetText(this.Init_Respond);
	this.RejectBtn.SetText(this.Init_Reject);
	this.BusyBtn.SetText(this.Init_Busy);
	if(this.Init_Offline === SID_OFF)
		this.disable();
	else
		this.enable();
}

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

	this.SettingsVoicemailView = new View(this.sceneId);
	this.SettingsVoicemailBG = new View("SettingsVoicemailBG");
	this.SettingsVoicemailBG.CreatePopupBG(0, "SettingsVoicemail_popup_BG");
	this.SettingsVoicemailBG.CreateInnerBox("SettingsVoicemail_popup_innerbox");
	this.SettingsVoicemailBG.SetTitleTextofPopupBG(IDWS_MOIP_SKYPE_VOICEMAIL);
	this.SettingsVoicemailDim = new DimBg("SettingsVoicemailDim", "SettingsVoicemailBG");

	var this_ = sf.scene.get(this.sceneId);
	var clickCF = function(obj) {
		this_.processClickEvent(obj);
	}
	this.OfflineLabel = new TextLayer("settings_voicemail_offline_label");
	this.OfflineLabel.SetText(TV_SID_TAKE_VOICEMAIL_MESSAGE_OFFLINE_MSG);
	this.OfflineLabel.SetTextStyle("settings_voicemail_label_style");
	this.VoicemailSettingLabel = new TextLayer("settings_voicemail_setting_label");
	this.VoicemailSettingLabel.SetText(TV_SID_VOICE_MAIL_SETTING + " :");
	this.VoicemailSettingLabel.SetTextStyle("settings_voicemail_label_style");
	this.RespondLabel = new TextLayer("settings_voicemail_respond_label");
	this.RespondLabel.SetText(TV_SID_CALLS_SENT_TO_VOICEMAIL_WHEN_NO_RESPONSE_FOR);
	this.RespondLabel.SetTextStyle("settings_voicemail_label_style");
	this.SecLabel = new TextLayer("settings_voicemail_seconds_label");
	this.SecLabel.SetText(SID_SEC);
	this.SecLabel.SetTextStyle("settings_voicemail_seconds_label_style");
	this.RejectLabel = new TextLayer("settings_voicemail_reject_label");
	this.RejectLabel.SetText(TV_SID_REJECT_INCOMING_CALL);
	this.RejectLabel.SetTextStyle("settings_voicemail_label_style");
	this.BusyLabel = new TextLayer("settings_voicemail_busy_label");
	this.BusyLabel.SetText(IDWS_MOIP_SKYPE_BUSY);
	this.BusyLabel.SetTextStyle("settings_voicemail_label_style");
	this.AttentionLabel = new TextLayer("settings_voicemail_attention_label");
	this.AttentionLabel.SetText(TV_SID_INCOMING_CALL_FORWARDED_FIRST_MSG);
	this.AttentionLabel.SetTextStyle("settings_voicemail_label_style");

	this.OfflineBtn = new Button();
	this.OfflineBtn.SetImageObjId("settings_voicemail_offline_btn", 15);
	this.OfflineBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_BASIC_BUTTON_NORMAL);
	this.OfflineBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_BASIC_BUTTON_FOCUS);
	this.OfflineBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_BASIC_BUTTON_DIM);
	this.OfflineBtn.SetTextObjId("settings_voicemail_offline_btn_text");
	this.OfflineBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.OfflineBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.OfflineBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.OfflineBtn.SetIconObjId("settings_voicemail_offline_btn_arrow");
	this.OfflineBtn.SetBgIcon(0, g_Image.IMAGE_POPUP_BTN_ARROW_DOWN);
	this.OfflineBtn.SetOnClickCallbackFunc(clickCF);

	this.RespondBox = new NumberInputBox();
	this.RespondBox.SetButtonObjId("settings_voicemail_respond_box", 30);
	this.RespondBox.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_TEXT_INPUT_NORMAL);
	this.RespondBox.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_TEXT_INPUT_FOCUS);
	this.RespondBox.SetButtonTextObjId("settings_voicemail_respond_box_text");
	this.RespondBox.SetInputBoxObjId("settings_voicemail_respond_box_editor");
	this.RespondBox.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "image_text_box_normal_style");
	this.RespondBox.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "image_text_box_focus_style");
	this.RespondBox.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "image_text_box_dim_style");

	this.RespondBox.setPrevEventOnLeftFunc(function() {
		this_.processLeftKey();
		WndMgr.resetPopupHideTimer();
	});
	this.RespondBox.setPrevEventOnRightFunc(function() {
		this_.processRightKey();
		WndMgr.resetPopupHideTimer();
	});
	this.RespondBox.setPrevEventOnDownFunc(function() {
		this_.processDownKey();
		WndMgr.resetPopupHideTimer();
	});
	this.RespondBox.setPrevEventOnUpFunc(function() {
		this_.processUpKey();
		WndMgr.resetPopupHideTimer();
	});
	this.RespondBox.setEnterFunc(function() {
		this_.processEnterKey();
		WndMgr.resetPopupHideTimer();
	});
	this.RespondBox.setPrevEventOnReturnFunc(function() {
		this_.processReturnKey();
	});
	this.RespondBox.setPrevEventOnExitFunc(function() {
		this_.processReturnKey();
	});
	this.RespondBox.setAnyKeyFunc(function(keyCode) {
		this_.IsChange("RESPOND");
		WndMgr.resetPopupHideTimer();
	});
	this.RespondBox.setMaxLength(3);
	this.RespondBox.setFlagPhoneNumber(false);
	this.RespondBox.SetHelpbarChangeEnable("SettingsVoicemail");
	this.RespondBox.SetOnClickCallbackFunc(clickCF);
	this.RejectBtn = new Button();
	this.RejectBtn.SetImageObjId("settings_voicemail_reject_btn", 15);
	this.RejectBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_BASIC_BUTTON_NORMAL);
	this.RejectBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_BASIC_BUTTON_FOCUS);
	this.RejectBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_BASIC_BUTTON_DIM);
	this.RejectBtn.SetTextObjId("settings_voicemail_reject_btn_text");
	this.RejectBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.RejectBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.RejectBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.RejectBtn.SetIconObjId("settings_voicemail_reject_btn_arrow");
	this.RejectBtn.SetBgIcon(0, g_Image.IMAGE_POPUP_BTN_ARROW_DOWN);
	this.RejectBtn.SetOnClickCallbackFunc(clickCF);

	this.BusyBtn = new Button();
	this.BusyBtn.SetImageObjId("settings_voicemail_busy_btn", 15);
	this.BusyBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_BASIC_BUTTON_NORMAL);
	this.BusyBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_BASIC_BUTTON_FOCUS);
	this.BusyBtn.SetBgImage(BtnImgIndex.BTN_DIM_IMG, g_Image.IMAGE_BASIC_BUTTON_DIM);
	this.BusyBtn.SetTextObjId("settings_voicemail_busy_btn_text");
	this.BusyBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.BusyBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.BusyBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.BusyBtn.SetIconObjId("settings_voicemail_busy_btn_arrow");
	this.BusyBtn.SetBgIcon(0, g_Image.IMAGE_POPUP_BTN_ARROW_DOWN);
	this.BusyBtn.SetOnClickCallbackFunc(clickCF);

	this.SaveBtn = new Button();
	this.SaveBtn.SetImageObjId("settings_voicemail_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.SetTextObjId("settings_voicemail_save_btn_text");
	this.SaveBtn.SetText(SID_SAVE);
	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.SetOnClickCallbackFunc(clickCF);

	this.CancelBtn = new Button();
	this.CancelBtn.SetImageObjId("settings_voicemail_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("settings_voicemail_cancel_btn_text");
	this.CancelBtn.SetText(SID_CANCEL);
	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.SetOnClickCallbackFunc(clickCF);
	
	this.OfflineBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.RespondBox.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.RejectBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.BusyBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.SaveBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	this.CancelBtn.SetOnMouseOverCallbackFunc(function(obj) {
		this_.processMouseOver(obj);
	});
	if(ResMgr.isReverseLanguage()==true){
        var timeVal = $("#settings_voicemail_respond_label").css("left");
        var inputVal = $("#settings_voicemail_respond_box").css("left");
        var secVal = $("#settings_voicemail_seconds_label").css("left");
        $("#settings_voicemail_respond_label").css("left","auto");
        $("#settings_voicemail_respond_box").css("left","auto");
        $("#settings_voicemail_seconds_label").css("left","auto");
        $("#settings_voicemail_respond_label").css("right",timeVal);
        $("#settings_voicemail_respond_box").css("right",inputVal);
        $("#settings_voicemail_seconds_label").css("right",secVal);
	}
}
