(function (lib, img, cjs, ss, an) {

var p; // shortcut to reference prototypes
lib.ssMetadata = [];


// symbols:



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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


(lib.weight2 = function() {
	this.initialize(img.weight2);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,85,85);// helper functions:

function mc_symbol_clone() {
	var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop));
	clone.gotoAndStop(this.currentFrame);
	clone.paused = this.paused;
	clone.framerate = this.framerate;
	return clone;
}

function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) {
	var prototype = cjs.extend(symbol, cjs.MovieClip);
	prototype.clone = mc_symbol_clone;
	prototype.nominalBounds = nominalBounds;
	prototype.frameBounds = frameBounds;
	return prototype;
	}


(lib.vrvica_root = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 1
	this.instance = new lib.line();
	this.instance.parent = this;
	this.instance.setTransform(-3.5,0);

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

}).prototype = getMCSymbolPrototype(lib.vrvica_root, new cjs.Rectangle(-3.5,0,7,315), null);


(lib.stopwach_root = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

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

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

}).prototype = getMCSymbolPrototype(lib.stopwach_root, new cjs.Rectangle(0,0,188,86), null);


(lib.SliderButton = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 1
	this.instance = new lib.slider_button();
	this.instance.parent = this;
	this.instance.setTransform(-11.6,-11.7);

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

}).prototype = getMCSymbolPrototype(lib.SliderButton, new cjs.Rectangle(-11.6,-11.7,25,25), null);


(lib.ravnilo_ravnilo = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 1
	this.instance = new lib.ravnilo();
	this.instance.parent = this;
	this.instance.setTransform(-5.5,-18);

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

}).prototype = getMCSymbolPrototype(lib.ravnilo_ravnilo, new cjs.Rectangle(-5.5,-18,49,491), null);


(lib.ravnilo_kotomer = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

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

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

}).prototype = getMCSymbolPrototype(lib.ravnilo_kotomer, new cjs.Rectangle(0,0,514,262), null);


(lib.pivot = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 1
	this.instance = new lib.dot();
	this.instance.parent = this;
	this.instance.setTransform(-7.5,-7.5);

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

}).prototype = getMCSymbolPrototype(lib.pivot, new cjs.Rectangle(-7.5,-7.5,15,15), null);


(lib.numbers = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// timeline functions:
	this.frame_0 = function() {
		this.stop ();
	}

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

	// Layer 1
	this.instance = new lib.number_0();
	this.instance.parent = this;
	this.instance.setTransform(-13,-15.5);

	this.instance_1 = new lib.number_1();
	this.instance_1.parent = this;
	this.instance_1.setTransform(-13,-15.5);

	this.instance_2 = new lib.number_2();
	this.instance_2.parent = this;
	this.instance_2.setTransform(-13,-15.5);

	this.instance_3 = new lib.number_3();
	this.instance_3.parent = this;
	this.instance_3.setTransform(-13,-15.5);

	this.instance_4 = new lib.number_4();
	this.instance_4.parent = this;
	this.instance_4.setTransform(-13,-15.5);

	this.instance_5 = new lib.number_5();
	this.instance_5.parent = this;
	this.instance_5.setTransform(-13,-15.5);

	this.instance_6 = new lib.number_6();
	this.instance_6.parent = this;
	this.instance_6.setTransform(-13,-15.5);

	this.instance_7 = new lib.number_7();
	this.instance_7.parent = this;
	this.instance_7.setTransform(-13,-15.5);

	this.instance_8 = new lib.number_8();
	this.instance_8.parent = this;
	this.instance_8.setTransform(-13,-15.5);

	this.instance_9 = new lib.number_9();
	this.instance_9.parent = this;
	this.instance_9.setTransform(-13,-15.5);

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

}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(-13,-15.5,26,31);


(lib.Lucka = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

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

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

}).prototype = getMCSymbolPrototype(lib.Lucka, new cjs.Rectangle(0,0,38,39), null);


