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

	this.miniStatusChangeView = null;

	this.OnlineBtn = null;
	this.AwayBtn = null;
	this.DoNotDisturbBtn = null;
	this.InvisibleBtn = null;
	this.OfflineBtn = null;
	this.CancelBtn = null;

	this.CloseTimer = false;

}

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

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

	this.Show_miniStatusChange();
	this.startTimer();
	this.ShowKeyHelpbar();
	$("#skype_popup_background").show();
}

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

	if(this.CloseTimer == true) {
		this.stopTimer();
	}
	this.highlight(null);
	$("#skype_popup_background").hide();
}

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

}

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

SceneminiStatusChange.prototype.handleKeyDown = function(keyCode) {
	alert("SceneminiStatusChange.handleKeyDown(" + keyCode + ")");
	// TODO : write an key event handler when this scene get focued
	PluginAPIMgr.PlayAudio(keyCode);
	switch (keyCode) {
		case $.sfKey.LEFT:
		case $.sfKey.RIGHT:

			break;
		case $.sfKey.UP:
			this.resetTimer();
			this.processUpKey();
			break;
		case $.sfKey.DOWN:
			this.resetTimer();
			this.processDownKey();
			break;

		case $.sfKey.ENTER:
			this.processEnterKey();
			break;
		case $.sfKey.RETURN:
		case $.sfKey.EXIT:
			this.processReturnKey();
			$.sfKey.block(event);
			break;

		case 147:
		//infolink
		case 261:
		//contents
		case 115:
			//wiselink
			ProcMgr.processInfolinkKey();
			break;
	}
	if(Flag_Hidden_State==false)
		event.stopPropagation();
}
SceneminiStatusChange.prototype.ShowKeyHelpbar = function(){
	if(WIDGET.mouse==true){
		helpBarHandler.hideHelpIcon('red',"");
		helpBarHandler.hideHelpIcon('green',"");
		helpBarHandler.hideHelpIcon('yellow',"");
		helpBarHandler.hideHelpIcon('blue',TV_SID_CHANGE_VIEW);
		helpBarHandler.hideHelpIcon('tools',sfLang.SID_TOOLS);
		helpBarHandler.hideHelpIcon('return',SID_RETURN);
	}else{
		$("#HomeHelp").sfKeyHelp({
		//	'blue' : TV_SID_CHANGE_VIEW,
		//	'tools' : sfLang.SID_TOOLS,
			'return' : SID_RETURN
		});	
	}
}
SceneminiStatusChange.prototype.highlight = function(obj) {
	this.miniStatusChangeView.setCurrenHighlight(obj);

}

SceneminiStatusChange.prototype.processUpKey = function() {
	alert("SceneminiStatusChange.processUpKey() ");

	var currentHighlight = this.miniStatusChangeView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.AwayBtn:
			this.highlight(this.OnlineBtn);
			break;

		case this.DoNotDisturbBtn:
			this.highlight(this.AwayBtn);
			break;

		case this.InvisibleBtn:
			this.highlight(this.DoNotDisturbBtn);
			break;

		case this.OfflineBtn:
			this.highlight(this.InvisibleBtn);
			break;
		case this.CancelBtn:
			this.highlight(this.OfflineBtn);
			break;
	}
}

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

	var currentHighlight = this.miniStatusChangeView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.OnlineBtn:
			this.highlight(this.AwayBtn);
			break;

		case this.AwayBtn:
			this.highlight(this.DoNotDisturbBtn);
			break;

		case this.DoNotDisturbBtn:
			this.highlight(this.InvisibleBtn);
			break;

		case this.InvisibleBtn:
			this.highlight(this.OfflineBtn);
			break;

		case this.OfflineBtn:
			this.highlight(this.CancelBtn);
			break;
	}
}

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

	var currentHighlight = this.miniStatusChangeView.getCurrentHighlight();

	switch(currentHighlight) {
		case this.OnlineBtn:
			PluginAPIMgr.SetAvailability(ENUM_ACCOUNT_AVAILABILITY.ONLINE);
			break;

		case this.AwayBtn:
			PluginAPIMgr.SetAvailability(ENUM_ACCOUNT_AVAILABILITY.AWAY);
			break;

		case this.DoNotDisturbBtn:
			PluginAPIMgr.SetAvailability(ENUM_ACCOUNT_AVAILABILITY.DO_NOT_DISTURB);
			break;

		case this.InvisibleBtn:
			PluginAPIMgr.SetAvailability(ENUM_ACCOUNT_AVAILABILITY.INVISIBLE);
			break;

		case this.OfflineBtn:
			PluginAPIMgr.SetAvailability(ENUM_ACCOUNT_AVAILABILITY.OFFLINE);
			break;
	}
	//add by minseok(130805) : because of miniCannotCallInDualView(background call scenario)
	var scene = $.sfScene.get({id:'miniMainContact',scope:WIDGET.id})
	if(scene.init){
		scene.updateOnlineStatus();
	}
	scene = $.sfScene.get({id:'miniCannotCallInDualView',scope:WIDGET.id});
	if(scene.init)
		scene.updateOnlineStatus();
	StateMgr.Stop_Mini_Status_Change(true);
}

