
function SceneFaceRecogSignin(options) {
	this.options = options;
    
    this.MainView=null;
    
    this.RecogAreaView=null;
    
    //2013 add by minseok
    this.FaceRecogTabBtn = null;
    this.FaceRecogTabSigninLabel = null;
	this.StartBtn = null;
	this.CalllistLine = null;
	this.LoadingAni = null;
	this.LoadingAniImage = new Array(18);
	this.LoadingAniImagePath = null;
	this.iCurrAniImage = 0;
	this.WidgetLoadingTimer=null;
	this.ShowCameraTimer=null;
	this.CountIconTimer=null;
	    
    this.TitleLabel = null;     	
	this.MsgLabel = null;

    this.CancelBtn = null;
    this.CountIconOne = null;
    this.CountIconTwo = null;
    this.CountIconThree = null;
    this.CurrentCount = 1;
    this.FaceRecogMouseBtn = null;
    this.IDPWMouseBtn = null;

    this.DefaultHelpBar =null;

	//flag	
	this.flagWaiting = false;
	this.flagCameraViewStarting = false;
	this.flagShownLoadingView = true;
	this.flagFromSignTab = true;
	this.RecogTimer = false;
	
	this.flagStartRecogNCamera = false;
	this.flagStartRecog = false;
	
	this.flagCreate = false;
	
	this.testFlag = false;
}

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

SceneFaceRecogSignin.prototype.handleShow = function () {
	alert("SceneFaceRecogSignin.handleShow()");
	// this function will be called when the scene manager show this scene 
	this.changeBG(true);
	ProcMgr.SyncFaceDB();		//sync engine db
	// this.startTimer();
	// this.CountIconOne.hiddenObj();
	// this.CountIconTwo.hiddenObj();
	// this.CountIconThree.hiddenObj();
	// this.initFaceRecogSignin();
	this.flagCameraViewStarting = false;	
	this.startLoadingView();
	if(this.flagFromSignTab==true){
		this.highlight(this.FaceRecogTabBtn);
		this.flagFromSignTab=false;
	}
}

SceneFaceRecogSignin.prototype.handleHide = function () {
	alert("SceneFaceRecogSignin.handleHide()");
	// this function will be called when the scene manager hide this scene    
	this.changeBG(false);  
	this.flagCameraViewStarting = false;
	this.startLoadingView();
	ProcMgr.StopFaceRecogSignin(); 
	if(this.WidgetLoadingTimer != null)
	{
		this.stopTimer();
	}
	if(this.CountIconTimer != null)
	{
		this.stopCountTimer();
	}
	if(this.ShowCameraTimer!=null){
		alert("clear camera Timer");
		clearTimeout(this.ShowCameraTimer);
	}
	// this.highlight(null);
}

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

    var currentHighlight =  this.MainView.getCurrentHighlight();
    if(currentHighlight ==null)
    {
        this.highlight(this.FaceRecogTabBtn);
    }
    else
    {
         this.highlight(currentHighlight);
         if(currentHighlight==this.CancelBtn){	//reset scene
    			this.processEnterKey();
    		}
    }
    // if(this.flagStartRecog==true)
    // {
    	// // ProcMgr.RetryFaceRecog(); 
    // }
    
    var this_ = sf.scene.get("FaceRecogSignin");
  	var returnCF =  function(){this_.processReturnKey();};
    WndMgr.SetReturnIconClickCallback(returnCF);
}

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

	WndMgr.SetReturnIconClickCallback(null);

}
 