(lib.gumb_ustavi = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 2
	this.instance = new lib.napis_ustavi();
	this.instance.parent = this;
	this.instance.setTransform(-52,-8.5);

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

	// Layer 1
	this.instance_1 = new lib.gumb();
	this.instance_1.parent = this;
	this.instance_1.setTransform(-73.5,-17.5);

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

}).prototype = getMCSymbolPrototype(lib.gumb_ustavi, new cjs.Rectangle(-73.5,-17.5,147,35), null);


(lib.BlinkingDots = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 2
	this.instance = new lib.number_dot();
	this.instance.parent = this;

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

}).prototype = getMCSymbolPrototype(lib.BlinkingDots, new cjs.Rectangle(0,0,26,31), null);


(lib.Utez = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 2
	this.os = new lib.pivot();
	this.os.parent = this;
	this.os.setTransform(-0.1,-0.1);

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

	// Layer 1
	this.instance = new lib.weight2();
	this.instance.parent = this;
	this.instance.setTransform(-42.5,-42.5);

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

}).prototype = getMCSymbolPrototype(lib.Utez, new cjs.Rectangle(-42.5,-42.5,85,85), null);


(lib.stopwatch_1 = function(mode,startPosition,loop) {
if (loop == null) { loop = false; }	this.initialize(mode,startPosition,loop,{});

	// timeline functions:
	this.frame_0 = function() {
		var stoparica = this;
		
		var time = 0;
		var	aktivnost = "stopped";
		
		var stopwatch = stoparica.stopwatch
		var gumb = stoparica.gumb;
		var des = stoparica.des;
		var sec1 = stoparica.sec1;
		var sec2 = stoparica.sec2;
		//var min = stoparica.min;
		
		TweenLite.to(gumb, 0, {alpha:0.01, ease:Quad.easeInOut});
		stopwatch.addEventListener ("mousedown", startWatch);
		stopwatch.cursor = "pointer";
		
		var datum = 0;
		var zacetniCas = 0;
		
		function startWatch (event) {
			if (aktivnost == "stopped") {
				datum = new Date();
				zacetniCas = datum.getTime();
				aktivnost = "running";
				TweenLite.to(gumb, 0.2, {alpha:1});
				TweenLite.to(stopwatch, 0.1, {onComplete:tickWatch});
			} else if (aktivnost == "running") {
				aktivnost = "paused";
				TweenLite.killTweensOf(stopwatch);
				TweenLite.to(gumb, 0.2, {alpha:0.5});
			} else if (aktivnost == "paused") {
				aktivnost = "stopped";
				des.gotoAndStop (0);
				sec1.gotoAndStop (0);
				sec2.gotoAndStop (0);
				//min.gotoAndStop (0);
				time = 0;
				TweenLite.to(gumb, 0.2, {alpha:0.01});
				zacetniCas = 0;
			}
		}
		
		function tickWatch () {
			datum = new Date();
			time = datum.getTime() - zacetniCas;
			time = time/100;
			console.log (time);
			if (time > 5999) {
				time = 0;
			}
			var desetinke = 0;
			var sekunde = 0;
			var minute = 0;
			
			desetinke = time%10;
			minute = Math.floor(time/600);
			sekunde = Math.floor((time - (minute*600))/10);
			
			var s2 = 0;
			var s1 = 0;
			s1 = sekunde%10;
			s2 = Math.floor(sekunde/10);
			
			des.gotoAndStop (desetinke);
			sec1.gotoAndStop (s1);
			sec2.gotoAndStop (s2);
			//min.gotoAndStop (minute);
			TweenLite.to(stopwatch, 0.1, {onComplete:tickWatch});
		}
	}

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

	// statusLight
	this.gumb = new lib.Lucka();
	this.gumb.parent = this;
	this.gumb.setTransform(157,33.8,1,1,0,0,0,19,19.5);

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

	// numbers
	this.sec2 = new lib.numbers();
	this.sec2.parent = this;
	this.sec2.setTransform(43.6,43,0.9,0.9);

	this.des = new lib.numbers();
	this.des.parent = this;
	this.des.setTransform(102.9,43,0.9,0.9);

	this.sec1 = new lib.numbers();
	this.sec1.parent = this;
	this.sec1.setTransform(67.2,43,0.9,0.9);

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

	// dots
	this.instance = new lib.BlinkingDots();
	this.instance.parent = this;
	this.instance.setTransform(84.7,44.4,1,1,0,0,0,13,15.5);

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

	// stoparica
	this.stopwatch = new lib.stopwach_root();
	this.stopwatch.parent = this;

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

}).prototype = getMCSymbolPrototype(lib.stopwatch_1, new cjs.Rectangle(0,0,188,86), null);


