LSystem.screen(LStage.FULL_SCREEN);
function doScroll() {
	if(window.pageYOffset === 0) {
		window.scrollTo(0, 1);
	}
}
window.onload = function() {
	setTimeout(doScroll, 100);
	init(50,"mylegend",800,432,main,LEvent.INIT);
}
window.onorientationchange = function() {
	setTimeout(doScroll, 100);
};
window.onresize = function() {
	setTimeout(doScroll, 100);
}
var loadingLayer;
var loadData = [
{path:"src/sousou/map/s/LSouSouSMap.js",type:"js"},
{path:"src/sousou/map/s/LSouSouSMapBackground.js",type:"js"},
{path:"src/sousou/map/s/LSouSouSMapMiniView.js",type:"js"},

{path:"src/sousou/utils/LSouSouObject.js",type:"js"},
{path:"src/sousou/utils/LSouSouMember.js",type:"js"},

{path:"src/sousou/character/LSouSouCharacter.js",type:"js"},
{path:"src/sousou/character/s/LSouSouCharacterS.js",type:"js"},
{path:"src/sousou/character/s/LStaticSouSouCharacterS.js",type:"js"},

{name:"chara",path:"./initialization/chara.json",type:"text"},

{name:"bar-up",path:"./images/common/bar-up.png"},
{name:"bar-right-up",path:"./images/common/bar-right-up.png"},
{name:"bar-right-down",path:"./images/common/bar-right-down.png"},
{name:"bar-right",path:"./images/common/bar-left.png"},
{name:"bar-left-up",path:"./images/common/bar-left-up.png"},
{name:"bar-left-down",path:"./images/common/bar-left-down.png"},
{name:"bar-left",path:"./images/common/bar-left.png"},
{name:"bar-down",path:"./images/common/bar-down.png"},
{name:"s-view-atk",path:"./images/characters/s/view/atk.png"},
{name:"s-view-mov",path:"./images/characters/s/view/mov.png"},
{name:"s-view-spc",path:"./images/characters/s/view/spc.png"}
];
function main(){
	LGlobal.setDebug(true);
	loadingLayer = new LoadingSample3();
	addChild(loadingLayer);	
	LLoadManage.load(
		loadData,
		function(progress){
			loadingLayer.setProgress(progress);
		},
		scriptStart
	);
}
function scriptStart(result){
	removeChild(loadingLayer);
	loadingLayer = null;
	
	LGlobal.chara = JSON.parse(result["chara"]);
	delete result["chara"];

	LGlobal.imglist = result;

	var sc = "Load.script(script/Main.ls?"+(new Date()).getTime()+");";
	var sp = new LSprite();
	addChild(sp);
	var script = new LScript(sp,sc);
}