SceneminiStatusChange.prototype.processReturnKey = function() {
	alert("SceneminiStatusChange.processReturnKey() ");
	StateMgr.Stop_Mini_Status_Change(true);

}

SceneminiStatusChange.prototype.startTimer = function() {
	alert("SceneminiStatusChange.startTimer() ");

	this.CloseTimer = true;
	PluginAPIMgr.StartOSDTimer("60000", function() {
		$.sfScene.get({id:'miniStatusChange',scope:WIDGET.id}).popupTimerCallback();
	}, ENUM_TIMER_TYPE.POPUP_WND);
}

SceneminiStatusChange.prototype.resetTimer = function() {
	alert("SceneminiStatusChange.resetTimer() ");

	if(this.CloseTimer == true) {
		PluginAPIMgr.RestartOSDTimer("60000", ENUM_TIMER_TYPE.POPUP_WND);
	}
}

SceneminiStatusChange.prototype.stopTimer = function() {
	alert("SceneminiStatusChange.stopTimer() ");

	this.CloseTimer = false;
	PluginAPIMgr.StopOSDTimer(ENUM_TIMER_TYPE.POPUP_WND);
}

SceneminiStatusChange.prototype.popupTimerCallback = function() {
	alert("SceneminiStatusChange.popupTimerCallback() ");
	if(this.CloseTimer == false) {
		return;
	}
	this.CloseTimer = false;
	//////////////////////////////////////////////////
	StateMgr.Stop_Mini_Status_Change(true);
}


SceneminiStatusChange.prototype.processMouseOver = function(obj) {
    alert("SceneminiStatusChange.processMouseOver() ");

    var currentHighlight = this.miniStatusChangeView.getCurrentHighlight();
    if(currentHighlight != obj) {
        this.highlight(obj);
    }
    this.resetTimer();
}

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

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

	this.processEnterKey();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////