SceneFaceRecogSignin.prototype.handleKeyDown = function (keyCode) {
	alert("SceneFaceRecogSignin.handleKeyDown(" + keyCode + ")");
	// TODO : write an key event handler when this scene get focued
	PluginAPIMgr.PlayAudio(keyCode);
	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	if(this.flagWaiting==true)
	{
		return;	
	}
	
	switch (keyCode) {
		case sf.key.LEFT:
			this.processLeftKey();
			break;
		case sf.key.RIGHT:
		case sf.key.UP:     
			this.processUpKey();
			break;     
		case sf.key.DOWN:
			this.processDownKey();
			break;

		case sf.key.ENTER:
            this.processEnterKey();
			break;
        
		case sf.key.TOOLS:
            
			break; 
            
        case sf.key.RETURN:
            this.processReturnKey();
            //2013 modify by minseok
            sf.key.preventDefault();
			break;
            
        case sf.key.EXIT:
            this.processExitKey();
            //2013 modify by minseok
            sf.key.preventDefault();
			break;
			
        case 147:  //infolink
        case 261:  //contents
        case 115:  //wiselink
            ProcMgr.processInfolinkKey(); 
			break;
			
		default:
            ProcMgr.processBlockKey(keyCode);
            break;

	}
}

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

SceneFaceRecogSignin.prototype.create = function(){
    alert("SceneFaceRecogSignin.create()");
    this.MainView = new View("FaceRecogSignin");
    // this.MainView.SetBgImage(g_Image.IMAGE_FACE_RECOG_SIGNIN_BG);
    
    
    this.FaceRecogTabSigninLabel = new Label(null,"face_recog_tab_signin_text");
    this.FaceRecogTabSigninLabel.SetTextStyle("face_recog_tab_text_style");
    this.FaceRecogTabSigninLabel.SetText(TV_ID_PASSWORD_MENU); 
    
	this.CalllistLine = new Label("face_recog_signin_calllist_line",null);
	this.CalllistLine.SetBgImage(g_Image.IMAGE_FACERECOGNITION_CALLLIST_LINE);
	
	var ResStr = sf.env.getResolution();
   	this.LoadingAniImagePath = "images/"+ResStr+"/loading/loading_96/";
   	alert("SceneFaceRecogSignin.create() : loadinganiImagePath"+this.LoadingAniImagePath);
   	var a=0;
    for (a=0; a < this.LoadingAniImage.length; a++)
    {
        var b = (a+1);
        if(b<10)
        {
            this.LoadingAniImage[a] = this.LoadingAniImagePath +"loading_96_"+"0"+b+".png";
        }
        else
        {
            this.LoadingAniImage[a] = this.LoadingAniImagePath +"loading_96_"+b+".png";
        }
    }
   	
	
	this.LoadingAni = new Label("face_recog_signin_loading_animation",null);
	this.LoadingAni.SetBgImage(this.LoadingAniImage[this.iCurrAniImage]);
    
    this.RecogAreaView = new View("face_recog_signin_recog_area");
    this.RecogAreaView.SetBgImage(g_Image.IMAGE_FACERECOGNITION_RECOG_AREA_BG);
    
    this.TitleLabel = new Label(null,"face_recog_signin_title");
    this.TitleLabel.SetTextStyle("face_recog_signin_title_style");
    // this.TitleLabel.SetText(IDWS_MOIP_WELCOM_TO_SKYPE );    
    this.TitleLabel.SetText(IDWS_MOIP_LOGIN);    
	
    this.MsgLabel = new Label(null,"face_recog_signin_msg");
    this.MsgLabel.SetTextStyle("face_recog_signin_msg_style");
    // this.MsgLabel.SetBgImage(g_Image.IMAGE_FACE_RECOG_SIGNIN_MSG_BG);
    this.MsgLabel.SetText(TV_SID_START_FACE_RECOGNITION);  
    
	/*if(ResMgr.GetCurLanguage() == ENUM_TV_LANGUAGE.TAM)
	{
		$("#face_recog_signin_msg_text").css('top', "5px" );
	} */
	
	this.CountIconOne = new Label("face_recog_signin_icon_counter_one",null);
	this.CountIconOne.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_ONE_NORMAL);
	this.CountIconTwo = new Label("face_recog_signin_icon_counter_two",null);
	this.CountIconTwo.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_TWO_NORMAL);
	this.CountIconThree = new Label("face_recog_signin_icon_counter_three",null);
	this.CountIconThree.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_THREE_NORMAL);
	
	var this_ = sf.scene.get("FaceRecogSignin");
	var clickCF =  function(obj){this_.processClickEvent(obj);};
	var overCF =  function(obj){this_.processMouseOverEvent(obj);};
	
	this.FaceRecogTabBtn = new Button();
	this.FaceRecogTabBtn.SetImageObjId("face_recog_tab_btn");
	this.FaceRecogTabBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_FACERECOGNITION_TAB_BG);
	this.FaceRecogTabBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_FACERECOGNITION_TAB_HIGHLIGHT_BG);
	this.FaceRecogTabBtn.SetTextObjId("face_recog_tab_text");
	this.FaceRecogTabBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"face_recog_tab_text_style");
	this.FaceRecogTabBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"face_recog_tab_text_highlight_style");
	this.FaceRecogTabBtn.SetText(SID_VOICE_FACE_RECOGNITION);
	
	this.StartBtn = new Button();
	this.StartBtn.SetImageObjId("face_recog_signin_start_btn", 30);
    this.StartBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_SIGNIN_BTN_NORMAL);
    this.StartBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_SIGNIN_BTN_NORMALFOCUS);
    this.StartBtn.SetTextObjId("face_recog_signin_start_btn_text");
    this.StartBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"face_recog_signin_btn_normal_style");
    this.StartBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"face_recog_signin_btn_select_style");
    this.StartBtn.SetText(SID_START);
    this.StartBtn.SetOnClickCallbackFunc(clickCF);
    this.StartBtn.SetOnMouseOverCallbackFunc(overCF);
	
    this.CancelBtn= new Button();
    this.CancelBtn.SetImageObjId("face_recog_signin_cancel_btn", 30);
    this.CancelBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_IMG, g_Image.IMAGE_SIGNIN_BTN_NORMAL);
    this.CancelBtn.SetBgImage(BtnImgIndex.BTN_NORMAL_FOCUS_IMG, g_Image.IMAGE_SIGNIN_BTN_NORMALFOCUS);
	this.CancelBtn.SetTextObjId("face_recog_signin_cancel_btn_text");
    this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_NORMAL_STYLE,"face_recog_signin_btn_normal_style");
	this.CancelBtn.SetTextStyle(BtnTextStyleIndex.BTN_TEXT_FOCUS_STYLE,"face_recog_signin_btn_select_style");
	this.CancelBtn.SetText(SID_CANCEL);
	this.CancelBtn.SetOnClickCallbackFunc(clickCF);
	this.CancelBtn.SetOnMouseOverCallbackFunc(overCF);
	
	this.FaceRecogMouseBtn = new Button();
	this.FaceRecogMouseBtn.SetImageObjId("face_recog_signin_dummy_face_recog_btn");
	this.FaceRecogMouseBtn.SetOnClickCallbackFunc(clickCF);
	this.FaceRecogMouseBtn.SetOnMouseOverCallbackFunc(overCF);
	
	this.IDPWMouseBtn = new Button();
	this.IDPWMouseBtn.SetImageObjId("face_recog_signin_dummy_id_password_btn");
	this.IDPWMouseBtn.SetOnClickCallbackFunc(clickCF);
	this.IDPWMouseBtn.SetOnMouseOverCallbackFunc(overCF);

	this.flagCreate = true;
	this.CancelBtn.hiddenObj();
}



