alert("init.js loaded");
function onStart () {
	// TODO : Add your Initilize code here
	// NOTE : In order to start your app, call "sf.start()" at the end of this function!!    
    
    //setInterval("Network.check();", 30000);
	setTimeout("Network.check();", 3000);
    AppContext.ClientSettings.Language = AppContext.Languages[0];  
	
	var now = new Date();
	var unow = Helpers.getUtcTime(now);
	AppContext.deviceOffset = (now - unow)/60000;
    Resources.getResources(AppContext.Languages[0].cultureInfo);

	var success = function () {
		$("#loadingObject").sfLoading("hide");
		SceneLogin.successLogin();
    };
	
	var errCb = function () {
		$("#loadingObject").sfLoading("hide");
        $.sfScene.show('Login');
        $.sfScene.focus('Login');
    };
	
    var loginData = Helpers.getLoginData(window.location.search);
    var DUID = Helpers.getDUID();
    
	Login.completeLogin(DUID, loginData[0], loginData[1], success, errCb);
	/*$.sfScene.show('Login');
	$.sfScene.focus('Login');*/
	$("#loadingObject").sfLoading("show");
}

function onDestroy () {
	//stop your XHR or Ajax operation and put codes to distroy your application here
	
}