SceneminiStatusChange.prototype.create = function() {
	alert("SceneminiStatusChange.create()");
	this.miniStatusChangeView = new View("miniStatusChange");
	this.miniStatusChangeView.SetBgImage(g_Image.IMAGE_STATUS_CHANGE_BG);

	var this_ = this;
	var clickCF = function(obj) {
		this_.processClickEvent(obj);
	};
    var cssClass = "";
    if(ENUM_TV_LANGUAGE.GRE==ResMgr.GetCurLanguage()){
   		cssClass = "status_change_small_text";
    }else{
		cssClass = "status_change_text";
    }
	this.OnlineBtn = new Button();
	this.OnlineBtn.SetImageObjId("online_btn");
	this.OnlineBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, null);
	this.OnlineBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_STATUS_CHANGE_LIST_SEARCH_FOCUS);
	this.OnlineBtn.SetTextObjId("online_btn_text");
	
	this.OnlineBtn.SetIsTextInTable(true);
	this.OnlineBtn.SetText(IDWS_MOIP_SETTING_ONLINE);
	this.OnlineBtn.SetIsTextInTable(false);
	this.OnlineBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,cssClass);
	this.OnlineBtn.SetIconObjId("online_btn_icon");
	this.OnlineBtn.SetBgIcon(BtnIconIndex.BTN_NORMAL_ICON, g_Image.IMAGE_STATUS_CHANGE_ICON_ONLINE);
	this.OnlineBtn.SetChkObjId("online_btn_chk");
	this.OnlineBtn.SetBgCheckBox(g_Image.IMAGE_STATUS_CHANGE_ICON_CHECK);
	this.OnlineBtn.SetOnClickCallbackFunc(clickCF);
	this.OnlineBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.OnlineBtn.setTextKPILog(KPI_LOG_ITEM_ID.ONLINE_BTN);


	this.AwayBtn = new Button();
	this.AwayBtn.SetImageObjId("away_btn");
	this.AwayBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, null);
	this.AwayBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_STATUS_CHANGE_LIST_SEARCH_FOCUS);
	this.AwayBtn.SetTextObjId("away_btn_text");
	this.AwayBtn.SetIsTextInTable(true);
	this.AwayBtn.SetText(IDWS_MOIP_SETTING_AWAY);
	this.AwayBtn.SetIsTextInTable(false);
	this.AwayBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, cssClass);
	this.AwayBtn.SetIconObjId("away_btn_icon");
	this.AwayBtn.SetBgIcon(BtnIconIndex.BTN_NORMAL_ICON, g_Image.IMAGE_STATUS_CHANGE_ICON_AWAY);
	this.AwayBtn.SetChkObjId("away_btn_chk");
	this.AwayBtn.SetBgCheckBox(g_Image.IMAGE_STATUS_CHANGE_ICON_CHECK);
	this.AwayBtn.SetOnClickCallbackFunc(clickCF);
	this.AwayBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.AwayBtn.setTextKPILog(KPI_LOG_ITEM_ID.AWAY_BTN);

	this.DoNotDisturbBtn = new Button();
	this.DoNotDisturbBtn.SetImageObjId("do_not_disturb_btn");
	this.DoNotDisturbBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, null);
	this.DoNotDisturbBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_STATUS_CHANGE_LIST_SEARCH_FOCUS);
	this.DoNotDisturbBtn.SetTextObjId("do_not_disturb_btn_text");
	this.DoNotDisturbBtn.SetIsTextInTable(true);
	this.DoNotDisturbBtn.SetText(IDWS_MOIP_SETTING_DO_NOT_DISTURB);
	this.DoNotDisturbBtn.SetIsTextInTable(false);
	this.DoNotDisturbBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, cssClass);
	this.DoNotDisturbBtn.SetIconObjId("do_not_disturb_btn_icon");
	this.DoNotDisturbBtn.SetBgIcon(BtnIconIndex.BTN_NORMAL_ICON, g_Image.IMAGE_STATUS_CHANGE_ICON_DO_NOT_DISTURB);
	this.DoNotDisturbBtn.SetChkObjId("do_not_disturb_btn_chk");
	this.DoNotDisturbBtn.SetBgCheckBox(g_Image.IMAGE_STATUS_CHANGE_ICON_CHECK);
	this.DoNotDisturbBtn.SetOnClickCallbackFunc(clickCF);
	this.DoNotDisturbBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.DoNotDisturbBtn.setTextKPILog(KPI_LOG_ITEM_ID.DO_NOT_DISTURB_BTN);

	this.InvisibleBtn = new Button();
	this.InvisibleBtn.SetImageObjId("invisible_btn");
	this.InvisibleBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, null);
	this.InvisibleBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_STATUS_CHANGE_LIST_SEARCH_FOCUS);
	this.InvisibleBtn.SetTextObjId("invisible_btn_text");
	this.InvisibleBtn.SetIsTextInTable(true);
	this.InvisibleBtn.SetText(IDWS_MOIP_SETTING_INVISIBLE);
	this.InvisibleBtn.SetIsTextInTable(false);
	this.InvisibleBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, cssClass);
	this.InvisibleBtn.SetIconObjId("invisible_btn_icon");
	this.InvisibleBtn.SetBgIcon(BtnIconIndex.BTN_NORMAL_ICON, g_Image.IMAGE_STATUS_CHANGE_ICON_INVISIBLE);
	this.InvisibleBtn.SetChkObjId("invisible_btn_chk");
	this.InvisibleBtn.SetBgCheckBox(g_Image.IMAGE_STATUS_CHANGE_ICON_CHECK);
	this.InvisibleBtn.SetOnClickCallbackFunc(clickCF);
	this.InvisibleBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.InvisibleBtn.setTextKPILog(KPI_LOG_ITEM_ID.INVISIBLE_BTN);

	this.OfflineBtn = new Button();
	this.OfflineBtn.SetImageObjId("offline_btn");
	this.OfflineBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, null);
	this.OfflineBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_STATUS_CHANGE_LIST_SEARCH_FOCUS);
	this.OfflineBtn.SetTextObjId("offline_btn_text");
	this.OfflineBtn.SetIsTextInTable(true);
	this.OfflineBtn.SetText(TV_SID_OFFLINE);
	this.OfflineBtn.SetIsTextInTable(false);
	this.OfflineBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, cssClass);
	this.OfflineBtn.SetIconObjId("offline_btn_icon");
	this.OfflineBtn.SetBgIcon(BtnIconIndex.BTN_NORMAL_ICON, g_Image.IMAGE_STATUS_CHANGE_ICON_OFFLINE);
	this.OfflineBtn.SetChkObjId("offline_btn_chk");
	this.OfflineBtn.SetBgCheckBox(g_Image.IMAGE_STATUS_CHANGE_ICON_CHECK);
	this.OfflineBtn.SetOnClickCallbackFunc(clickCF);
	this.OfflineBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.OfflineBtn.setTextKPILog(KPI_LOG_ITEM_ID.OFFLINE_BTN);

	this.CancelBtn = new Button();
	this.CancelBtn.SetImageObjId("status_change_cancel_btn", 20);
	this.CancelBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_NEW_BUTTON_NORMAL);
	this.CancelBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_NEW_BUTTON_HIGHLIGHT);

	this.CancelBtn.SetTextObjId("status_change_cancel_btn_text");
	this.CancelBtn.SetText(SID_CANCEL);
	this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "list_btn_text_normal_style");
	this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "list_btn_text_highlight_style");
	this.CancelBtn.SetOnClickCallbackFunc(clickCF);
	this.CancelBtn.SetOnMouseOverCallbackFunc(function(obj){
        this_.processMouseOver(obj);
    });
    this.CancelBtn.setTextKPILog(KPI_LOG_ITEM_ID.CANCEL_BTN);
}

