(function (lib, img, cjs) {

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

// library properties:
lib.properties = {
	width: 1648,
	height: 900,
	fps: 30,
	color: "#FFFFFF",
	manifest: [
		{src:"images/gfx_1.png", id:"gfx_1"},
		{src:"images/gfx_2.png", id:"gfx_2"},
		{src:"images/gfx_3.png", id:"gfx_3"},
		{src:"images/gfx_4.png", id:"gfx_4"},
		{src:"images/gfx_5.png", id:"gfx_5"},
		{src:"images/gfx_6.png", id:"gfx_6"},
		{src:"images/gfx_7.png", id:"gfx_7"},
		{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(824,450,1658,899);
p.frameBounds = [rect];


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


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


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


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


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


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


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


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


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


(lib.point = 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,144,203);
p.frameBounds = [rect];


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(0,0,397,448);
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: '1225',
			title: 'Policz owoce w każdym koszyku i połącz je z odpowiednimi liczbami.',
			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:*/ '4',
				/*drop_2:*/ '1',
				/*drop_3:*/ '3',
				/*drop_4:*/ '2',	
			],
			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_4 = new lib.point();
	this.drag_4.setTransform(1468.1,365.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.point();
	this.drag_3.setTransform(1054.1,365.4,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.point();
	this.drag_2.setTransform(618.1,365.4,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.point();
	this.drag_1.setTransform(198.1,365.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}]}).wait(1));

	// rope
	this.ropepoint_4 = new lib.point();
	this.ropepoint_4.setTransform(1468.1,365.4,0.528,0.528);

	this.ropepoint_3 = new lib.point();
	this.ropepoint_3.setTransform(1054.1,365.4,0.528,0.528);

	this.ropepoint_2 = new lib.point();
	this.ropepoint_2.setTransform(618.1,365.4,0.528,0.528);

	this.ropepoint_1 = new lib.point();
	this.ropepoint_1.setTransform(198.1,365.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}]}).wait(1));

	// content
	this.drop_4 = new lib.point();
	this.drop_4.setTransform(1290.1,655.4,0.528,0.528);

	this.drop_3 = new lib.point();
	this.drop_3.setTransform(970.1,655.4,0.528,0.528);

	this.drop_2 = new lib.point();
	this.drop_2.setTransform(671.1,655.4,0.528,0.528);

	this.drop_1 = new lib.point();
	this.drop_1.setTransform(377.1,655.4,0.528,0.528);

	this.gfx_1 = new lib.gfx_1_1();
	this.gfx_1.setTransform(198.5,228,1,1,0,0,0,198.5,224);

	this.gfx_2 = new lib.gfx_2_1();
	this.gfx_2.setTransform(612.5,241.5,1,1,0,0,0,198.5,210.5);

	this.gfx_3 = new lib.gfx_3_1();
	this.gfx_3.setTransform(1045.5,226,1,1,0,0,0,210.5,226);

	this.gfx_4 = new lib.gfx_4_1();
	this.gfx_4.setTransform(1459.5,246.5,1,1,0,0,0,198.5,205.5);

	this.gfx_8 = new lib.gfx_8_1();
	this.gfx_8.setTransform(1270,795.5,1,1,0,0,0,72,101.5);

	this.gfx_7 = new lib.gfx_7_1();
	this.gfx_7.setTransform(977,795.5,1,1,0,0,0,67,103.5);

	this.gfx_6 = new lib.gfx_6_1();
	this.gfx_6.setTransform(676,795,1,1,0,0,0,66,103);

	this.gfx_5 = new lib.gfx_5_1();
	this.gfx_5.setTransform(374,795.5,1,1,0,0,0,51,101.5);

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

}).prototype = p = new cjs.MovieClip();
p.nominalBounds = rect = new cjs.Rectangle(0,0,1658,899);
p.frameBounds = [rect];

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