SceneFaceRecogSignin.prototype.initRecogArea= function(){
    alert("SceneFaceRecogSignin.initRecogArea() ");
    
    $("#face_recog_signin_recog_area").empty();
    $("#drawface_div").remove();
}

SceneFaceRecogSignin.prototype.updateRecogArea = function(){
    alert("SceneFaceRecogSignin.updateRecogArea() ");

    if(this.flagCreate==false)
    {
    	return;	
    }
    
    this.initRecogArea();

    var Area_info = g_Data.GetFaceRecogAreaInfo();
	alert("Area_info!!\n"+Area_info);
    for(var a=0; a<Area_info.length; a++)
    {

    	var bg_color ='rgb(250,14,2)';
    	if(Area_info[a].registered == true)
    	{
    		bg_color ='rgb(165,255,0)';
    	}

    	for(var b=0; b<Area_info[a].x.length ; b++)
    	{
    		var area_id = "face_recog_signin_recog_area"+"_"+a+"_"+b;
    		$("<div id='"+ area_id +"' />").appendTo("#face_recog_signin_recog_area");
			$("#"+area_id).css(	{
				'position' : 'absolute',
				'left' : Area_info[a].x[b],
				'top' : Area_info[a].y[b],
				'width' : Area_info[a].w[b],
				'height' : Area_info[a].h[b],
				'background-color' : bg_color,
			});
    	}    	
    }
}
SceneFaceRecogSignin.prototype.startLoadingView = function(){
	alert("SceneFaceRecogSignin.startLoadingView()");
	
	this.flagStartRecogNCamera = false;
	this.flagShownLoadingView = true;
	this.initRecogArea();
	this.CancelBtn.hiddenObj();
	this.StartBtn.visibleObj();
	this.RecogAreaView.SetBgImage(g_Image.IMAGE_FACERECOGNITION_RECOG_AREA_BG);
	this.startTimer();
	this.LoadingAni.visibleObj();
	this.highlight(this.StartBtn); 
	this.stopCountTimer();
	ProcMgr.PauseFaceRecog(false);
	this.MsgLabel.SetText(TV_SID_START_FACE_RECOGNITION);
	if(this.flagCameraViewStarting != true){
		var scene = sf.scene.get('FaceRecogSignin');
	    this.ShowCameraTimer=setTimeout("cameraCF()", 3000);
	    cameraCF = function() {  scene.showCamera();}	
	}
}

