(function (lib, img, cjs) {

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

// library properties:
lib.properties = {
	width: 1738,
	height: 959,
	fps: 30,
	color: "#FFFFFF",
	manifest: [
		{src:"images/gfx_0.png", id:"gfx_0"},
		{src:"images/gfx_1a.png", id:"gfx_1a"},
		{src:"images/gfx_1b.png", id:"gfx_1b"},
		{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"}
	]
};

// 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(869,497.5,1738.7,941);
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,774,434);


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


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


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


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


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


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


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


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


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

	// Layer 1
	this.instance = new lib.gfx_6();
	this.instance.setTransform(-100.5,-184.5);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-100.5,-184.5,201,369);
p.frameBounds = [rect];


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

	// Layer 1
	this.instance = new lib.gfx_5();
	this.instance.setTransform(-169.7,-140.8);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-169.7,-140.8,339,282);
p.frameBounds = [rect];


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

	// Layer 1
	this.instance = new lib.gfx_4();
	this.instance.setTransform(-129.9,-70.4);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-129.9,-70.4,260,141);
p.frameBounds = [rect];


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

	// Layer 1
	this.instance = new lib.gfx_7();
	this.instance.setTransform(-93.1,-89.7);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-93.1,-89.7,186,179);
p.frameBounds = [rect];


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

	// Layer 1
	this.instance = new lib.gfx_3();
	this.instance.setTransform(-53.1,-112.3);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-53.1,-112.3,106,225);
p.frameBounds = [rect];


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

	// Layer 1
	this.instance = new lib.gfx_2();
	this.instance.setTransform(-178.7,-129.3);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-178.7,-129.3,358,259);
p.frameBounds = [rect];


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

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

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


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

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

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


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

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

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(0,0,774,434);
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() {
		/* Ustawienia */
		var config = {
			id: '2089',
			title: 'Spakuj do walizki rzeczy niezbędne podczas wyjazdu na wakacje.',
			type: 'drag',
			container: this,
			prefix: 'drag_',
			prefix2: 'drop_',
			groupdrags: {		
				1: ['1', '2', '3', '6'],
			},
			/*
			groupdrops: {
				1: [1,2,3],
				2: [4,5,6],
				3: [7,8,9]
			},
			*/	
			results: [
				/*drop_1:*/ '1',
				/*drop_2:*/ '1',
				/*drop_3:*/ '1',
				/*drop_4:*/ '1',	
			],
			range: 20,
			alpha: 0,
			alpha2: 0,
			scale: 0.8,
			//rotation: 'auto',
			//size: 'auto',
			zindex: 3,
			
			exerciseAfterInit: function(container) {
				container['drag_1'].rotate = 60;
				container['drag_2'].rotate = 60;
				container['drag_3'].rotate = 0;
				container['drag_4'].rotate = 60;
				container['drag_6'].rotate = 60;
			},
			exerciseBeforeFinish: function(container) {
				
			},
			exerciseExtraCheck: function(container) {
				
			},
		}
		
		exerciseOnInit(config);
		
		this.stop();
		
		/*---------------------------------------------------------------------------------------------------------------
		/* Help
		/*---------------------------------------------------------------------------------------------------------------
		 
		id - Id cwiczenia
		title - Tytul cwiczenia
		type - Typ Cwiczenia
		contanier - Kontener cwiczenia
		groupdrags - Lista grup dagow oraz przypisane do nich identyfikatory (unikatowa liczba) obiektow bez prefixow
		groupdrags - Lista grup targetow 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
		rotation - Dostosowanie obrotu obiektu do targetu
		scale - Skalowanie obiektu po upuszczeniu
		size - Skalowanie obiektu do rozmiarow targetu
		zindex - Pozycja z obiektu
		/*-------------------------------------------------------------------------------------------------------------*/
	}

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

	// drop_4
	this.drop_4 = new lib.drop();
	this.drop_4.setTransform(933.3,698.2,1,1,0,0,0,340.1,249.1);

	this.timeline.addTween(cjs.Tween.get(this.drop_4).wait(1));

	// drop_3
	this.drop_3 = new lib.drop();
	this.drop_3.setTransform(1044.4,587.2,1,1,0,0,0,451.2,138.1);

	this.timeline.addTween(cjs.Tween.get(this.drop_3).wait(1));

	// drop_2
	this.drop_2 = new lib.drop();
	this.drop_2.setTransform(1065.3,517.1,1,1,0,0,0,472.1,68);

	this.timeline.addTween(cjs.Tween.get(this.drop_2).wait(1));

	// drop_1
	this.drop_1 = new lib.drop();
	this.drop_1.setTransform(807.3,626.2,1,1,0,0,0,214.1,177.1);

	this.timeline.addTween(cjs.Tween.get(this.drop_1).wait(1));

	// content
	this.gfx_2 = new lib.gfx_1b_1();
	this.gfx_2.setTransform(979.1,739.5,1,1,0,0,0,443,219.5);

	this.drag_3 = new lib.gfx_4_1();
	this.drag_3.setTransform(118.5,826.3);

	this.drag_2 = new lib.gfx_7_1();
	this.drag_2.setTransform(296.5,522.9);

	this.drag_6 = new lib.gfx_6_1();
	this.drag_6.setTransform(1569.4,474.9);

	this.drag_5 = new lib.gfx_5_1();
	this.drag_5.setTransform(1453.8,193.4);

	this.drag_4 = new lib.gfx_3_1();
	this.drag_4.setTransform(1230.2,279.6);

	this.drag_1 = new lib.gfx_2_1();
	this.drag_1.setTransform(178.8,180.4);

	this.gfx_1 = new lib.gfx_1a_1();
	this.gfx_1.setTransform(921.6,374.5,1,1,0,0,0,500.5,356.5);

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

}).prototype = p = new cjs.MovieClip();
p.nominalBounds = rect = new cjs.Rectangle(0,18,1738.7,941);
p.frameBounds = [rect];

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