(lib.slider = function(mode,startPosition,loop) {
	this.initialize(mode,startPosition,loop,{});

	// Layer 2
	this.gumb = new lib.SliderButton();
	this.gumb.parent = this;

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

	// Layer 1
	this.instance = new lib.slider_bar();
	this.instance.parent = this;
	this.instance.setTransform(-10.3,-8.7);

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

}).prototype = getMCSymbolPrototype(lib.slider, new cjs.Rectangle(-11.6,-11.7,150.3,25), null);


(lib.Line = function(mode,startPosition,loop) {
if (loop == null) { loop = false; }	this.initialize(mode,startPosition,loop,{});

	// Layer 2
	this.utez = new lib.Utez();
	this.utez.parent = this;
	this.utez.setTransform(0,313);

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

	// Layer 1
	this.vrvica = new lib.vrvica_root();
	this.vrvica.parent = this;
	this.vrvica.setTransform(0,-2.1);

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

	// Layer 4
	this.vrvica_1 = new lib.vrvica_root();
	this.vrvica_1.parent = this;
	this.vrvica_1.setTransform(0,-2.5,1,0.785,0,0,0,0,-0.2);
	this.vrvica_1.alpha = 0.199;

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

}).prototype = getMCSymbolPrototype(lib.Line, new cjs.Rectangle(-42.5,-2.3,85,357.9), null);