SceneFaceRecogSignin.prototype.showCamera = function(){
	alert("SceneFaceRecogSignin.showCamera()");
	this.flagShownLoadingView = false;
	this.flagCameraViewStarting = true;
	this.RecogAreaView.SetBgImage(' ');
	this.stopTimer();
	this.LoadingAni.hiddenObj();
	

}
SceneFaceRecogSignin.prototype.startCameraView = function(){
	alert("SceneFaceRecogSignin.startCameraView()");
	this.flagCameraViewStarting = false;
	this.flagStartRecogNCamera = true;
	this.CancelBtn.visibleObj();
	this.StartBtn.hiddenObj();
	this.MsgLabel.SetText(TV_FACE_TOWARDS_WITHIN_FRAME_MSG+"</br>"+TV_SID_TRY_NOT_CHANGE_EXPRESSION_MSG);
	this.highlight(this.CancelBtn); 
	this.startCountTimer();	
	ProcMgr.FaceRecogTimer = true;
	if(this.flagStartRecog==false){
		this.RecogTimer = true;
		PluginAPIMgr.StartOSDTimer("3000" , 
					function() {
							alert("Start faceRecog~~~!!!"); 
							ProcMgr.FaceRecogTimer=false; 
							ProcMgr.StartFaceRecog();
						}, 
					ENUM_TIMER_TYPE.POPUP_WND);
		this.flagStartRecog=true;
	}else{
		PluginAPIMgr.StartOSDTimer("3000" , 
					function() {
							alert("Start faceRecog~~~!!!"); 
							ProcMgr.FaceRecogTimer=false; 
							ProcMgr.RetryFaceRecog(); 
						}, 
					ENUM_TIMER_TYPE.POPUP_WND);
		
	}
	
	
}

SceneFaceRecogSignin.prototype.highlight=function(obj)
{
	alert("SceneFaceRecogSignin.highlight()");
	
    this.MainView.setCurrenHighlight(obj);	
}

