function SceneContextLoading(options) {
	this.options = options;
    
    this.WidgetLoadingView=null;
    
    this.testpopup = null;

    this.LoadingBg = null;
    this.LoadingAni = null;
    this.LoadingMsg = null;
    
    this.LoadingAniImage = new Array(18);
    this.iCurrAniImage =0;
    
    this.WidgetLoadingTimer = null;
}

SceneContextLoading.prototype.initialize = function () {
	alert("SceneContextLoading.initialize()");

   this.create();
}

SceneContextLoading.prototype.handleShow = function () {
	alert("SceneContextLoading.handleShow()");

    this.startTimer();
}

SceneContextLoading.prototype.handleHide = function () {
	alert("SceneContextLoading.handleHide()");
	
	if(this.WidgetLoadingTimer != null)
	{
		this.stopTimer();
	}
}

SceneContextLoading.prototype.handleFocus = function () {
	alert("SceneContextLoading.handleFocus()");
}

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

SceneContextLoading.prototype.handleKeyDown = function (keyCode) {
	alert("SceneContextLoading.handleKeyDown(" + keyCode + ")");

	switch (keyCode) {
		case sf.key.LEFT:
		case sf.key.RIGHT:
		case sf.key.UP:
		case sf.key.DOWN:
		case sf.key.ENTER:
        case sf.key.RETURN:
		case sf.key.EXIT:            
		case 602:	//INFOLINK
		case 606:	//CONTENTS
		case 608:	//WISELINK
            sf.key.preventDefault();
			break;
	}
}

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

SceneContextLoading.prototype.create = function(){
    alert("SceneContextLoading.create()");
    
    this.WidgetLoadingView = new View("ContextLoading");
    this.WidgetLoadingView.SetBgImage('images/720p/skype_bg.png');
    
    var a=0;
    for (a=0; a < this.LoadingAniImage.length; a++)
    {
        var b = (a+1);
        if(b<10)
        {
            this.LoadingAniImage[a] = g_Image.base_loading96_image_path +"loading_96_"+"0"+b+".png";
        }
        else
        {
            this.LoadingAniImage[a] = g_Image.base_loading96_image_path +"loading_96_"+b+".png";
        }
    }
    
    this.LoadingAni= new Label("ContextLoading_animation", null);
    this.LoadingAni.SetBgImage(this.LoadingAniImage[this.iCurrAniImage]);
}

SceneContextLoading.prototype.startTimer = function()
{   
	var scene = sf.scene.get('ContextLoading');
    this.WidgetLoadingTimer = setInterval("CLoadingtimerCF()", 150);
    CLoadingtimerCF = function() {scene.loadingTimerCallback();}
}

SceneContextLoading.prototype.stopTimer = function()
{
    alert("SceneContextLoading.stopTimer() ");
    
	clearInterval( this.WidgetLoadingTimer);
    this.WidgetLoadingTimer = null;
    this.iCurrAniImage = 0;
}

SceneContextLoading.prototype.loadingTimerCallback = function()
{
     this.iCurrAniImage++;
     
    if(this.iCurrAniImage >= this.LoadingAniImage.length)
    {
        this.iCurrAniImage = 0;
    }   
    
    this.LoadingAni.SetBgImage(this.LoadingAniImage[this.iCurrAniImage]);
}



