
function SceneSettingsAboutSkype(options) {
	this.options = options;
	
	this.SettingsAboutSkypeView = null;
	this.SettingsAboutSkypeDim = null;
	this.SettingsAboutSkypeBG = null;
	
    this.VersionLabel = null;
    this.CopyrightLabel = null;
	
	this.CloseBtn = null;
}

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

SceneSettingsAboutSkype.prototype.handleShow = function() {
	alert("SceneSettingsAboutSkype.handleShow()");
	// this function will be called when the scene manager show this scene
	this.SettingsAboutSkypeDim.show();
	WndMgr.startPopupHideTimer(60000);
}

SceneSettingsAboutSkype.prototype.handleHide = function() {
	alert("SceneSettingsAboutSkype.handleHide()");
	// this function will be called when the scene manager hide this scene
	this.SettingsAboutSkypeDim.hide();
	this.highlight(null);
	WndMgr.stopPopupHideTimer();
}
SceneSettingsAboutSkype.prototype.handleFocus = function() {
	alert("SceneSettingsAboutSkype.handleFocus()");
	// this function will be called when the scene manager focus this scene
	var currentHighlight = this.SettingsAboutSkypeView.getCurrentHighlight();
	if(currentHighlight)
		this.highlight(currentHighlight);
	else
		this.highlight(this.CloseBtn);
}	

SceneSettingsAboutSkype.prototype.handleBlur = function() {
	alert("SceneSettingsAboutSkype.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene
	var  obj = this.SettingsAboutSkypeView.getCurrentHighlight();
	if(obj != null)
	{
		obj.blur();	
	}   
}

SceneSettingsAboutSkype.prototype.handleKeyDown = function(keyCode) {
	alert("SceneSettingsAboutSkype.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:
		case sf.key.RIGHT:
		case sf.key.UP:
		case sf.key.DOWN:
			WndMgr.resetPopupHideTimer();
			this.highlight(this.CloseBtn);
			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;
	}
}

SceneSettingsAboutSkype.prototype.processReturnKey = function() {
	alert("SceneSettingsAboutSkype.processReturnKey() ");
	StateMgr.Stop_SettingsAboutSkype_State(true);
}
SceneSettingsAboutSkype.prototype.highlight = function(obj) {
	this.SettingsAboutSkypeView.setCurrenHighlight(obj);
}

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

	var currentHighlight = this.SettingsAboutSkypeView.getCurrentHighlight();
	if(currentHighlight != obj) {
		this.highlight(obj);
	}
	this.processEnterKey();
}
SceneSettingsAboutSkype.prototype.processEnterKey = function() {
	alert("SceneSettingsAboutSkype.processEnterKey()");

	var currentHighlight = this.SettingsAboutSkypeView.getCurrentHighlight();
	switch(currentHighlight) {
		case this.CloseBtn:
			this.processReturnKey();
			break;
		default :
			this.highlight(this.CloseBtn);
			break;
	}	
}
SceneSettingsAboutSkype.prototype.createPopupUI = function() {
	var oriHeight = 380;
var multiLine = 0;
	var lineHeight = 32;
	var min_height = this.CopyrightLabel.GetTextMinHeight();
	for(;lineHeight+32*multiLine<min_height;multiLine++);
	
	multiLine-=3;
	var oriTop = parseInt($("#settingsaboutskype_close_btn").css('top').replace(/[^-\d\.]/g, ''));
	$("#settingsaboutskype_close_btn").css('top',oriTop+multiLine*lineHeight+'px');
	
	this.SettingsAboutSkypeBG.ChangePopupBGSize(null,306,167,668,oriHeight+multiLine*lineHeight);
	$("#SettingsAboutSkype").css('height',oriHeight-55+multiLine*lineHeight+'px');
}

SceneSettingsAboutSkype.prototype.create = function() {
	alert("SceneSettingsAboutSkype.create()");
	this.SettingsAboutSkypeView = new View("SettingsAboutSkype");
	this.SettingsAboutSkypeBG = new View("SettingsAboutSkypeBG");
	this.SettingsAboutSkypeBG.CreatePopupBG(0, "SettingsAboutSkype_popup_BG");
	//this.SettingsAboutSkypeBG.CreateInnerBox("SettingsAboutSkype_popup_innerbox");
	this.SettingsAboutSkypeBG.SetTitleTextofPopupBG(IDWS_MOIP_ABOUT_SKYPE);
	this.SettingsAboutSkypeDim = new DimBg("SettingsAboutSkypeDim", "SettingsAboutSkypeBG");

	var this_ = sf.scene.get("SettingsAboutSkype");
	var clickCF = function(obj) {
		this_.processClickEvent(obj);
	};
	  this.VersionLabel = new Label(null, "settingsaboutskype_version_label");
    //this.VersionLabel.SetReverseDisable(true);
    
    this.VersionLabel.SetTextStyle("settingsaboutskype_label_style");    
    this.VersionLabel.SetText(g_Data.CombinateStrings(SID_MIX_SKYPE_VERSION,"3.0"));
    
    if(ResMgr.isReverseLanguage())
    {
    	$("#settingsaboutskype_version_label").css("text-align","right");
    }
    else
    {
    	$("#settingsaboutskype_version_label").css("text-align","left");
    }

    this.CopyrightLabel = new TextLayer("settingsaboutskype_copyright_label");
    this.CopyrightLabel.SetTextStyle("settingsaboutskype_label_style");
    this.CopyrightLabel.SetText(g_Data.CombinateStrings(TV_MIX_SKYPE_LIMITED_TRADE_MARK_MSG,"2003-2013"));
    /*//if(ResMgr.isReverseLanguage())
    //{
    	
   // }
   
    else
    {
    	this.CopyrightLabel.SetText(g_Data.CombinateStrings(TV_MIX_SKYPE_LIMITED_TRADE_MARK_MSG,"2003-2013"));
       }*/
   
	this.CloseBtn = new Button();
	this.CloseBtn.SetImageObjId("settingsaboutskype_close_btn", 20);
	this.CloseBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_POPUP_BTN_NORMAL);
	this.CloseBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_POPUP_BTN_NORMALFOCUS);

	this.CloseBtn.SetTextObjId("settingsaboutskype_close_btn_text");
	this.CloseBtn.SetText(SID_CLOSE);
	this.CloseBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE, "popup_btn_text_normal_style");
	this.CloseBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE, "popup_btn_text_focus_style");
	this.CloseBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_DIM_STYLE, "popup_btn_text_dimmed_style");
	this.CloseBtn.SetOnClickCallbackFunc(clickCF);
	this.CloseBtn.SetOnMouseOverCallbackFunc(function(obj) {
		WndMgr.resetPopupHideTimer();
		this_.highlight(obj);
	});
	
	this.createPopupUI();
	
}