(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: "#FFFFFF",
	manifest: [
		{src:"images/Bitmap1.png", id:"Bitmap1"},
		{src:"images/Bitmap2.png", id:"Bitmap2"},
		{src:"images/gfx_point.png", id:"gfx_point"},
		{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,739,505);


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


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


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


(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.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: '22104',
			title: 'Połącz symbole pasujące do jesiennej pogody ze słowem Autumn.',
			type: 'rope',
			container: this,
			groupdrags: {		
				1: [1,3],
				2: [2,4],
			},
			/*
			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:*/ '1',	
			],
			range: 100,
			alpha: 1,
			alpha2: 1,
			//scale: 0.8,
			//zindex: 0
			color: '#FFCC00',
			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));

	// as
	this.sound_4 = new lib.soundPlayer();
	this.sound_4.setTransform(966,181.9);

	this.sound_3 = new lib.soundPlayer();
	this.sound_3.setTransform(1049,257.7);

	this.sound_2 = new lib.soundPlayer();
	this.sound_2.setTransform(884,89.4);

	this.sound_1 = new lib.soundPlayer();
	this.sound_1.setTransform(1157.9,229.1);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.sound_1},{t:this.sound_2},{t:this.sound_3},{t:this.sound_4}]}).wait(1));

	// drag
	this.drag_4 = new lib.gfx_point_mc();
	this.drag_4.setTransform(1154.2,316,0.338,0.338);
	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(1066,316,0.338,0.338);
	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(939,230.1,0.338,0.338);
	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(824.3,92.1,0.338,0.338);
	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}]}).wait(1));

	// rope
	this.ropepoint_4 = new lib.gfx_point_mc();
	this.ropepoint_4.setTransform(1154.2,316,0.338,0.338);

	this.ropepoint_3 = new lib.gfx_point_mc();
	this.ropepoint_3.setTransform(1066,316,0.338,0.338);

	this.ropepoint_2 = new lib.gfx_point_mc();
	this.ropepoint_2.setTransform(939,230.1,0.338,0.338);

	this.ropepoint_1 = new lib.gfx_point_mc();
	this.ropepoint_1.setTransform(824.3,92.1,0.338,0.338);

	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_2 = new lib.gfx_point_mc();
	this.drop_2.setTransform(442.4,323.7,0.338,0.338);

	this.drop_1 = new lib.gfx_point_mc();
	this.drop_1.setTransform(441.5,280.7,0.338,0.338);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.drop_1},{t:this.drop_2}]}).wait(1));

	// content
	this.instance = new lib.Bitmap2();
	this.instance.setTransform(81.1,262.5);

	this.instance_1 = new lib.Bitmap1();
	this.instance_1.setTransform(502,33.8);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance_1},{t:this.instance}]}).wait(1));

}).prototype = p = new cjs.MovieClip();
p.nominalBounds = rect = new cjs.Rectangle(81.1,33.8,1159.9,505);
p.frameBounds = [rect];


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

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

	this.addChild(this.container);
}).prototype = p = new cjs.Container();
p.nominalBounds = rect = new cjs.Rectangle(721.2,393.8,1159.9,505);
p.frameBounds = [rect];

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