var Loading = {

	preload: function() {
		// game.load.image('loadingbar', './image/phaser.png');
	},

	create: function() {
		// var userID = sessionStorage.getItem("UserID");
		// console.log("userID : " + userID);

		game.stage.backgroundColor = '#4d4d4d';

		// //	Progress report
  //   	this.textProgress = game.add.text(game.world.centerX, 100, '로딩중 . . .', textStyleBasic);
		// this.textProgress.anchor.setTo(0.5, 0.4);
		// this.textProgress.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);

		// // Preload bar
		// this.preloadBar = this.add.sprite(game.world.centerX, game.world.centerY, 'loadingbar');
		// this.preloadBar.anchor.setTo(0.5);
		// this.preloadBar.alpha = 0;

		game.load.onFileComplete.add(this.fileComplete, this);
		game.load.onLoadComplete.add(this.loadComplete, this);

		this.startLoading();
	},

	startLoading: function() {
		game.load.image('icon_fullscreen',	'../../../resources/image/icon/fullscreen_white.png');
		game.load.image('icon_home', '../../../resources/image/icon/home.png');

		// SpriteIconTimer.loadResources();

		game.load.image('windows_wallpaper', '../../../resources/image/license/itq/windows_wallpaper.png');
		game.load.image('wait_wallpaper', '../../../resources/image/license/itq/wait_wallpaper.png');

		game.load.image('pen', '../../../resources/image/license/itq/pen.png');
		game.load.image('itq_testsheet', '../../../resources/image/license/itq/itq_testsheet.png');
		game.load.image('itq_testsheet_id', '../../../resources/image/license/itq/itq_testsheet_id.png');
		game.load.image('itq_testsheet_small', '../../../resources/image/license/itq/itq_testsheet_small.png');
		game.load.image('personal_id', '../../../resources/image/license/itq/personal_id.jpg');

		game.load.image('popup_check_info', '../../../resources/image/license/itq/popup_check_info.png');
		game.load.image('popup_check_saved_file', '../../../resources/image/license/itq/popup_check_saved_file.png');
		game.load.image('popup_check_success_transfer', '../../../resources/image/license/itq/popup_check_success_transfer.png');
		game.load.image('popup_register', '../../../resources/image/license/itq/popup_register.png');
		game.load.image('popup_save_filename', '../../../resources/image/license/itq/popup_save_filename.png');
		game.load.image('popup_save_folder', '../../../resources/image/license/itq/popup_save_folder.png');
		game.load.image('popup_select_version', '../../../resources/image/license/itq/popup_select_version.png');
		game.load.image('program_control_center_after_transfer', '../../../resources/image/license/itq/program_control_center_after_transfer.png');
		game.load.image('program_control_center', '../../../resources/image/license/itq/program_control_center.png');


		game.load.start();
	},

	fileComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
		// this.preloadBar.alpha = progress / 100;

		// console.log('progress : ' + progress);

		// text.setText("File Complete: " + progress + "% - " + totalLoaded + " out of " + totalFiles);

		// var newImage = game.add.image(x, y, cacheKey);
		// newImage.scale.set(0.3);

		// x += newImage.width + 20;
		// if (x > 700)
		// {
		// 	x = 32;
		// 	y += 332;
		// }
	},

	loadComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
		// this.preloadBar.alpha = 1;

		// if(isDebugMode()) {
		// 	this.state.start('Login');
		// 	return;
		// }

		this.state.start('Simulator');
	},
}