(lib.Simulacija = function(mode,startPosition,loop) {
if (loop == null) { loop = false; }	this.initialize(mode,startPosition,loop,{});

	// timeline functions:
	this.frame_0 = function() {
		stage.mouseMoveOutside = true; // dovoli zaznavanje premikov miske izven naloge
		
		var podnaloga = this;
		
		podnaloga.preveriPodnalogo = function () {
			interaktivnost (false);
			
		}
		
		podnaloga.ponastaviPodnalogo = function (){
			interaktivnost (false);
		
			interaktivnost (true);
		}
		
		podnaloga.pokaziResitve = function () {
			interaktivnost (false);
			
		}
		
		// NALOGA
		
		var sliderji = [podnaloga.sliderDolzina, podnaloga.sliderTeza, podnaloga.sliderDusenje];
		var sliderjiRazdelki = [10,10,5];
		var killsTween = [true, false, false];
		
		var dolzinaVrvi = 0.8;
		var maxDolzina = 1.5;
		var minDolzina = 0.3;
		
		var teza = 0.65;
		var maxTeza = 1;
		var minTeza = 0.3;
		
		var dusenje = 0;
		var maxDusenje = 0.5;
		var minDusenje = 0;
		
		var g = 9.81;
		var pi = 3.14;
		var defaultDolzina = 313;
		
		var utez = podnaloga.utez;
		var vrvica = podnaloga.vrvica;
		var os = podnaloga.os;
		
		var ravnilo = podnaloga.ravnilo;
		var kotomer = podnaloga.kotomer;
		var stopwatch = podnaloga.stopwatch;
		
		var gumbStop = podnaloga.gumbStop;
		
		var amplituda = 0;
		var nihajniCas = 0;
		
		var dolzSlider = 128;
		
		// risanje
		var container = new createjs.Container();
		podnaloga.addChild (container);
		
		var platno = new createjs.Shape();
		container.addChild(platno);
		
		var barvaCrte =  createjs.Graphics.getRGB(0xC4AD92, 1);
		var debelinaCrte = 6;
		
		
		podnaloga.pripraviPodnalogo = function () {
			for (var i=0; i<sliderji.length; i++) {
				var slider = sliderji[i];
				slider.razdelkov = sliderjiRazdelki[i];
				slider.killsTween = killsTween[i];
			}
			
			podnaloga.sliderTeza.maxVrednost = (Math.round(dolzSlider/10))*10;
			podnaloga.sliderDolzina.maxVrednost = podnaloga.sliderTeza.maxVrednost;
			
			var valueSpanTeza = maxTeza - minTeza;
			podnaloga.sliderTeza.vrednost = (teza-minTeza)/valueSpanTeza;
			
			var valueSpanDolzina = maxDolzina - minDolzina;
			podnaloga.sliderDolzina.vrednost = (dolzinaVrvi-minDolzina)/valueSpanDolzina;
			
			var valueSpanDusenje = maxDusenje - minDusenje;
			podnaloga.sliderDusenje.vrednost = (dusenje-minDusenje)/valueSpanDusenje;
			
			podnaloga.sliderTeza.gumb.x = podnaloga.sliderTeza.vrednost*dolzSlider;
			podnaloga.sliderDolzina.gumb.x = podnaloga.sliderDolzina.vrednost*dolzSlider;
			podnaloga.sliderDusenje.gumb.x = podnaloga.sliderDusenje.vrednost*dolzSlider;
			
			TweenLite.to(ravnilo, 0, {alpha:0, ease:Quad.easeInOut});
			TweenLite.to(kotomer, 0, {alpha:0.3, ease:Quad.easeInOut});
			
			updateVrednosti ();
			
			interaktivnost (true);
		}
		
		function interaktivnost (bool) {
			if (bool) {
				for (var i=0; i<sliderji.length; i++) {
				var slider = sliderji[i];
				slider.addEventListener ("mousedown", startSlider);
				slider.cursor = "pointer";
				}
				gumbStop.addEventListener ("mousedown", stopAnimation);
				gumbStop.cursor = "pointer";
				vrvica.addEventListener ("mousedown", startRotate);
				vrvica.cursor = "pointer";
			} else {
				for (var i=0; i<sliderji.length; i++) {
				var slider = sliderji[i];
				slider.removeEventListener ("mousedown", startSlider);
				slider.cursor = "default";
				}
				gumbStop.removeEventListener ("mousedown", stopAnimation);
				vrvica.removeEventListener ("mousedown", startRotate);
				vrvica.cursor = "default";
			}
		}
		
		function stopAnimation (event) {
			interaktivnost (false);
			amplituda = 0;
			TweenLite.to(vrvica, 1, {rotation:amplituda, ease:Quad.easeInOut});
			TweenLite.to(vrvica.utez, 1, {rotation:-amplituda, ease:Quad.easeInOut});
			setTimeout(function(){ interaktivnost (true); }, 1000);
		}
		
		function startSlider (event) {
			var objekt = event.currentTarget;
			objekt.addEventListener ("pressmove", moveSlider);
			if (objekt.killsTween) {
				TweenLite.killTweensOf(vrvica);
				TweenLite.to(vrvica, 0.4, {rotation:0, ease:Quad.easeInOut});
				TweenLite.to(vrvica.utez, 0.4, {rotation:0, ease:Quad.easeInOut});
				TweenLite.to(ravnilo, 0.5, {alpha:1, ease:Quad.easeInOut});
				objekt.addEventListener ("pressup", stopSlider);
			}
			
		}
		
		function moveSlider (event) {
			var objekt = event.currentTarget;
			var kotTemp = objekt.rotation;
			
			var x = event.stageX;
			var y = event.stageY;
			
			var limitLeft = objekt.x;
			var limitRight = objekt.x + dolzSlider;
			
			if (x<limitLeft) {x = limitLeft;}
			if (x>limitRight) {x = limitRight;}
		
			var relativeX = x - objekt.x;
			relativeX = (Math.round(relativeX/2));
			relativeX = relativeX*2;
			
			objekt.gumb.x = relativeX;
			
			objekt.vrednost = Math.round ((objekt.gumb.x/dolzSlider)*objekt.razdelkov)/objekt.razdelkov;
			objekt.gumb.x = dolzSlider*objekt.vrednost;
			
			console.log (objekt.vrednost);
			updateVrednosti ();
			
			update = true;
		}
		
		function stopSlider () {
			TweenLite.to(ravnilo, 0.5, {alpha:0, ease:Quad.easeInOut});
		}
		
		function updateVrednosti () {
			
			var valueSpanTeza = maxTeza - minTeza;
			teza = (valueSpanTeza*podnaloga.sliderTeza.vrednost) + minTeza;
			TweenLite.to(vrvica.utez, 0.4, {scaleX:teza, scaleY:teza, ease:Quad.easeInOut});
			
			var valueSpanDolzina = maxDolzina - minDolzina;
			dolzinaVrvi = valueSpanDolzina*podnaloga.sliderDolzina.vrednost + minDolzina;
		
			var valueSpanDusenje = maxDusenje - minDusenje;
			dusenje = valueSpanDusenje*podnaloga.sliderDusenje.vrednost + minDusenje;
			console.log (teza, dolzinaVrvi, dusenje);
			
			prilagodiDolzino ();
			izracunajCas();	
		}
		
		function prilagodiDolzino () {
			//vrvica.vrvica.scaleY = dolzinaVrvi;
			//vrvica.utez.y = defaultDolzina*dolzinaVrvi;
			
			TweenLite.to(vrvica.vrvica, 0.2, {scaleY:dolzinaVrvi, ease:Quad.easeInOut});
			TweenLite.to(vrvica.utez, 0.2, {y:defaultDolzina*dolzinaVrvi, ease:Quad.easeInOut});
		}
		
		function startRotate (event) {
			var objekt = event.currentTarget;
			objekt.addEventListener ("pressmove", rotateIt);
			objekt.addEventListener ("pressup", stopRotate);
			TweenLite.to(kotomer, 0.5, {alpha:1, ease:Quad.easeInOut});
		}
		
		function rotateIt (event) {
			var objekt = event.currentTarget;
			var kotTemp = objekt.rotation;
			
			var x = objekt.x;
			var y = objekt.y;
			
			var mx = event.stageX;
			var my = event.stageY;
			
			if (my<os.y+5) {
				my = os.y+5;
			}
			
			var kot = Math.atan2(x-mx, y-my);
			kot = kot;
			amplituda = -kot*180/Math.PI + 180;
			if (amplituda>90){
				amplituda = amplituda-360;
			}
			TweenLite.to(vrvica, 0, {rotation:amplituda, ease:Quad.easeInOut});
			TweenLite.to(vrvica.utez, 0, {rotation:-amplituda, ease:Quad.easeInOut});
		
			update = true;
		}
		
		function stopRotate (event) {
			var objekt = event.currentTarget;
			objekt.removeEventListener ("pressmove", dragIt);
			objekt.removeEventListener ("pressup", dropIt);
			izracunajCas();	
			animirajNihanje (-amplituda);
			TweenLite.to(kotomer, 0.5, {alpha:0.3, ease:Quad.easeInOut});
		}
		
		function narisiGraf () {
			platno.graphics.clear();
			platno.graphics.setStrokeStyle(debelinaCrte, "round", "round");
			platno.graphics.beginStroke(barvaCrte);
			platno.graphics.moveTo(vrvica.utez.x, vrvica.utez.y);
			platno.graphics.lineTo(vrvica.utez.x, vrvica.utez.y);
			platno.graphics.endStroke();
		}
		
		function izracunajCas (){
			nihajniCas = 2*pi*(Math.sqrt(dolzinaVrvi/g));
		}
		
		function animirajNihanje (kot) {
			TweenLite.to(vrvica.utez, nihajniCas/2, {rotation:-kot, ease:Quad.easeInOut});
			TweenLite.to(vrvica, nihajniCas/2, {rotation:kot, ease:Quad.easeInOut, onComplete:animirajNihanje, onCompleteParams:[-kot*(1-dusenje)]});
		}
		
		function startDrag (event) {
			var objekt = event.currentTarget;
			objekt.offset = {x:objekt.x - event.stageX, y:objekt.y - event.stageY};
			objekt.addEventListener ("pressmove", dragIt);
			objekt.addEventListener ("pressup", dropIt);
		}
		
		function dragIt (event) {
			var objekt = event.currentTarget;
			objekt.x = event.stageX + objekt.offset.x;
			objekt.y = event.stageY + objekt.offset.y;
			update = true;
		}
		
		function dropIt (event) {
			var objekt = event.currentTarget;
			objekt.removeEventListener ("pressmove", dragIt);
			objekt.removeEventListener ("pressup", dropIt);
		}
		
		
		function onOver (event) {
			var tarca = event.currentTarget;
			TweenLite.to(tarca, 0.1, {scaleX:1.1, scaleY:1.1, ease:Quad.easeInOut});
		}
		
		function onOut (event) {
			var tarca = event.currentTarget;
			TweenLite.to(tarca, 0.1, {scaleX:1, scaleY:1, ease:Quad.easeInOut});
		}
		
		function pokaziPovratno (n) {
			var povratna = povratne[n];
			TweenLite.to(povratna, 0.5, {scaleX:1, scaleY:1, alpha:1, ease:Elastic.easeOut});
		}
		
		function skrijPovratno (n) {
			var povratna = povratne[n];
			TweenLite.to(povratna, 0.5, {scaleX:0.5, scaleY:0.5, alpha:0, ease:Quad.easeInOut});
		}
		
		function bringToFront(objekt) {
			objekt.parent.setChildIndex(objekt, objekt.parent.getNumChildren()-1); 
		}
		
		podnaloga.stop ();
	}

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

	// ravnilo
	this.ravnilo = new lib.ravnilo_ravnilo();
	this.ravnilo.parent = this;
	this.ravnilo.setTransform(512.5,50.1,1.047,1.047);

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

	// nastavljanje dolzine
	this.gumbStop = new lib.gumb_ustavi();
	this.gumbStop.parent = this;
	this.gumbStop.setTransform(85.5,206.3);

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

	// pivot
	this.os = new lib.pivot();
	this.os.parent = this;
	this.os.setTransform(500,50);

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

	// line
	this.vrvica = new lib.Line();
	this.vrvica.parent = this;
	this.vrvica.setTransform(500.1,51.2);

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

	// interface
	this.instance = new lib.scale05();
	this.instance.parent = this;
	this.instance.setTransform(811,226);

	this.instance_1 = new lib.napis_UporInTrenje();
	this.instance_1.parent = this;
	this.instance_1.setTransform(824,189);

	this.instance_2 = new lib.napis_masa();
	this.instance_2.parent = this;
	this.instance_2.setTransform(834,134);

	this.instance_3 = new lib.napis_dolzina();
	this.instance_3.parent = this;
	this.instance_3.setTransform(833.8,81.2);

	this.sliderDusenje = new lib.slider();
	this.sliderDusenje.parent = this;
	this.sliderDusenje.setTransform(817.3,215.5);

	this.sliderTeza = new lib.slider();
	this.sliderTeza.parent = this;
	this.sliderTeza.setTransform(817.3,161.5);

	this.sliderDolzina = new lib.slider();
	this.sliderDolzina.parent = this;
	this.sliderDolzina.setTransform(817.3,108);

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

	// kotomer
	this.kotomer = new lib.ravnilo_kotomer();
	this.kotomer.parent = this;
	this.kotomer.setTransform(246,43.5);

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

	// stoparica
	this.stopwatch = new lib.stopwatch_1();
	this.stopwatch.parent = this;
	this.stopwatch.setTransform(12,86.6);

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

}).prototype = getMCSymbolPrototype(lib.Simulacija, new cjs.Rectangle(12,31.2,944,513.8), null);