SceneFaceRecogSignin.prototype.processUpKey = function(){
	alert("SceneFaceRecogSignin.processUpKey() ");
	var currentHighlight =  this.MainView.getCurrentHighlight();
	switch(currentHighlight){
		case this.CancelBtn:
		case this.StartBtn:
			this.highlight(this.FaceRecogTabBtn);
			break;
	}
}
SceneFaceRecogSignin.prototype.processDownKey = function(){
	alert("SceneFaceRecogSignin.processDownKey() ");
	var currentHighlight =  this.MainView.getCurrentHighlight();
	switch(currentHighlight){
		case this.FaceRecogTabBtn:
			if(this.flagStartRecogNCamera==false){
				this.highlight(this.StartBtn);
			}else{
				this.highlight(this.CancelBtn);
			}
			break;
	}
}
SceneFaceRecogSignin.prototype.processLeftKey = function(){
    alert("SceneFaceRecogSignin.processLeftKey() ");
    var currentHighlight =  this.MainView.getCurrentHighlight();
	switch(currentHighlight){
		case this.FaceRecogTabBtn:
			StateMgr.Start_Signin_State();
			break;
	}
    
}

SceneFaceRecogSignin.prototype.processRightKey = function(){
    alert("SceneFaceRecogSignin.processRightKey() ");
    
}


SceneFaceRecogSignin.prototype.processEnterKey = function(){
    alert("SceneFaceRecogSignin.processEnterKey() ");
    
    var currentHighlight =  this.MainView.getCurrentHighlight();

    switch(currentHighlight)
    {
    	case this.FaceRecogTabBtn:
			this.processDownKey();
			break;
			
    	case this.StartBtn:
    		if(this.flagCameraViewStarting==true){
	    		this.startCameraView();
    		}
    		break;
            
        case this.CancelBtn:
        	if(ProcMgr.FaceRecogTimer==true){
        		ProcMgr.FaceRecogTimer = false;
	        	PluginAPIMgr.StopOSDTimer(ENUM_TIMER_TYPE.POPUP_WND);
        	}
        	ProcMgr.PauseFaceRecog(true);
        	this.flagCameraViewStarting = false;
        	this.startLoadingView();
			// StateMgr.Start_Welcome_State();
            break;
    }
}


SceneFaceRecogSignin.prototype.processReturnKey = function(){
    alert("SceneFaceRecogSignin.processReturnKey() ");
	
   StateMgr.Start_Welcome_State();
}

