extend(Tutorial, createjs.Container);

function Tutorial()
{	
	this.initialize();
	var th = this
//--------------------------------//

	var d_size = 0
	var steps = {
		"1": [ [ ["1_1", 36, 100 - d_size], ["1_1(2)", 36, 428 + d_size] ], [ ["2_1", 264, 184] ], [ ["2_2", 277, 166] ], [ ["3", 364, 100 - d_size ]] ],
		"2": [  [ ["4_1", 240, 259] ], [ ["4_2", 380, 444] ], [ ["4_3", 14, 202 ]], [ ["4_4", 189, 108 ]] ]

	}
	
	var curHint, activeHints

	this.start = function(step, dy, dontUp){
		th.removeAllChildren()
		d_size = dy*__koefDisplay
		update()
		var curStep = steps[step]
		activeHints = new Array()
		if(!dontUp)
			curHint = -1
		else
			curHint--
		if(!curStep)
			return
		for(var a=0; a<curStep.length; a++){
			var con = new createjs.Container()
			if(!curStep[a])
				return
			for(var b=0; b<curStep[a].length; b++){
				var curH = curStep[a][b][0]// : curStep[a][0]
				var coor = {x: curStep[a][b][1], y: curStep[a][b][2]}// : {x: curStep[a][1], y: curStep[a][2]}
				var h = new createjs.Sprite(jsons["JSON1"])
				h.gotoAndStop("hints" + curH)
				setCoor(h, coor.x, coor.y)
				con.addChild(h)
				// dragAndDrop(h)
			}
			con.visible = false
			th.addChild(con)
			activeHints.push(con)
		}

		this.nextHint()
	}

	this.nextHint = function(){
		curHint ++
		for(var a=0; a<activeHints.length; a++)
			activeHints[a].visible = false
		if(curHint>activeHints.length-1)
			return false
		// console.log(curHint, activeHints)
		activeHints[curHint].visible = true

		return curHint
	}

	function update(){
		steps = {
			"1": [ [ ["1_1", 36, 100 - d_size], ["1_1(2)", 36, 428 + d_size] ], [ ["2_1", 264, 184] ], [ ["2_2", 277, 166] ], [ ["3", 364, 100 - d_size ]] ],
			"2": [  [ ["4_1", 240, 259] ], [ ["4_2", 380, 444 + d_size] ], [ ["4_3", 14, 202 -  d_size]], [ ["4_4", 189, 108 - d_size]] ]

		}
	}
}