// stage content:
(lib.nihalo = function(mode,startPosition,loop) {
if (loop == null) { loop = false; }	this.initialize(mode,startPosition,loop,{});

	// timeline functions:
	this.frame_0 = function() {
		createjs.Touch.enable(stage);
		stage.enableMouseOver(10);  
		
		//this.uizine_toolbar.visible = false;
		
		var naloga = this;
		
		// OSNOVNE NASTAVITVE ZA VEČSTOPENJSKO NALOGO
		
		var barveOzadja = ["#FFFFFF"];  // barva ozadja za vsako nalogo
		
		var can = document.getElementById("canvas");
		can.style.backgroundColor = barveOzadja[0];
		
		// preverjam, ce so podnaloge nalozene
		
		naloga.podnaloga.addEventListener("tick", aliJeZeNalozeno);
		function aliJeZeNalozeno() {
			if (typeof naloga.podnaloga.pripraviPodnalogo !== "undefined") {
				pripraviPodnaloge();
				naloga.podnaloga.removeEventListener("tick", aliJeZeNalozeno);
			}
		}
		
		function pripraviPodnaloge () {
			console.log ("pripravljam podnaloge");
			naloga.podnaloga.pripraviPodnalogo ();
		}
	}

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

	// Poskus
	this.podnaloga = new lib.Simulacija();
	this.podnaloga.parent = this;

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

	// Layer 1
	this.shape = new cjs.Shape();
	this.shape.graphics.f("#DFE6E9").s().p("EhOHAD6IAAnzMCcPAAAIAAHzg");
	this.shape.setTransform(500,25);

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

}).prototype = p = new cjs.MovieClip();
p.nominalBounds = new cjs.Rectangle(500,325,1000,545.1);
// library properties:
lib.properties = {
	width: 1000,
	height: 650,
	fps: 30,
	color: "#FFFFFF",
	opacity: 1.00,
	manifest: [
		{src:"images/dot.png?1492676110309", id:"dot"},
		{src:"images/gumb.png?1492676110309", id:"gumb"},
		{src:"images/kotomer.png?1492676110309", id:"kotomer"},
		{src:"images/line.png?1492676110309", id:"line"},
		{src:"images/napis_dolzina.png?1492676110309", id:"napis_dolzina"},
		{src:"images/napis_masa.png?1492676110309", id:"napis_masa"},
		{src:"images/napis_UporInTrenje.png?1492676110309", id:"napis_UporInTrenje"},
		{src:"images/napis_ustavi.png?1492676110309", id:"napis_ustavi"},
		{src:"images/number_0.png?1492676110309", id:"number_0"},
		{src:"images/number_1.png?1492676110309", id:"number_1"},
		{src:"images/number_2.png?1492676110309", id:"number_2"},
		{src:"images/number_3.png?1492676110309", id:"number_3"},
		{src:"images/number_4.png?1492676110309", id:"number_4"},
		{src:"images/number_5.png?1492676110309", id:"number_5"},
		{src:"images/number_6.png?1492676110309", id:"number_6"},
		{src:"images/number_7.png?1492676110309", id:"number_7"},
		{src:"images/number_8.png?1492676110309", id:"number_8"},
		{src:"images/number_9.png?1492676110309", id:"number_9"},
		{src:"images/number_dot.png?1492676110309", id:"number_dot"},
		{src:"images/ravnilo.png?1492676110309", id:"ravnilo"},
		{src:"images/scale05.png?1492676110309", id:"scale05"},
		{src:"images/slider_bar.png?1492676110309", id:"slider_bar"},
		{src:"images/slider_button.png?1492676110309", id:"slider_button"},
		{src:"images/stopwatch.png?1492676110309", id:"stopwatch"},
		{src:"images/stopwatch_light.png?1492676110309", id:"stopwatch_light"},
		{src:"images/weight2.png?1492676110309", id:"weight2"}
	],
	preloads: []
};




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