SceneminiStatusChange.prototype.Show_miniStatusChange = function() {
	alert("SceneminiStatusChange.Show_miniStatusChange() ");
	var curr_state = PluginAPIMgr.GetMyOnlineState();
	this.OnlineBtn.hiddenChkBox();
	this.DoNotDisturbBtn.hiddenChkBox();
	this.OfflineBtn.hiddenChkBox();
	this.InvisibleBtn.hiddenChkBox();
	this.AwayBtn.hiddenChkBox();

	this.BeforeStatus = null;
	if(curr_state == ENUM_ACCOUNT_AVAILABILITY.ONLINE) {
		this.BeforeStatus = this.OnlineBtn;
	} else if(curr_state == ENUM_ACCOUNT_AVAILABILITY.AWAY) {
		this.BeforeStatus = this.AwayBtn;
	} else if(curr_state == ENUM_ACCOUNT_AVAILABILITY.DO_NOT_DISTURB) {
		this.BeforeStatus = this.DoNotDisturbBtn;
	} else if(curr_state == ENUM_ACCOUNT_AVAILABILITY.INVISIBLE) {
		this.BeforeStatus = this.InvisibleBtn;
	} else if(curr_state == ENUM_ACCOUNT_AVAILABILITY.OFFLINE) {
		this.BeforeStatus = this.OfflineBtn;
	} else {
		this.BeforeStatus = this.OfflineBtn;
	}

	this.BeforeStatus.visibleChkBox();
	this.highlight(this.BeforeStatus);
}