(function (lib, img, cjs) {

var p; // shortcut to reference prototypes
var rect; // used to reference frame bounds

// library properties:
lib.properties = {
	width: 1800,
	height: 900,
	fps: 30,
	color: "#FFFFFF",
	manifest: [
		{src:"images/gfx_0.png", id:"gfx_0"},
		{src:"images/gfx_1.png", id:"gfx_1"},
		{src:"images/gfx_3.png", id:"gfx_3"},
		{src:"images/gfx_5.png", id:"gfx_5"},
		{src:"images/gfx_6.png", id:"gfx_6"},
		{src:"images/gfx_8.png", id:"gfx_8"},
		{src:"images/gfx_point.png", id:"gfx_point"}
	]
};

// stage content:
(lib.index = function() {
	this.initialize();

	// exercise
	this.container = new lib.exerciseContainer();
	this.container.setTransform(916.5,389,1,1,0,0,0,916.5,389);

	this.addChild(this.container);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(896.4,451.1,1801.9,838.3);
p.frameBounds = [rect];


// symbols:
(lib.gfx_0 = function() {
	this.initialize(img.gfx_0);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,397,106);


(lib.gfx_1 = function() {
	this.initialize(img.gfx_1);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,466,115);


(lib.gfx_3 = function() {
	this.initialize(img.gfx_3);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,224,125);


(lib.gfx_5 = function() {
	this.initialize(img.gfx_5);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,388,207);


(lib.gfx_6 = function() {
	this.initialize(img.gfx_6);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,385,129);


(lib.gfx_8 = function() {
	this.initialize(img.gfx_8);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,510,764);


(lib.gfx_point = function() {
	this.initialize(img.gfx_point);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,53,53);


(lib.gfx_point_1 = function() {
	this.initialize();

	// Layer 1
	this.instance = new lib.gfx_point();
	this.instance.setTransform(-50,-50,1.887,1.887);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-50,-50,100,100);
p.frameBounds = [rect];


(lib.gfx_8_1 = function() {
	this.initialize();

	// Layer 1
	this.instance = new lib.gfx_8();

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(0,0,510,764);
p.frameBounds = [rect];


(lib.gfx_0_1 = function() {
	this.initialize();

	// Layer 1
	this.instance = new lib.gfx_0();
	this.instance.setTransform(-198.5,-53);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-198.5,-53,397,106);
p.frameBounds = [rect];


(lib.gfx_6_1 = function() {
	this.initialize();

	// Layer 1
	this.instance = new lib.gfx_0_1();
	this.instance.setTransform(199.7,136.9);
	this.instance.shadow = new cjs.Shadow("#000000",0,0,5);

	this.instance_1 = new lib.gfx_6();

	this.addChild(this.instance_1,this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-1.8,0,406,196.9);
p.frameBounds = [rect];


(lib.gfx_5_1 = function() {
	this.initialize();

	// Layer 1
	this.instance = new lib.gfx_0_1();
	this.instance.setTransform(198.5,202.6);
	this.instance.shadow = new cjs.Shadow("#000000",0,0,5);

	this.instance_1 = new lib.gfx_5();
	this.instance_1.setTransform(27.1,0);

	this.addChild(this.instance_1,this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-3,0,418.1,262.6);
p.frameBounds = [rect];


(lib.gfx_3_1 = function() {
	this.initialize();

	// Layer 1
	this.instance = new lib.gfx_0_1();
	this.instance.setTransform(198.5,142.8);

	this.instance_1 = new lib.gfx_3();
	this.instance_1.setTransform(6.8,0);

	this.addChild(this.instance_1,this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(0,0,397,195.8);
p.frameBounds = [rect];


(lib.gfx_1_1 = function() {
	this.initialize();

	// Layer 1
	this.instance = new lib.gfx_0_1();
	this.instance.setTransform(238.6,154);

	this.instance_1 = new lib.gfx_1();

	this.addChild(this.instance_1,this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(0,0,466,207);
p.frameBounds = [rect];


(lib.exerciseContainer = function(mode,startPosition,loop) {
if (loop == null) { loop = false; }	this.initialize(mode,startPosition,loop,{});

	// timeline functions:
	this.frame_0 = function() {
		/* Sortowanie */
		var config = {
			id: '1229',
			title: 'Znajdź szuflady, w których jest zero elementów i połącz je z cyfrą 0.',
			type: 'rope',
			container: this,
			/*
			groupdrags: {		
				1: [1,2,3],
				2: [4,5,6],
				3: [7,8,9]
			},
			groupdrops: {
				1: [1,2,3],
				2: [4,5,6],
				3: [7,8,9]
			},
			*/
			prefix: 'drag_',
			prefix2: 'drop_',
			prefix3: 'ropepoint_',
			prefix4: 'rope_',
			results: [
				/*drop_1:*/ '2|4|7',
				/*drop_2:*/ '2|4|7',
				/*drop_3:*/ '2|4|7',	
			],
			range: 100,
			alpha: 1,
			alpha2: 1,
			//scale: 0.8,
			//zindex: 0
			color: '#000000',
			stroke: 10
		}
		
		exerciseOnInit(config);
		
		this.stop();
		
		/* Help */
		
		/* 
		id - Id cwiczenia
		title - Tytul cwiczenia
		type - Typ Cwiczenia
		contanier - Kontener cwiczenia
		groups - Lista grup oraz przypisane do nich identyfikatory (unikatowa liczba) obiektow bez prefixow
		prefix - Prefixy w nazwach obiektow
		results - Rozwiazanie jako tablica identyfikatorow. Znak '|' definuje alternatywe, a '&' oznacza sume.	
		Przyklad:
		Cwiczenie typu sort.
		Odpowiedzi: [5,2,1,4,5] - tablica z ulozonymi w odpowiedniej kolejnisci identyfikatorami obiektow sortowanych.
		Cwiczenie typu drag.
		Odpowiedzi: [5,1|3,2&4] - tablica z id obiektow przeciaganych lub grup. W tym wariancie kazdy kolejny element z indexem 'i' w tablicy odpowiada targetowi o nazwie 'prefix+i'.
		np. prawidlowa odpowiedzia dla drop_1 jest obiekt drag_5, dla drop_2 obiekt drag_1 lub drag_3, dla drop_3 obiekt drag_2 oraz drag_4.
		range - Zakres dociagania
		alpha - Przezroczystosc targetu
		alpha2 - Przezroczystosc targetu po najechaniu
		scale - Skalowanie obiektu po upuszczeniu
		zindex - Warstwa obiektu
		*/
	}

	// actions tween:
	this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1));

	// drag
	this.drag_6 = new lib.gfx_point_1();
	this.drag_6.setTransform(1264,466.4,0.528,0.528);
	this.drag_6.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 0, 0, 0)];
	this.drag_6.cache(-52,-52,104,104);

	this.drag_7 = new lib.gfx_point_1();
	this.drag_7.setTransform(1200.8,685.5,0.528,0.528);
	this.drag_7.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 127.5, 0, 0)];
	this.drag_7.cache(-52,-52,104,104);

	this.drag_5 = new lib.gfx_point_1();
	this.drag_5.setTransform(1316.8,263.4,0.528,0.528);
	this.drag_5.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 127.5, 0, 0)];
	this.drag_5.cache(-52,-52,104,104);

	this.drag_4 = new lib.gfx_point_1();
	this.drag_4.setTransform(674.1,785.4,0.528,0.528);
	this.drag_4.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 0, 0, 0)];
	this.drag_4.cache(-52,-52,104,104);

	this.drag_3 = new lib.gfx_point_1();
	this.drag_3.setTransform(615.9,571.3,0.528,0.528);
	this.drag_3.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 127.5, 0, 0)];
	this.drag_3.cache(-52,-52,104,104);

	this.drag_2 = new lib.gfx_point_1();
	this.drag_2.setTransform(555.9,361.9,0.528,0.528);
	this.drag_2.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 0, 0, 0)];
	this.drag_2.cache(-52,-52,104,104);

	this.drag_1 = new lib.gfx_point_1();
	this.drag_1.setTransform(502.2,153.4,0.528,0.528);
	this.drag_1.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 127.5, 0, 0)];
	this.drag_1.cache(-52,-52,104,104);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.drag_1},{t:this.drag_2},{t:this.drag_3},{t:this.drag_4},{t:this.drag_5},{t:this.drag_7},{t:this.drag_6}]}).wait(1));

	// rope
	this.ropepoint_6 = new lib.gfx_point_1();
	this.ropepoint_6.setTransform(1264,466.4,0.528,0.528);

	this.ropepoint_7 = new lib.gfx_point_1();
	this.ropepoint_7.setTransform(1200.8,685.5,0.528,0.528);

	this.ropepoint_5 = new lib.gfx_point_1();
	this.ropepoint_5.setTransform(1316.8,263.4,0.528,0.528);

	this.ropepoint_4 = new lib.gfx_point_1();
	this.ropepoint_4.setTransform(674.1,785.4,0.528,0.528);

	this.ropepoint_3 = new lib.gfx_point_1();
	this.ropepoint_3.setTransform(615.9,571.3,0.528,0.528);

	this.ropepoint_2 = new lib.gfx_point_1();
	this.ropepoint_2.setTransform(555.9,361.9,0.528,0.528);

	this.ropepoint_1 = new lib.gfx_point_1();
	this.ropepoint_1.setTransform(502.2,153.4,0.528,0.528);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.ropepoint_1},{t:this.ropepoint_2},{t:this.ropepoint_3},{t:this.ropepoint_4},{t:this.ropepoint_5},{t:this.ropepoint_7},{t:this.ropepoint_6}]}).wait(1));

	// content
	this.gfx_8 = new lib.gfx_8_1();
	this.gfx_8.setTransform(917.7,457.4,1,1,0,0,0,255,382);

	this.gfx_6 = new lib.gfx_6_1();
	this.gfx_6.setTransform(1523.1,430.4,1,1,0,0,0,199.1,94.9);

	this.gfx_5 = new lib.gfx_5_1();
	this.gfx_5.setTransform(1590.8,187.8,1,1,0,0,0,207.6,127.8);

	this.gfx_3 = new lib.gfx_3_1();
	this.gfx_3.setTransform(351,529.8,1,1,0,0,0,198.5,97.9);

	this.gfx_1 = new lib.gfx_1_1();
	this.gfx_1.setTransform(229.4,104.6,1,1,0,0,0,233,103.5);

	this.gfx_7 = new lib.gfx_0_1();
	this.gfx_7.setTransform(1465.7,682.1);
	this.gfx_7.shadow = new cjs.Shadow("#000000",0,0,5);

	this.gfx_4 = new lib.gfx_0_1();
	this.gfx_4.setTransform(409,784.4);

	this.gfx_2 = new lib.gfx_0_1();
	this.gfx_2.setTransform(293,364.8);

	this.drop_3 = new lib.gfx_point_1();
	this.drop_3.setTransform(975.1,466.4,0.528,0.528);

	this.drop_2 = new lib.gfx_point_1();
	this.drop_2.setTransform(922.3,490.9,0.528,0.528);

	this.drop_1 = new lib.gfx_point_1();
	this.drop_1.setTransform(868.2,473.4,0.528,0.528);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.drop_1},{t:this.drop_2},{t:this.drop_3},{t:this.gfx_2},{t:this.gfx_4},{t:this.gfx_7},{t:this.gfx_1},{t:this.gfx_3},{t:this.gfx_5},{t:this.gfx_6},{t:this.gfx_8}]}).wait(1));

}).prototype = p = new cjs.MovieClip();
p.nominalBounds = rect = new cjs.Rectangle(-3.6,1.1,1801.9,838.3);
p.frameBounds = [rect];

})(lib = lib||{}, images = images||{}, createjs = createjs||{});
var lib, images, createjs;