(function (lib, img, cjs) {

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

// library properties:
lib.properties = {
	width: 1280,
	height: 720,
	fps: 30,
	color: "#CCCCCC",
	manifest: [
		{src:"images/Bitmap1.png", id:"Bitmap1"},
		{src:"images/Bitmap10.png", id:"Bitmap10"},
		{src:"images/Bitmap11.png", id:"Bitmap11"},
		{src:"images/Bitmap12.png", id:"Bitmap12"},
		{src:"images/Bitmap5.png", id:"Bitmap5"},
		{src:"images/Bitmap6.png", id:"Bitmap6"},
		{src:"images/Bitmap7.png", id:"Bitmap7"},
		{src:"images/Bitmap8.png", id:"Bitmap8"},
		{src:"images/Bitmap9.png", id:"Bitmap9"},
		{src:"images/gfxSound.png", id:"gfxSound"}
	]
};



// symbols:



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


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


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


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


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


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


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


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


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


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


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

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

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


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

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

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


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

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

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


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

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

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


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

	// Layer 1
	this.instance = new lib.gfxSound();
	this.instance.setTransform(-32,-23);

	this.addChild(this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-32,-23,64,46);
p.frameBounds = [rect];


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

	// Layer 1
	this.instance = new lib.Symbol5();
	this.instance.setTransform(78.6,47.3,1,1,0,0,0,79,51);
	this.instance.alpha = 0.012;

	this.instance_1 = new lib.Bitmap10();

	this.addChild(this.instance_1,this.instance);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(-0.4,-3.7,158,102);
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: '22100',
			title: 'Umieść przedmioty w odpowiednich miejscach.',
			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:*/ '2',
				/*drop_3:*/ '3',
				/*drop_4:*/ '4',		
			],
			range: 20,
			alpha: 0,
			alpha2: 0,
			//scale: 0.8,
			//rotation: 'auto',
			//size: 'auto',
			//zindex: 3,
			
			exerciseAfterInit: function(container) {
				//container['drag_1'].rotate = 60;
			},
			exerciseBeforeFinish: function(container) {
				
			},
			exerciseExtraCheck: function(config, dragCurrent, dropIndex, isCorrect) {
				if(isCorrect === true) {
					createjs.Sound.play(config.id + '_' + parseInt(dropIndex+1));
				}		
			},
		}
		
		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));

	// content
	this.sound_4 = new lib.soundPlayer();
	this.sound_4.setTransform(-57.2,228);

	this.sound_3 = new lib.soundPlayer();
	this.sound_3.setTransform(-57.2,158);

	this.sound_2 = new lib.soundPlayer();
	this.sound_2.setTransform(-57.2,90.8);

	this.sound_1 = new lib.soundPlayer();
	this.sound_1.setTransform(-57.2,23.5);

	this.drop_2 = new lib.Symbol2();
	this.drop_2.setTransform(1079.9,228.7,1,1,0,0,0,74.5,45);

	this.drop_1 = new lib.Symbol3();
	this.drop_1.setTransform(216.4,215.9,1,1,0,0,0,59.5,50.5);

	this.drop_4 = new lib.Symbol4();
	this.drop_4.setTransform(439.5,150.3,1,1,0,0,0,64.5,111);

	this.drop_3 = new lib.Symbol1();
	this.drop_3.setTransform(791.4,227.8,1,1,0,0,0,120.5,50);

	this.drag_4 = new lib.Symbol4();
	this.drag_4.setTransform(950.2,415,1,1,0,0,0,64.5,111);

	this.drag_1 = new lib.Symbol3();
	this.drag_1.setTransform(778.3,461.5,1,1,0,0,0,59.5,50.5);

	this.drag_2 = new lib.Symbol2();
	this.drag_2.setTransform(597.9,404.7,1,1,0,0,0,74.5,45);

	this.drag_3 = new lib.Symbol1();
	this.drag_3.setTransform(397.4,471.1,1,1,0,0,0,120.5,50);

	this.instance = new lib.Bitmap8();
	this.instance.setTransform(991.8,26);

	this.instance_1 = new lib.Bitmap7();
	this.instance_1.setTransform(671,20.8);

	this.instance_2 = new lib.Bitmap5();
	this.instance_2.setTransform(63.9,29.4);

	this.instance_3 = new lib.Bitmap6();
	this.instance_3.setTransform(375,37.3);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance_3},{t:this.instance_2},{t:this.instance_1},{t:this.instance},{t:this.drag_3},{t:this.drag_2},{t:this.drag_1},{t:this.drag_4},{t:this.drop_3},{t:this.drop_4},{t:this.drop_1},{t:this.drop_2},{t:this.sound_1},{t:this.sound_2},{t:this.sound_3},{t:this.sound_4}]}).wait(1));

}).prototype = p = new cjs.MovieClip();
p.nominalBounds = rect = new cjs.Rectangle(-89.2,0.5,1323,525.5);
p.frameBounds = [rect];


// 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(550.8,360.5,1323,525.5);
p.frameBounds = [rect];

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