SceneFaceRecogSignin.prototype.processExitKey = function(){
    alert("SceneFaceRecogSignin.processExitKey() ");
	  
   ProcMgr.ExitWithSignIn();
}
SceneFaceRecogSignin.prototype.startTimer = function()
{   
	var scene = sf.scene.get('FaceRecogSignin');
    this.WidgetLoadingTimer=setInterval("timerCF()", 100);
    timerCF = function() {  scene.loadingTimerCallback();}
}
SceneFaceRecogSignin.prototype.stopTimer = function()
{
    alert("SceneFaceRecogSignin.stopTimer() ");
    
	clearInterval( this.WidgetLoadingTimer);
    this.WidgetLoadingTimer=null;
    this.iCurrAniImage =0;
}
SceneFaceRecogSignin.prototype.loadingTimerCallback = function()
{
     this.iCurrAniImage++;
     
    if(this.iCurrAniImage >= this.LoadingAniImage.length)
    {
        this.iCurrAniImage = 0;
    }   
    
    this.LoadingAni.SetBgImage(this.LoadingAniImage[this.iCurrAniImage]);
	
}
SceneFaceRecogSignin.prototype.startCountTimer = function()
{   
	alert("SceneFaceRecogSignin.startCountTimer() ");
	this.CurrentCount=1;
	this.CountIconOne.visibleObj();
	this.CountIconTwo.visibleObj();
	this.CountIconThree.visibleObj();
	var scene = sf.scene.get('FaceRecogSignin');
    this.CountIconTimer=setInterval("countCF()", 1000);
    countCF = function() {  scene.countingTimerCallback();}
}
SceneFaceRecogSignin.prototype.stopCountTimer = function()
{
    alert("SceneFaceRecogSignin.stopCountTimer() ");
    
	clearInterval(this.CountIconTimer);
    this.CountIconTimer=null;
    this.CountIconOne.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_ONE_NORMAL);
	this.CountIconTwo.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_TWO_NORMAL);
	this.CountIconThree.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_THREE_NORMAL);
    this.CountIconOne.hiddenObj();
	this.CountIconTwo.hiddenObj();
	this.CountIconThree.hiddenObj();
}
SceneFaceRecogSignin.prototype.countingTimerCallback = function()
{
	this.CountIconOne.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_ONE_NORMAL);
	this.CountIconTwo.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_TWO_NORMAL);
	this.CountIconThree.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_THREE_NORMAL);
	switch(this.CurrentCount){
		case 1:
			this.CountIconOne.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_ONE_HIGHLIGHT);
			break;
		case 2:
			this.CountIconTwo.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_TWO_HIGHLIGHT);
			break;
		case 3:
			this.CountIconThree.SetBgImage(g_Image.IMAGE_FACERECOGNITION_SIGNIN_COUNT_ICON_THREE_HIGHLIGHT);
			break;
		default:
			alert("End Count_Icon!!");
			this.stopCountTimer();
			break;
	}
	this.CurrentCount++;
	
}
SceneFaceRecogSignin.prototype.processClickEvent = function(obj){
	alert("SceneFaceRecogSignin.processClickEvent() ");
	
	var currentHighlight =  this.MainView.getCurrentHighlight();
	if(obj==this.FaceRecogMouseBtn || obj==this.IDPWMouseBtn){
		this.highlight(this.FaceRecogTabBtn);
		if(obj==this.IDPWMouseBtn){
			this.processLeftKey();
		}
		return;
	}
    if(currentHighlight != obj)
    {
    	this.highlight(obj);
    }
	
	this.processEnterKey();
}
SceneFaceRecogSignin.prototype.processMouseOverEvent = function(obj){
	alert("SceneFaceRecogSignin.processMouseOverEvent() ");
	
	var currentHighlight =  this.MainView.getCurrentHighlight();
	if(obj==this.FaceRecogMouseBtn){
		this.highlight(this.FaceRecogTabBtn);
		return;
	}else if(obj==this.IDPWMouseBtn){
		var image_layer = this.FaceRecogTabBtn.GetBGLayer();
		if(currentHighlight==this.FaceRecogTabBtn){
			image_layer.SetBgImage(g_Image.IMAGE_FACERECOGNITION_TAB_HIGHLIGHT_OVER_BG);
		}else{
			image_layer.SetBgImage(g_Image.IMAGE_FACERECOGNITION_TAB_OVER_BG);
		}
		return;
	}else{
		this.FaceRecogTabBtn.GetBGLayer().SetBgImage(g_Image.IMAGE_FACERECOGNITION_TAB_BG);
	}
    if(currentHighlight != obj)
    {
    	this.highlight(obj);
    }
	
	// this.processEnterKey();
}
SceneFaceRecogSignin.prototype.changeBG = function(flag){
	alert("SceneFaceRecogSignin.changeBG() : "+flag);
	var cameraImagePath = null;
	if(WndMgr.Bg_FaceRecog != null){
		cameraImagePath = WndMgr.Bg_FaceRecog.src;
	}else{
		cameraImagePath = g_Image.IMAGE_FACERECOGNITION_CAMERA_BG
	}
	if(flag){
		$("#skype_main_bg").css('background-image','url('+cameraImagePath+')');
	}else{
		$("#skype_main_bg").css('background-image','url('+g_Image.IMAGE_SKYPE_BG+')');
	}
}
SceneFaceRecogSignin.prototype.hideTabOverImage = function(){
	alert("SceneFaceRecogSignin.hideTabOverImage() ");
	var currentHighlight =  this.MainView.getCurrentHighlight();
	switch(currentHighlight){
		case this.FaceRecogTabBtn:
			this.highlight(this.FaceRecogTabBtn);
			break;
		default:
   			this.FaceRecogTabBtn.GetBGLayer().SetBgImage(g_Image.IMAGE_FACERECOGNITION_TAB_BG);
			break;
	}
}
