(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/Bitmap1.png", id:"Bitmap1"},
		{src:"images/Bitmap10.png", id:"Bitmap10"},
		{src:"images/Bitmap2.png", id:"Bitmap2"},
		{src:"images/Bitmap3.png", id:"Bitmap3"},
		{src:"images/Bitmap4.png", id:"Bitmap4"},
		{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/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,1631,889.2);
p.frameBounds = [rect];


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


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


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


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


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


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


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


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


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


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


(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_mc = 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.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: '2114',
			title: 'Połącz ze sobą połówki monet i banknotów.',
			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:*/ '1',
				/*drop_2:*/ '2',
				/*drop_3:*/ '3',
				/*drop_4:*/ '4',	
				/*drop_5:*/ '5',	
			],
			range: 100,
			alpha: 1,
			alpha2: 1,
			//scale: 0.8,
			//zindex: 0
			color: '#000000',
			stroke: 10,
			
			exerciseAfterInit: function (container) {
			},
			exerciseBeforeFinish: function(container) {		
			},
			exerciseExtraCheck: function(container) {		
			},
		}
		
		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_5 = new lib.gfx_point_mc();
	this.drag_5.setTransform(324,542.1,0.528,0.528);
	this.drag_5.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 0, 0, 0)];
	this.drag_5.cache(-52,-52,104,104);

	this.ropepoint_5 = new lib.gfx_point_mc();
	this.ropepoint_5.setTransform(324,542.1,0.528,0.528);

	this.drag_4 = new lib.gfx_point_mc();
	this.drag_4.setTransform(619.9,155.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_mc();
	this.drag_3.setTransform(920,595.5,0.528,0.528);
	this.drag_3.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 0, 0, 0)];
	this.drag_3.cache(-52,-52,104,104);

	this.drag_2 = new lib.gfx_point_mc();
	this.drag_2.setTransform(818.1,269.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.gfx_point_mc();
	this.drag_1.setTransform(566.2,517.5,0.528,0.528);
	this.drag_1.filters = [new cjs.ColorFilter(0.5, 0.5, 0.5, 1, 127.5, 0, 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.ropepoint_5},{t:this.drag_5}]}).wait(1));

	// rope
	this.ropepoint_4 = new lib.gfx_point_mc();
	this.ropepoint_4.setTransform(619.9,155.4,0.528,0.528);

	this.ropepoint_3 = new lib.gfx_point_mc();
	this.ropepoint_3.setTransform(920,595.5,0.528,0.528);

	this.ropepoint_2 = new lib.gfx_point_mc();
	this.ropepoint_2.setTransform(818.1,269.4,0.528,0.528);

	this.ropepoint_1 = new lib.gfx_point_mc();
	this.ropepoint_1.setTransform(566.2,517.5,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));

	// drop
	this.drop_5 = new lib.gfx_point_mc();
	this.drop_5.setTransform(559.1,747.4,0.528,0.528);

	this.drop_4 = new lib.gfx_point_mc();
	this.drop_4.setTransform(1196,399.4,0.528,0.528);

	this.drop_3 = new lib.gfx_point_mc();
	this.drop_3.setTransform(1440.2,127.3,0.528,0.528);

	this.drop_2 = new lib.gfx_point_mc();
	this.drop_2.setTransform(1101.2,119.3,0.528,0.528);

	this.drop_1 = new lib.gfx_point_mc();
	this.drop_1.setTransform(1159.3,725.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.drop_4},{t:this.drop_5}]}).wait(1));

	// content
	this.instance = new lib.Bitmap10();
	this.instance.setTransform(596.7,571.2);

	this.instance_1 = new lib.Bitmap9();
	this.instance_1.setTransform(0,368);

	this.instance_2 = new lib.Bitmap8();
	this.instance_2.setTransform(1206.1,271);

	this.instance_3 = new lib.Bitmap7();
	this.instance_3.setTransform(296.8,50.6);

	this.instance_4 = new lib.Bitmap6();
	this.instance_4.setTransform(1473,0);

	this.instance_5 = new lib.Bitmap5();
	this.instance_5.setTransform(943.6,476.6);

	this.instance_6 = new lib.Bitmap4();
	this.instance_6.setTransform(1107.6,26.2);

	this.instance_7 = new lib.Bitmap3();
	this.instance_7.setTransform(653.1,251.4);

	this.instance_8 = new lib.Bitmap2();
	this.instance_8.setTransform(1167.3,571.2);

	this.instance_9 = new lib.Bitmap1();
	this.instance_9.setTransform(366.8,377.6);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance_9},{t:this.instance_8},{t:this.instance_7},{t:this.instance_6},{t:this.instance_5},{t:this.instance_4},{t:this.instance_3},{t:this.instance_2},{t:this.instance_1},{t:this.instance}]}).wait(1));

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

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