extend(ChoiseLvl, createjs.Container);

function ChoiseLvl()
{	
	this.initialize();
	var th = this
//--------------------------------//
	var t = new createjs.Sprite(jsons["JSON2"]);
	t.gotoAndStop("window")
	t.x = WIDTHGAME/2 - t.getBounds().width/2
	t.y = HEIGHTGAME/2 - t.getBounds().height/2

	var title1 = new createjs.Sprite(jsons["JSON2"]);			/// Заголовок
	title1.gotoAndStop("text_red_map");
	setCoor(title1, 140, 6)
	title1.x = WIDTHGAME/2 - title1.getBounds().width/2
	// title1.addEventListener("click", function(){window.open(__config.url, "_blank")})

	var title2 = new createjs.Sprite(jsons["JSON2"]);			/// Заголовок
	title2.gotoAndStop("text_red_choose_map");
	setCoor(title2, 140, 645)
	title2.x = WIDTHGAME/2 - title2.getBounds().width/2
	// dragAndDrop(title2)

	var small = new createjs.Sprite(jsons["JSON1"]);
	small.gotoAndStop("map_small")
	setCoor(small, 97, 135)
	small.addEventListener("click", function(){
		adManager.showAd(function() {
			if(st_getNumPlay() <1)
				v_choiseLocation("instructions", {game: true, size_field: 10});
			else
				v_choiseLocation("game", {size_field: 10});
		});
	})

	var medium = new createjs.Sprite(jsons["JSON1"]);
	medium.gotoAndStop("map_medium")
	setCoor(medium, 95, 303)
	medium.addEventListener("click", function(){
		adManager.showAd(function() {
			if(st_getNumPlay() <1)
				v_choiseLocation("instructions", {game: true, size_field: 12});
			else
				v_choiseLocation("game", {size_field: 12});
		});		
	})

	var large = new createjs.Sprite(jsons["JSON1"]);
	large.gotoAndStop("map_large")
	setCoor(large, 97, 475)
	large.addEventListener("click", function(){
		adManager.showAd(function() {
			if(st_getNumPlay() <1)
				v_choiseLocation("instructions", {game: true, size_field: 16});
			else
					v_choiseLocation("game", {size_field: 16});
		});
	})

	// dragAndDrop(small)
	// dragAndDrop(medium)
	// dragAndDrop(large)

	var btn_back = new Arrow("left")
	setCoor(btn_back, 54, 19)
	btn_back.addEventListener("click", function(){
		v_choiseLocation("menu");		
	})

	var frame = new FloatFrame()
	frame.addToTopPlatform(t, 0)
	frame.addToTopPlatform(title1)
	frame.addToTopPlatform(title2)
	frame.addToTopPlatform(small)
	frame.addToTopPlatform(medium)
	frame.addToTopPlatform(large)
	frame.addToTopPlatform(btn_back)
	
	// this.addChild(t)
	// this.addChild(title1)
	// this.addChild(btn_back)

	// this.addChild(small)
	// this.addChild(medium)
	// this.addChild(large)
	this.addChild(frame)

}