/*

    _______ _______ _______ __   _ _______  _____   ______    _____        
   |______ |  |  | |______ | \  |    |    |     | |_____/   |_____] |     
   |______ |  |  | |______ |  \_|    |    |_____| |    \_ . |       |_____


	Dziękujemy za zainteresowanie kodem źródłowym naszej strony.
	
	Gwarantujemy Państwu, że wszystkie serwisy eMentor są przygotowywane
	z największa starannością. Szczególną uwagę przywiązujemy do poprawnego
	działania strony pod wszystkimi popularnymi przeglądarkami internetowymi.
	
	Współpracując z eMentor, nie musisz poświęcać swojego czasu na sprawy
	techniczne związane z dystrybucją i sprzedażą szkoleń wideo.
	
	Jeżeli znalazłeś błąd na naszej stronie lub nie działa ona poprawnie,
	prosimy o kontakt:
	   email:   pomoc@ementor.pl
	   telefon: 032 790 40 55
	

*/
/*
 *
 *   iVideo Viewer v.2.0.1
 *   Copyright 2012 - Thinkscape (www.thinkscape.pl, www.thinkscape.biz)
 *   All rights reserved! For licensing contact office@thinkscape.biz
 *
 *
 * This library uses the following components:
 * 
 *    flowplayer.js 3.1.1. The Flowplayer API
 *   (Copyright 2009 Flowplayer Oy, licensed under GNU General Public License)
 *
 *   json2.js
 *   (Public Domain)
 *
 *   tools.scrollable 1.1.2 - Scroll your HTML with eye candy.
 *   (Copyright (c) 2009 Tero Piirainen)
 *   (Dual licensed under MIT and GPL 2+ licenses)
 *
 *    jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *   (Copyright © 2008 George McGinley Smith, BSD License.)
 */
Function.prototype.createDelegate=function(c,b,a){var d=this;return function(){var g=b||arguments;if(a===true){g=Array.prototype.slice.call(arguments,0);g=g.concat(b)}else{if(typeof a=="number"){g=Array.prototype.slice.call(arguments,0);var f=[a,0].concat(b);Array.prototype.splice.apply(g,f)}}return d.apply(c||window,g)}};window.Cookies={};window.Cookies.set=function(c,f){var a=arguments;var j=arguments.length;var b=(j>2)?a[2]:null;var i=(j>3)?a[3]:"/";var d=(j>4)?a[4]:null;var g=(j>5)?a[5]:false;document.cookie=c+"="+escape(f)+((b==null)?"":("; expires="+b.toGMTString()))+((i==null)?"":("; path="+i))+((d==null)?"":("; domain="+d))+((g==true)?"; secure":"")};window.Cookies.get=function(d){var b=d+"=";var g=b.length;var a=document.cookie.length;var f=0;var c=0;while(f<a){c=f+g;if(document.cookie.substring(f,c)==b){return Cookies.getCookieVal(c)}f=document.cookie.indexOf(" ",f)+1;if(f==0){break}}return null};window.Cookies.clear=function(a){if(window.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}};window.Cookies.getCookieVal=function(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))};if(!window.iVideojQuery&&window.jQuery){window.iVideojQuery=window.jQuery}iVideojQuery.classOverride=function(a,c){if(c){var b=a.prototype;iVideojQuery.extend(b,c);if(iVideojQuery.browser.msie&&c.toString!=a.toString){b.toString=c.toString}}};iVideojQuery.classExtend=function(){var b=function(d){for(var c in d){this[c]=d[c]}};var a=Object.prototype.constructor;return function(j,f,i){if(f&&typeof f=="object"){i=f;f=j;j=i.constructor!=a?i.constructor:function(){f.apply(this,arguments)}}var d=function(){},g,c=f.prototype;d.prototype=c;g=j.prototype=new d();g.constructor=j;j.superclass=c;if(c.constructor==a){c.constructor=f}j.override=function(k){iVideojQuery.classOverride(j,k)};g.superclass=g.supr=(function(){return c});g.override=b;iVideojQuery.classOverride(j,i);j.extend=function(k){iVideojQuery.classExtend(j,k)};return j}}();iVideojQuery.fn.bufferBind=function(f,c,d,b){d=d||{};f=parseInt(f)||500;if(typeof(d)=="function"){b=d;d={}}var a=function(g){return function(i){g.call(i.target,i)}};d._fnBufferTimeout=f;d._fnBufferType=c;d._fnBufferFn=b;this.each(function(){iVideojQuery(this).one(c,d,iVideojQuery.fn.bufferBind.handler)});return this};iVideojQuery.fn.bufferBind.handler=function(b,a){if(a==true){b.data._fnBufferTimer=0;iVideojQuery(this).unbind(b.data._fnBufferType,iVideojQuery.fn.bufferBind.handler);iVideojQuery(this).one(b.data._fnBufferType,b.data,iVideojQuery.fn.bufferBind.handler);b.data._fnBufferFn.call(this,b);return}if(typeof(b.data._fnBufferTimeout)!="number"){return}if(!b.data.hasOwnProperty("_fnBufferTimer")){b.data._fnBufferTimer=0}if(b.data._fnBufferTimer>0){clearTimeout(b.data._fnBufferTimer)}b.data._fnBufferTimer=setTimeout(iVideojQuery.fn.bufferBind.handler.createDelegate(this,[b,true],false),b.data._fnBufferTimeout);iVideojQuery(this).one(b.data._fnBufferType,b.data,iVideojQuery.fn.bufferBind.handler)};iVideojQuery.fn.bufferUnbind=function(a){this.each(function(){iVideojQuery(this).unbind(a,iVideojQuery.fn.bufferBind.handler)})};iVideojQuery.fn.delay=function(b,a){b=b||1000;a=a||"fx";return this.queue(a,function(){var c=this;setTimeout(function(){$.dequeue(c)},b)})};iVideojQuery.fn.clearQueue=iVideojQuery.fn.clearDelay=function(a){return this.each(function(){a=a||"fx";if(this.queue&&this.queue[a]){this.queue[a].length=0}})};iVideojQuery.deleteNode=function(a){a=iVideojQuery(a);if((typeof a!="undefined")&&(typeof a.length!="undefined")&&a.length>0){if(a[0].parentNode){a[0].parentNode.removeChild(a[0])}else{try{document.removeChild(a[0])}catch(b){}}try{iVideojQuery.event.remove(a);iVideojQuery.removeData(a)}catch(b){}delete a[0];delete a}};iVideojQuery.easing.jswing=iVideojQuery.easing.swing;iVideojQuery.extend(iVideojQuery.easing,{def:"easeOutQuad",swing:function(f,g,a,j,i){return iVideojQuery.easing[iVideojQuery.easing.def](f,g,a,j,i)},easeInQuad:function(f,g,a,j,i){return j*(g/=i)*g+a},easeOutQuad:function(f,g,a,j,i){return -j*(g/=i)*(g-2)+a},easeInOutQuad:function(f,g,a,j,i){if((g/=i/2)<1){return j/2*g*g+a}return -j/2*((--g)*(g-2)-1)+a},easeInCubic:function(f,g,a,j,i){return j*(g/=i)*g*g+a},easeOutCubic:function(f,g,a,j,i){return j*((g=g/i-1)*g*g+1)+a},easeInOutCubic:function(f,g,a,j,i){if((g/=i/2)<1){return j/2*g*g*g+a}return j/2*((g-=2)*g*g+2)+a},easeInQuart:function(f,g,a,j,i){return j*(g/=i)*g*g*g+a},easeOutQuart:function(f,g,a,j,i){return -j*((g=g/i-1)*g*g*g-1)+a},easeInOutQuart:function(f,g,a,j,i){if((g/=i/2)<1){return j/2*g*g*g*g+a}return -j/2*((g-=2)*g*g*g-2)+a},easeInQuint:function(f,g,a,j,i){return j*(g/=i)*g*g*g*g+a},easeOutQuint:function(f,g,a,j,i){return j*((g=g/i-1)*g*g*g*g+1)+a},easeInOutQuint:function(f,g,a,j,i){if((g/=i/2)<1){return j/2*g*g*g*g*g+a}return j/2*((g-=2)*g*g*g*g+2)+a},easeInSine:function(f,g,a,j,i){return -j*Math.cos(g/i*(Math.PI/2))+j+a},easeOutSine:function(f,g,a,j,i){return j*Math.sin(g/i*(Math.PI/2))+a},easeInOutSine:function(f,g,a,j,i){return -j/2*(Math.cos(Math.PI*g/i)-1)+a},easeInExpo:function(f,g,a,j,i){return(g==0)?a:j*Math.pow(2,10*(g/i-1))+a},easeOutExpo:function(f,g,a,j,i){return(g==i)?a+j:j*(-Math.pow(2,-10*g/i)+1)+a},easeInOutExpo:function(f,g,a,j,i){if(g==0){return a}if(g==i){return a+j}if((g/=i/2)<1){return j/2*Math.pow(2,10*(g-1))+a}return j/2*(-Math.pow(2,-10*--g)+2)+a},easeInCirc:function(f,g,a,j,i){return -j*(Math.sqrt(1-(g/=i)*g)-1)+a},easeOutCirc:function(f,g,a,j,i){return j*Math.sqrt(1-(g=g/i-1)*g)+a},easeInOutCirc:function(f,g,a,j,i){if((g/=i/2)<1){return -j/2*(Math.sqrt(1-g*g)-1)+a}return j/2*(Math.sqrt(1-(g-=2)*g)+1)+a},easeInElastic:function(g,j,f,o,n){var k=1.70158;var l=0;var i=o;if(j==0){return f}if((j/=n)==1){return f+o}if(!l){l=n*0.3}if(i<Math.abs(o)){i=o;var k=l/4}else{var k=l/(2*Math.PI)*Math.asin(o/i)}return -(i*Math.pow(2,10*(j-=1))*Math.sin((j*n-k)*(2*Math.PI)/l))+f},easeOutElastic:function(g,j,f,o,n){var k=1.70158;var l=0;var i=o;if(j==0){return f}if((j/=n)==1){return f+o}if(!l){l=n*0.3}if(i<Math.abs(o)){i=o;var k=l/4}else{var k=l/(2*Math.PI)*Math.asin(o/i)}return i*Math.pow(2,-10*j)*Math.sin((j*n-k)*(2*Math.PI)/l)+o+f},easeInOutElastic:function(g,j,f,o,n){var k=1.70158;var l=0;var i=o;if(j==0){return f}if((j/=n/2)==2){return f+o}if(!l){l=n*(0.3*1.5)}if(i<Math.abs(o)){i=o;var k=l/4}else{var k=l/(2*Math.PI)*Math.asin(o/i)}if(j<1){return -0.5*(i*Math.pow(2,10*(j-=1))*Math.sin((j*n-k)*(2*Math.PI)/l))+f}return i*Math.pow(2,-10*(j-=1))*Math.sin((j*n-k)*(2*Math.PI)/l)*0.5+o+f},easeInBack:function(f,g,a,k,j,i){if(i==undefined){i=1.70158}return k*(g/=j)*g*((i+1)*g-i)+a},easeOutBack:function(f,g,a,k,j,i){if(i==undefined){i=1.70158}return k*((g=g/j-1)*g*((i+1)*g+i)+1)+a},easeInOutBack:function(f,g,a,k,j,i){if(i==undefined){i=1.70158}if((g/=j/2)<1){return k/2*(g*g*(((i*=(1.525))+1)*g-i))+a}return k/2*((g-=2)*g*(((i*=(1.525))+1)*g+i)+2)+a},easeInBounce:function(f,g,a,j,i){return j-iVideojQuery.easing.easeOutBounce(f,i-g,0,j,i)+a},easeOutBounce:function(f,g,a,j,i){if((g/=i)<(1/2.75)){return j*(7.5625*g*g)+a}else{if(g<(2/2.75)){return j*(7.5625*(g-=(1.5/2.75))*g+0.75)+a}else{if(g<(2.5/2.75)){return j*(7.5625*(g-=(2.25/2.75))*g+0.9375)+a}else{return j*(7.5625*(g-=(2.625/2.75))*g+0.984375)+a}}}},easeInOutBounce:function(f,g,a,j,i){if(g<i/2){return iVideojQuery.easing.easeInBounce(f,g*2,0,j,i)*0.5+a}return iVideojQuery.easing.easeOutBounce(f,g*2-i,0,j,i)*0.5+j*0.5+a}});iVideojQuery.extend(iVideojQuery.easing,{easeIn:function(f,g,a,j,i){return iVideojQuery.easing.easeInQuad(f,g,a,j,i)},easeOut:function(f,g,a,j,i){return iVideojQuery.easing.easeOutQuad(f,g,a,j,i)},easeInOut:function(f,g,a,j,i){return iVideojQuery.easing.easeInOutQuad(f,g,a,j,i)},expoin:function(f,g,a,j,i){return iVideojQuery.easing.easeInExpo(f,g,a,j,i)},expoout:function(f,g,a,j,i){return iVideojQuery.easing.easeOutExpo(f,g,a,j,i)},expoinout:function(f,g,a,j,i){return iVideojQuery.easing.easeInOutExpo(f,g,a,j,i)},bouncein:function(f,g,a,j,i){return iVideojQuery.easing.easeInBounce(f,g,a,j,i)},bounceout:function(f,g,a,j,i){return iVideojQuery.easing.easeOutBounce(f,g,a,j,i)},bounceinout:function(f,g,a,j,i){return iVideojQuery.easing.easeInOutBounce(f,g,a,j,i)},elasin:function(f,g,a,j,i){return iVideojQuery.easing.easeInElastic(f,g,a,j,i)},elasout:function(f,g,a,j,i){return iVideojQuery.easing.easeOutElastic(f,g,a,j,i)},elasinout:function(f,g,a,j,i){return iVideojQuery.easing.easeInOutElastic(f,g,a,j,i)},backin:function(f,g,a,j,i){return iVideojQuery.easing.easeInBack(f,g,a,j,i)},backout:function(f,g,a,j,i){return iVideojQuery.easing.easeOutBack(f,g,a,j,i)},backinout:function(f,g,a,j,i){return iVideojQuery.easing.easeInOutBack(f,g,a,j,i)}});(function(d){function c(i,j){var g=d(j);return g.length<2?g:i.parent().find(j)}function b(x,y){var z=this,p=x.add(z),w=x.children(),u=0,v=y.vertical;a||(a=z);if(w.length>1){w=d(y.items,x)}d.extend(z,{getConf:function(){return y},getIndex:function(){return u},getSize:function(){return z.getItems().size()},getNaviButtons:function(){return k.add(i)},getRoot:function(){return x},getItemWrap:function(){return w},getItems:function(){return w.children(y.item).not("."+y.clonedClass)},move:function(f,g){return z.seekTo(u+f,g)},next:function(f){return z.move(1,f)},prev:function(f){return z.move(-1,f)},begin:function(f){return z.seekTo(0,f)},end:function(f){return z.seekTo(z.getSize()-1,f)},focus:function(){return a=z},addItem:function(f){f=d(f);if(y.circular){w.children("."+y.clonedClass+":last").before(f);w.children("."+y.clonedClass+":first").replaceWith(f.clone().addClass(y.clonedClass))}else{w.append(f)}p.trigger("onAddItem",[f]);return z},seekTo:function(f,n,j){f.iVideojQuery||(f*=1);if(y.circular&&f===0&&u==-1&&n!==0){return z}if(!y.circular&&f<0||f>z.getSize()||f<-1){return z}var g=f;if(f.iVideojQuery){f=z.getItems().index(f)}else{g=z.getItems().eq(f)}var l=d.Event("onBeforeSeek");if(!j){p.trigger(l,[f,n]);if(l.isDefaultPrevented()||!g.length){return z}}g=v?{top:-g.position().top}:{left:-g.position().left};u=f;a=z;if(n===undefined){n=y.speed}w.animate(g,n,y.easing,j||function(){p.trigger("onSeek",[f])});return z}});d.each(["onBeforeSeek","onSeek","onAddItem"],function(f,g){d.isFunction(y[g])&&d(z).bind(g,y[g]);z[g]=function(j){j&&d(z).bind(g,j);return z}});if(y.circular){var B=z.getItems().slice(-1).clone().prependTo(w),A=z.getItems().eq(1).clone().appendTo(w);B.add(A).addClass(y.clonedClass);z.onBeforeSeek(function(f,j,g){if(!f.isDefaultPrevented()){if(j==-1){z.seekTo(B,g,function(){z.end(0)});return f.preventDefault()}else{j==z.getSize()&&z.seekTo(A,g,function(){z.begin(0)})}}});z.seekTo(0,0,function(){})}var k=c(x,y.prev).click(function(){z.prev()}),i=c(x,y.next).click(function(){z.next()});if(!y.circular&&z.getSize()>1){z.onBeforeSeek(function(f,g){setTimeout(function(){if(!f.isDefaultPrevented()){k.toggleClass(y.disabledClass,g<=0);i.toggleClass(y.disabledClass,g>=z.getSize()-1)}},1)});y.initialIndex||k.addClass(y.disabledClass)}y.mousewheel&&d.fn.mousewheel&&x.mousewheel(function(f,g){if(y.mousewheel){z.move(g<0?1:-1,y.wheelSpeed||50);return false}});if(y.touch){var r={};w[0].ontouchstart=function(f){f=f.touches[0];r.x=f.clientX;r.y=f.clientY};w[0].ontouchmove=function(f){if(f.touches.length==1&&!w.is(":animated")){var j=f.touches[0],g=r.x-j.clientX;j=r.y-j.clientY;z[v&&j>0||!v&&g>0?"next":"prev"]();f.preventDefault()}}}y.keyboard&&d(document).bind("keydown.scrollable",function(f){if(!(!y.keyboard||f.altKey||f.ctrlKey||d(f.target).is(":input"))){if(!(y.keyboard!="static"&&a!=z)){var g=f.keyCode;if(v&&(g==38||g==40)){z.move(g==38?-1:1);return f.preventDefault()}if(!v&&(g==37||g==39)){z.move(g==37?-1:1);return f.preventDefault()}}}});y.initialIndex&&z.seekTo(y.initialIndex,0,function(){})}d.tools=d.tools||{version:"1.2.5"};d.tools.scrollable={conf:{activeClass:"active",circular:false,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:true,mousewheel:false,next:".next",prev:".prev",speed:400,vertical:false,touch:true,wheelSpeed:0}};var a;d.fn.scrollable=function(g){var i=this.data("scrollable");if(i){return i}g=d.extend({},d.tools.scrollable.conf,g);this.each(function(){i=new b(d(this),g);d(this).data("scrollable",i)});return g.api?i:this}})(iVideojQuery);(function(){function w(a){console.log("$f.fireEvent",[].slice.call(a))}function r(a){if(!a||typeof a!="object"){return a}var c=new a.constructor();for(var b in a){if(a.hasOwnProperty(b)){c[b]=r(a[b])}}return c}function p(a,d){if(!a){return}var g,f=0,c=a.length;if(c===undefined){for(g in a){if(d.call(a[g],g,a[g])===false){break}}}else{for(var b=a[0];f<c&&d.call(b,f,b)!==false;b=a[++f]){}}return a}function A(a){return document.getElementById(a)}function u(a,b,c){if(typeof b!="object"){return a}if(a&&b){p(b,function(f,d){if(!c||typeof d!="function"){a[f]=d}})}return a}function o(a){var c=a.indexOf(".");if(c!=-1){var d=a.slice(0,c)||"*";var f=a.slice(c+1,a.length);var b=[];p(document.getElementsByTagName(d),function(){if(this.className&&this.className.indexOf(f)!=-1){b.push(this)}});return b}}function x(a){a=a||window.event;if(a.preventDefault){a.stopPropagation();a.preventDefault()}else{a.returnValue=false;a.cancelBubble=true}return false}function t(a,c,b){a[c]=a[c]||[];a[c].push(b)}function y(){return"_"+(""+Math.random()).slice(2,10)}var v=function(b,d,c){var f=this,g={},a={};f.index=d;if(typeof b=="string"){b={url:b}}u(this,b,true);p(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var k="on"+this;if(k.indexOf("*")!=-1){k=k.slice(0,k.length-1);var j="onBefore"+k.slice(2);f[j]=function(l){t(a,j,l);return f}}f[k]=function(l){t(a,k,l);return f};if(d==-1){if(f[j]){c[j]=f[j]}if(f[k]){c[k]=f[k]}}});u(this,{onCuepoint:function(j,k){if(arguments.length==1){g.embedded=[null,j];return f}if(typeof j=="number"){j=[j]}var l=y();g[l]=[j,k];if(c.isLoaded()){c._api().fp_addCuepoints(j,d,l)}return f},update:function(k){u(f,k);if(c.isLoaded()){c._api().fp_updateClip(k,d)}var l=c.getConfig();var j=(d==-1)?l.clip:l.playlist[d];u(j,k,true)},_fireEvent:function(n,E,l,k){if(n=="onLoad"){p(g,function(G,F){if(F[0]){c._api().fp_addCuepoints(F[0],d,G)}});return false}k=k||f;if(n=="onCuepoint"){var D=g[E];if(D){return D[1].call(c,k,l)}}if(E&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(n)!=-1){u(k,E);if(E.metaData){if(!k.duration){k.duration=E.metaData.duration}else{k.fullDuration=E.metaData.duration}}}var j=true;p(a[n],function(){j=this.call(c,k,E,l)});return j}});if(b.onCuepoint){var i=b.onCuepoint;f.onCuepoint.apply(f,typeof i=="function"?[i]:i);delete b.onCuepoint}p(b,function(k,j){if(typeof j=="function"){t(a,k,j);delete b[k]}});if(d==-1){c.onCuepoint=this.onCuepoint}};var q=function(g,d,f,b){var i=this,c={},a=false;if(b){u(c,b)}p(d,function(k,j){if(typeof j=="function"){c[k]=j;delete d[k]}});u(this,{animate:function(D,n,j){if(!D){return i}if(typeof n=="function"){j=n;n=500}if(typeof D=="string"){var k=D;D={};D[k]=n;n=500}if(j){var l=y();c[l]=j}if(n===undefined){n=500}d=f._api().fp_animate(g,D,n,l);return i},css:function(k,j){if(j!==undefined){var l={};l[k]=j;k=l}d=f._api().fp_css(g,k);u(i,d);return i},show:function(){this.display="block";f._api().fp_showPlugin(g);return i},hide:function(){this.display="none";f._api().fp_hidePlugin(g);return i},toggle:function(){this.display=f._api().fp_togglePlugin(g);return i},fadeTo:function(n,j,k){if(typeof j=="function"){k=j;j=500}if(k){var l=y();c[l]=k}this.display=f._api().fp_fadeTo(g,n,j,l);this.opacity=n;return i},fadeIn:function(j,k){return i.fadeTo(1,j,k)},fadeOut:function(j,k){return i.fadeTo(0,j,k)},getName:function(){return g},getPlayer:function(){return f},_fireEvent:function(l,n,k){if(l=="onUpdate"){var D=f._api().fp_getPlugin(g);if(!D){return}u(i,D);delete i.methods;if(!a){p(D.methods,function(){var F=""+this;i[F]=function(){var H=[].slice.call(arguments);var G=f._api().fp_invoke(g,F,H);return G==="undefined"||G===undefined?i:G}});a=true}}var j=c[l];if(j){var E=j.apply(i,n);if(l.slice(0,1)=="_"){delete c[l]}return E}return i}})};function B(L,f,l){var d=this,g=null,H=false,j,n,i=[],b={},c={},k,J,N,I,O,M;u(d,{id:function(){return k},isLoaded:function(){return(g!==null&&g.fp_play!==undefined&&!H)},getParent:function(){return L},hide:function(D){if(D){L.style.height="0px"}if(d.isLoaded()){g.style.height="0px"}return d},show:function(){L.style.height=M+"px";if(d.isLoaded()){g.style.height=O+"px"}return d},isHidden:function(){return d.isLoaded()&&parseInt(g.style.height,10)===0},load:function(D){if(!d.isLoaded()&&d._fireEvent("onBeforeLoad")!==false){var F=function(){j=L.innerHTML;if(j&&!flashembed.isSupported(f.version)){L.innerHTML=""}if(D){D.cached=true;t(c,"onLoad",D)}flashembed(L,f,{config:l})};var E=0;p(C,function(){this.unload(function(G){if(++E==C.length){F()}})})}return d},unload:function(D){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent)){if(D){D(false)}return d}if(j.replace(/\s/g,"")!==""){if(d._fireEvent("onBeforeUnload")===false){if(D){D(false)}return d}H=true;try{if(g){g.fp_close();d._fireEvent("onUnload")}}catch(F){}var E=function(){g=null;L.innerHTML=j;H=false;if(D){D(true)}};setTimeout(E,50)}else{if(D){D(false)}}return d},getClip:function(D){if(D===undefined){D=I}return i[D]},getCommonClip:function(){return n},getPlaylist:function(){return i},getPlugin:function(F){var D=b[F];if(!D&&d.isLoaded()){var E=d._api().fp_getPlugin(F);if(E){D=new q(F,E,d);b[F]=D}}return D},getScreen:function(){return d.getPlugin("screen")},getControls:function(){return d.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return d.getPlugin("logo")._fireEvent("onUpdate")}catch(D){}},getPlay:function(){return d.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(D){return D?r(l):l},getFlashParams:function(){return f},loadPlugin:function(E,F,R,D){if(typeof R=="function"){D=R;R={}}var G=D?y():"_";d._api().fp_loadPlugin(E,F,R,G);var P={};P[G]=D;var Q=new q(E,null,d,P);b[E]=Q;return Q},getState:function(){return d.isLoaded()?g.fp_getState():-1},play:function(E,F){var D=function(){if(E!==undefined){d._api().fp_play(E,F)}else{d._api().fp_play()}};if(d.isLoaded()){D()}else{if(H){setTimeout(function(){d.play(E,F)},50)}else{d.load(function(){D()})}}return d},getVersion:function(){var D="flowplayer.js 3.2.4";if(d.isLoaded()){var E=g.fp_getVersion();E.push(D);return E}return D},_api:function(){if(!d.isLoaded()){throw"Flowplayer "+d.id()+" not loaded when calling an API method"}return g},setClip:function(D){d.setPlaylist([D]);return d},getIndex:function(){return N},_swfHeight:function(){return g.clientHeight}});p(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var E="on"+this;if(E.indexOf("*")!=-1){E=E.slice(0,E.length-1);var D="onBefore"+E.slice(2);d[D]=function(F){t(c,D,F);return d}}d[E]=function(F){t(c,E,F);return d}});p(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","),function(){var D=this;d[D]=function(F,G){if(!d.isLoaded()){return d}var E=null;if(F!==undefined&&G!==undefined){E=g["fp_"+D](F,G)}else{E=(F===undefined)?g["fp_"+D]():g["fp_"+D](F)}return E==="undefined"||E===undefined?d:E}});d._fireEvent=function(E){if(typeof E=="string"){E=[E]}var D=E[0],G=E[1],T=E[2],U=E[3],V=0;if(l.debug){w(E)}if(!d.isLoaded()&&D=="onLoad"&&G=="player"){g=g||A(J);O=d._swfHeight();p(i,function(){this._fireEvent("onLoad")});p(b,function(Q,P){P._fireEvent("onUpdate")});n._fireEvent("onLoad")}if(D=="onLoad"&&G!="player"){return}if(D=="onError"){if(typeof G=="string"||(typeof G=="number"&&typeof T=="number")){G=T;T=U}}if(D=="onContextMenu"){p(l.contextMenu[G],function(Q,P){P.call(d)});return}if(D=="onPluginEvent"||D=="onBeforePluginEvent"){var Y=G.name||G;var X=b[Y];if(X){X._fireEvent("onUpdate",G);return X._fireEvent(T,E.slice(3))}return}if(D=="onPlaylistReplace"){i=[];var S=0;p(G,function(){i.push(new v(this,S++,d))})}if(D=="onClipAdd"){if(G.isInStream){return}G=new v(G,T,d);i.splice(T,0,G);for(V=T+1;V<i.length;V++){i[V].index++}}var F=true;if(typeof G=="number"&&G<i.length){I=G;var W=i[G];if(W){F=W._fireEvent(D,T,U)}if(!W||F!==false){F=n._fireEvent(D,T,U,W)}}p(c[D],function(){F=this.call(d,G,T);if(this.cached){c[D].splice(V,1)}if(F===false){return false}V++});return F};function K(){if($f(L)){$f(L).getParent().innerHTML="";N=$f(L).getIndex();C[N]=d}else{C.push(d);N=C.length-1}M=parseInt(L.style.height,10)||L.clientHeight;k=L.id||"fp"+y();J=f.id||k+"_api";f.id=J;l.playerId=k;if(typeof l=="string"){l={clip:{url:l}}}if(typeof l.clip=="string"){l.clip={url:l.clip}}l.clip=l.clip||{};if(L.getAttribute("href",2)&&!l.clip.url){l.clip.url=L.getAttribute("href",2)}n=new v(l.clip,-1,d);l.playlist=l.playlist||[l.clip];var E=0;p(l.playlist,function(){var G=this;if(typeof G=="object"&&G.length){G={url:""+G}}p(l.clip,function(P,Q){if(Q!==undefined&&G[P]===undefined&&typeof Q!="function"){G[P]=Q}});l.playlist[E]=G;G=new v(G,E,d);i.push(G);E++});p(l,function(P,G){if(typeof G=="function"){if(n[P]){n[P](G)}else{t(c,P,G)}delete l[P]}});p(l.plugins,function(P,G){if(G){b[P]=new q(P,G,d)}});if(!l.plugins||l.plugins.controls===undefined){b.controls=new q("controls",null,d)}b.canvas=new q("canvas",null,d);j=L.innerHTML;function D(G){var P=d.hasiPadSupport&&d.hasiPadSupport();if(/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!/.flv$/i.test(i[0].url)&&!P){return true}if(!d.isLoaded()&&d._fireEvent("onBeforeClick")!==false){d.load()}return x(G)}function F(){if(j.replace(/\s/g,"")!==""){if(L.addEventListener){L.addEventListener("click",D,false)}else{if(L.attachEvent){L.attachEvent("onclick",D)}}}else{if(L.addEventListener){L.addEventListener("click",x,false)}d.load()}}setTimeout(F,0)}if(typeof L=="string"){var a=A(L);if(!a){throw"Flowplayer cannot access element: "+L}L=a;K()}else{K()}}var C=[];function z(a){this.length=a.length;this.each=function(b){p(a,b)};this.size=function(){return a.length}}window.flowplayer=window.$f=function(){var f=null;var g=arguments[0];if(!arguments.length){p(C,function(){if(this.isLoaded()){f=this;return false}});return f||C[0]}if(arguments.length==1){if(typeof g=="number"){return C[g]}else{if(g=="*"){return new z(C)}p(C,function(){if(this.id()==g.id||this.id()==g||this.getParent()==g){f=this;return false}});return f}}if(arguments.length>1){var a=arguments[1],d=(arguments.length==3)?arguments[2]:{};if(typeof a=="string"){a={src:a}}a=u({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:true},a);if(typeof g=="string"){if(g.indexOf(".")!=-1){var b=[];p(o(g),function(){b.push(new B(this,r(a),r(d)))});return new z(b)}else{var c=A(g);return new B(c!==null?c:g,a,d)}}else{if(g){return new B(g,a,d)}}}return null};u(window.$f,{fireEvent:function(){var b=[].slice.call(arguments);var a=$f(b[0]);return a?a._fireEvent(b.slice(1)):null},addPlugin:function(b,a){B.prototype[b]=a;return $f},each:p,extend:u});if(typeof jQuery=="function"){jQuery.fn.flowplayer=function(a,b){if(!arguments.length||typeof arguments[0]=="number"){var c=[];this.each(function(){var d=$f(this);if(d){c.push(d)}});return arguments.length?c[arguments[0]]:new z(c)}return this.each(function(){$f(this,r(a),b?r(b):{})})}}})();(function(){var o=document.all,l="http://www.adobe.com/go/getflashplayer",t=typeof jQuery=="function",q=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,u={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function n(a,b){if(b){for(var c in b){if(b.hasOwnProperty(c)){a[c]=b[c]}}}return a}function v(c,d){var a=[];for(var b in c){if(c.hasOwnProperty(b)){a[b]=d(c[b])}}return a}window.flashembed=function(c,a,b){if(typeof c=="string"){c=document.getElementById(c.replace("#",""))}if(!c){return}if(typeof a=="string"){a={src:a}}return new r(c,n(n({},u),a),b)};var p=n(window.flashembed,{conf:u,getVersion:function(){var a,c;try{c=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(d){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");c=a&&a.GetVariable("$version")}catch(g){try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");c=a&&a.GetVariable("$version")}catch(b){}}}c=q.exec(c);return c?[c[1],c[3]]:[0,0]},asString:function(b){if(b===null||b===undefined){return null}var c=typeof b;if(c=="object"&&b.push){c="array"}switch(c){case"string":b=b.replace(new RegExp('(["\\\\])',"g"),"\\$1");b=b.replace(/^\s?(\d+\.?\d+)%/,"$1pct");return'"'+b+'"';case"array":return"["+v(b,function(g){return p.asString(g)}).join(",")+"]";case"function":return'"function()"';case"object":var a=[];for(var d in b){if(b.hasOwnProperty(d)){a.push('"'+d+'":'+p.asString(b[d]))}}return"{"+a.join(",")+"}"}return String(b).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(i,b){i=n({},i);var j='<object width="'+i.width+'" height="'+i.height+'" id="'+i.id+'" name="'+i.id+'"';if(i.cachebusting){i.src+=((i.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(i.w3c||!o){j+=' data="'+i.src+'" type="application/x-shockwave-flash"'}else{j+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}j+=">";if(i.w3c||o){j+='<param name="movie" value="'+i.src+'" />'}i.width=i.height=i.id=i.w3c=i.src=null;i.onFail=i.version=i.expressInstall=null;for(var a in i){if(i[a]){j+='<param name="'+a+'" value="'+i[a]+'" />'}}var g="";if(b){for(var d in b){if(b[d]){var c=b[d];g+=d+"="+(/function|object/.test(typeof c)?p.asString(c):c)+"&"}}g=g.slice(0,-1);j+='<param name="flashvars" value=\''+g+"' />"}j+="</object>";return j},isSupported:function(a){return f[0]>a[0]||f[0]==a[0]&&f[1]>=a[1]}});var f=p.getVersion();function r(c,d,a){if(p.isSupported(d.version)){c.innerHTML=p.getHTML(d,a)}else{if(d.expressInstall&&p.isSupported([6,65])){c.innerHTML=p.getHTML(n(d,{src:d.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title})}else{if(!c.innerHTML.replace(/\s/g,"")){c.innerHTML="<h2>Flash version "+d.version+" or greater is required</h2><h3>"+(f[0]>0?"Your version is "+f:"You have no flash plugin installed")+"</h3>"+(c.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+l+"'>here</a></p>");if(c.tagName=="A"){c.onclick=function(){location.href=l}}}if(d.onFail){var b=d.onFail.call(this);if(typeof b=="string"){c.innerHTML=b}}}}if(o){window[d.id]=document.getElementById(d.id)}n(this,{getRoot:function(){return c},getOptions:function(){return d},getConf:function(){return a},getApi:function(){return c.firstChild}})}if(t){jQuery.tools=jQuery.tools||{version:"3.2.4"};jQuery.tools.flashembed={conf:u};jQuery.fn.flashembed=function(a,b){return this.each(function(){$(this).data("flashembed",flashembed(this,a,b))})}}})();"use strict";if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());if(typeof window.iVideo=="undefined"){window.iVideo={}}iVideo.Viewer=function(){var b=0;var config={thumbClass:"eMentorThumb",thumbPlaceholderClass:"eMentorThumbPlaceholder",urlPattern:/\/(?:szkolenie|training)\/.*?\/(\d+)/,ajaxTimeout:10000,tickInterval:700,posSaveTime:1814400,overlayOpacity:1,overlayColor:"#000000",controlsH:40,controlsTrackWDelta:528,controlsHeadW:5,seekTimeout:500,actionsOverlap:2000,flowplayerUrl:"http://www.ementor.pl/flash/flowplayer/flowplayer-3.2.5.swf",flowplayerContentUrl:"http://www.ementor.pl/flash/flowplayer/flowplayer.content-3.2.0.swf",flowplayerPseudostreamingUrl:"http://www.ementor.pl/flash/flowplayer/flowplayer.pseudostreaming-3.2.5.swf",flowplayerRTMPUrl:"http://www.ementor.pl/flash/flowplayer/flowplayer.rtmp-3.2.3.swf",flowplayerBwCheckUrl:"http://www.ementor.pl/flash/flowplayer/flowplayer.bwcheck-3.2.3.swf",loaderUrl:"http://www.ementor.pl/img/iVideo/Viewer/loader.gif",speed:{slow:1000,fast:400},layout1:{titleH:10,playerH:65,controlsW:100,controlsH:40,chaptersW:150,chaptersBW:2,chapterWidth:123,chaptersBorderW:2,chaptersTabY:20,chaptersTabW:27,chaptersTabH:89,marginLeft:0,marginRight:0,marginTop:0,marginBottom:0,playerInnerPadding:0,playerBorderWidth:0},layout2:{titleH:10,centerH:65,centerW:90,controlsW:100,controlsH:40,chaptersW:150,chaptersBW:2,chapterWidth:123,chaptersBorderW:2,chaptersTabY:20,chaptersTabW:27,chaptersTabH:89,marginLeft:50,marginRight:50,marginTop:1,marginBottom:10,playerInnerPadding:5,playerBorderWidth:2,playermediaMargin:20,playerMediaRatio:0.5,mediaInnerPadding:5,mediaBorderWidth:2,mediaMargin:20},layout3:{titleH:10,centerH:65,centerW:90,controlsW:100,controlsH:40,chaptersW:150,chaptersBW:2,chapterWidth:123,chaptersBorderW:2,chaptersTabY:20,chaptersTabW:27,chaptersTabH:89,marginLeft:50,marginRight:50,marginTop:1,marginBottom:10,playerInnerPadding:5,playerBorderWidth:2,playermediaMargin:20,playerMediaRatio:0.35,mediaInnerPadding:5,mediaBorderWidth:2,mediaMargin:20},margin:50};var a=false;var c=false;var d=false;return{isLoading:false,isLoaded:false,isVisible:false,isResizing:false,isMorphing:false,dims:{},layout:0,wrapperEl:"",loaderEl:"",overlayEl:"",videoFrameEl:"",mediaFrameEl:"",playerEl:"",mediaEl:"",titleEl:"",originEl:"",controlsEl:"",timeEl:"",muteEl:"",closeEl:"",chaptersEl:"",chaptersScrollEl:"",chaptersTabEl:"",player:"",training:"",layoutData:{},media:"",hasChapters:false,chapter:"",chapterId:"",chaptersApi:"",action:"",actions:[],actionsRoll:[],nextActionMark:"",nextAction:"",nextActionIndex:-1,resetOnPlay:false,resetOnSeek:false,tickTimer:0,browser:{isIE:function(){return !+"\v1"},isIPad:function(){return navigator.userAgent.match(/iPad/i)!==null},isIPhone:function(){return navigator.userAgent.match(/iPhone/i)!==null},isIOS:function(){return(navigator.userAgent.match(/iPad/i)!==null)||(navigator.userAgent.match(/iPhone/i)!==null)},iOSVersion:function(){var f=navigator.userAgent.match(/OS (\d+)_/i);if(f&&f[1]){return f[1]}},isAndroid:function(){return navigator.userAgent.match(/Android/i)!==null},androidVersion:function(){var f=navigator.userAgent.match(/Android (\d+)\./i);if(f&&f[1]){return f[1]}}},isInit:function(){return d},init:function(){if(d){return}d=true;if(typeof window.console=="undefined"){window.console={log:function(f){}}}if(typeof iVideo.delayedEmbeds=="object"&&iVideo.delayedEmbeds.length>0){while(embed=iVideo.delayedEmbeds.shift()){iVideojQuery("#"+embed[0]).replaceWith(embed[1])}}if(iVideo.Viewer.browser.isIOS()){iVideojQuery("."+config.thumbClass+" a").bind("click",iVideo.Viewer.showForTrigger)}else{iVideojQuery(".eMentorThumb a div.play").css({opacity:0.5});iVideojQuery(".eMentorThumb a").hover(function(){iVideojQuery(this).children("div.play").stop().animate({opacity:0.85})},function(){iVideojQuery(this).children("div.play").stop().animate({opacity:0.5})});iVideojQuery("."+config.thumbClass+" a").bind("click",iVideo.Viewer.showForTrigger);if(iVideojQuery.browser.msie){iVideojQuery(".eMentorThumb img[src$=png]").each(function(){this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.src+",sizingMethod='scale')"})}}return true},showForTrigger:function(i){var f=iVideo.Viewer;i.preventDefault();var g=iVideojQuery(this).attr("trainingdata");if(typeof(g)=="string"&&g.length>1){f.show(g,this);return false}},show:function(n,i){var g=iVideo.Viewer;if(g.isMorphing||g.isVisible){return false}try{var j=n;if(j.indexOf("?")==-1){j+="?"}else{if(j.substr(j.length-1)!="&"){j+="&"}}if(encodeURIComponent){j=j+"url="+encodeURIComponent(window.location.href);if(document.referer){j=j+"&ref="+encodeURIComponent(document.referer)}}else{j=j+"url="+escape(window.location.href).replace(/\+/g,"%2B").replace(/\//g,"%2F");if(document.referer){j=j+"&ref="+escape(document.referer).replace(/\+/g,"%2B").replace(/\//g,"%2F")}}n=j}catch(l){}a=false;if(b){console.log("Show: Showing training from url "+n)}if(g.browser.isIOS()){if(b){console.log("Show: Using HTML5 player, no shim")}var f=iVideojQuery(i).attr("target");if(f){g.wrapperEl=iVideojQuery(f)}else{g.wrapperEl=iVideojQuery(i).closest("."+config.thumbClass);if(g.wrapperEl.length==0){g.wrapperEl=iVideojQuery(i).closest("div")}}}else{if(g.wrapperEl==""){g.wrapperEl=iVideojQuery('<div class="iVideoWrapper"></div>').appendTo("body")}var k=iVideojQuery(window).scrollTop();var o=iVideojQuery(window).scrollLeft();iVideojQuery("html").css("overflow","hidden");iVideojQuery("body").css("overflow","hidden");iVideojQuery(window).scrollTop(k);iVideojQuery(window).scrollLeft(o);g.overlayEl=iVideojQuery('<div class="iVideoOverlay"></div>').css({top:iVideojQuery(window).scrollTop()-100,left:iVideojQuery(window).scrollLeft()-100,width:iVideojQuery(window).width()+ +500,height:iVideojQuery(window).height()+ +500,opacity:0.1,background:config.overlayColor}).appendTo(g.wrapperEl).animate({opacity:config.overlayOpacity},{duration:"slow",easing:"easeOut"}).queue(function(){iVideojQuery(this).dequeue();var p=iVideo.Viewer;if(!p.isLoaded&&p.isLoading){iVideojQuery('<img src="'+config.loaderUrl+'"/>').load(function(){if(!p.isLoaded&&p.isLoading){p.loaderEl=iVideojQuery(this);iVideojQuery(this).css({position:"absolute",left:iVideojQuery(window).width()/2-this.width/2,top:iVideojQuery(window).scrollTop()+(iVideojQuery(window).height()/2-this.height/2),"z-index":8001}).appendTo(p.wrapperEl)}else{iVideojQuery(this).remove()}})}})}g.isLoading=true;g.isLoaded=false;iVideojQuery.ajax({url:n,cache:false,timeout:config.ajaxTimeout,dataType:"jsonp",jsonp:"JPP",success:function(q){var p=iVideo.Viewer;if(b){console.log("AJAX: Received data from "+n)}if(typeof(q)!="object"||(q===null)||typeof(q.success)=="undefined"||(q.success&&(typeof(q.data)=="undefined"))){if(b){console.log("AJAX: Data is malformed")}p.criticalError("Przepraszamy, ale wybrane szkolenie jest chwilowo niedostępne.Spróbuj za chwilę lub skontaktuj się z Obsługą Klienta eMentor.pl")}else{if(!q.success){if(b){console.log("AJAX: Server returned an error: "+(q.errNo>0?q.errNo:"")+": "+q.errMsg)}p.criticalError(q.errMsg)}else{try{p.prepare(q.data)}catch(r){p.criticalError("Wystąpił błąd przy próbie wyświetlenia szkolenia. Prawdopodobnie twoja przeglądarka internetowa jest niepoprawnie ustawiona i nie pozwala na wyświetlanie niektórych elementów multimedialnych. Prosimy o kontakt z Obsługą Klienta pod adresem http://www.ementor.pl/pomoc")}}}},error:function(t,p,r){var q=iVideo.Viewer;if(b){console.log("AJAX: An error occured: "+p)}q.criticalError("Przepraszamy, ale wybrane szkolenie jest chwilowo niedostępne.Spróbuj za chwilę lub skontaktuj się z Obsługą Klienta eMentor.pl")}})},shortTime:function(g,f){g=parseInt(g)||0;h=0;m=0;s=0;ms=0;if(g>=3600){h=Math.floor(g/3600);m=Math.floor((g-h*3600)/60);s=Math.floor((g-h*3600-m*60)%60);ms=Math.round((g-((h*3600)+(m*60)+s))*10000);return h+" godz."+(m>0?" "+m+" min.":"")}else{if(g>=60){h=0;m=Math.floor(g/60);s=Math.floor((g-m*60)%60);ms=Math.round((g-((m*60)+s))*10000);return m+" min."+(s>0&&f?" "+s+" sek.":"")}else{h=0;m=0;s=Math.floor(g);ms=Math.round((g-s)*10000);return s+" sec."}}},prepare:function(n){var i=iVideo.Viewer;if(b){console.log("prepare: Preparing iVideo player...")}i.isLoading=false;i.isLoaded=true;i.training=n;if(i.training.rev==2&&!i.training.isPreview){i.training.fullLength=i.training.length}i.hasChapters=i.training.chapters&&i.training.chapters.length>1;i.hasActions=i.training.actions&&i.training.actions.length>0;if(i.hasActions){i.actionsRoll=[];i.actions=[];for(var f=0;f<i.training.actions.length;f++){var g=iVideojQuery.extend({},i.training.actions[f]);g.time=g.timeStart/1000;var k=g.type;delete g.type;var l=new iVideo.action[k](g);i.actionsRoll.push(g.timeStart/1000);i.actions.push(l);if(g.timeEnd>0&&((f==i.training.actions.length-1)||(i.training.actions[f+1].timeStart-config.actionsOverlap>g.timeEnd))){i.actionsRoll.push(g.timeEnd/1000);i.actions.push(new iVideo.action.Reset({time:g.timeEnd/1000}))}}}if(i.hasActions){i.nextActionMark=i.actionsRoll[0];i.nextActionIndex=0}i.layoutData={videoWidth:i.training.videoWidth,videoHeight:i.training.videoHeight};if(i.loaderEl!=""){i.loaderEl.remove();i.loaderEl=""}if(i.browser.isIOS()){return i._initHTML5Video(i.wrapperEl)}i.isMorphing=true;i.layout=1;if(i.hasChapters){c=true}i.dims=i._calcDimensions(1,i.layoutData);if(i.videoFrameEl==""){i.videoFrameEl=iVideojQuery('<div class="iVideoVideoFrame"></div>').appendTo(i.wrapperEl)}if(i.controlsEl==""){i.controlsEl=iVideojQuery('<div class="iVideoControls"><div class="iVideoControlsInner"><a class="iVideoBrand">&nbsp;</a><a class="iVideoPlay">Play</a><div class="iVideoTrack"><div class="iVideoBuffer"/><div class="iVideoProgress"/><div class="iVideoPlayhead"/><div class="iVideoPreviewMark">'+(i.training.isPreview?"oglądasz darmowy fragment ("+i.shortTime(i.training.previewLength)+" z "+i.shortTime(i.training.fullLength)+")":"")+'</div></div><div class="iVideoTime"></div><div class="iVideoQuality"><div class="iVideoQualityHeader">JAKOŚĆ</div><div class="iVideoQualitySelection"></div></div><a class="iVideoMute">mute</a><a class="iVideoClose">Zamknij</a></div></div>').appendTo(i.wrapperEl)}i.timeEl=iVideojQuery(".iVideoTime",i.controlsEl).html("<strong>"+(i.training.fullLength>=3600?"00:":"")+"00:00</strong>"+i.getDottedTime(i.training.fullLength));i.muteEl=iVideojQuery(".iVideoMute",i.controlsEl);i.qualitySelection=iVideojQuery(".iVideoQualitySelection",i.controlsEl);if(i.training.rev==2){var f=0;iVideojQuery.each(i.training.formats,function(p,o){var q=iVideojQuery('<a href="#" class="iVideoQualitySelectionOption" id="iVideoQualitySelection'+o.bitrate+'">'+o.abbr+"</a>");q.appendTo(i.qualitySelection);q.click(i.changeQuality.createDelegate(i,[f++,p],true))})}else{i.qualitySelection.append('<a href="#" onclick="return false;" class="iVideoQualitySelectionOption iVideoQualitySelectionOptionSelected">SD</a>')}if(i.chaptersEl==""&&i.hasChapters){i.chaptersEl=iVideojQuery('<div class="iVideoChapters"><div class="iVideoChaptersScroll"></div><a href="#" class="iVideoChaptersScrollNext"></a><a href="#" class="iVideoChaptersScrollPrev disabled"></a></div>');i.chaptersScrollEl=iVideojQuery(".iVideoChaptersScroll",i.chaptersEl);i.chaptersScrollNextEl=iVideojQuery(".iVideoChaptersScrollNext",i.chaptersEl);i.chaptersScrollPrevEl=iVideojQuery(".iVideoChaptersScrollPrev",i.chaptersEl);var j=iVideojQuery('<div class="iVideoChaptersItems"></div>').appendTo(i.chaptersScrollEl);iVideojQuery.each(i.training.chapters,function(o,q){var p=iVideojQuery('<div class="iVideoChapter'+(parseInt(q.uber)>0?" iVideoChapterUber":"")+'" id="iVideoChapter'+q.id+'">'+q.name+"</div>");p.click(i.goToChapter.createDelegate(this,[o],false));p.appendTo(j)});i.chaptersTabEl=iVideojQuery('<div class="iVideoChaptersTab">&nbsp;</div>');i.chaptersTabEl.css({left:i.dims.chaptersTabX,top:i.dims.chaptersTabY});i.chaptersTabEl.click(i.toggleChapters);c=true}iVideojQuery(window).keydown(iVideo.Viewer.escHandler);iVideojQuery(i.wrapperEl).keydown(iVideo.Viewer.escHandler);i.closeEl=iVideojQuery(".iVideoClose",i.controlsEl).click(i.hide);i.videoFrameEl.appendTo(i.wrapperEl).css({width:50,height:50,width:i.dims.playerW,height:i.dims.playerH,left:i.dims.playerX,top:i.dims.playerY,borderWidth:0}).show();i.controlsEl.css({width:i.dims.controlsW,height:i.dims.controlsH,top:i.dims.controlsY,left:i.dims.controlsX,opacity:"hide"}).appendTo(i.wrapperEl).hide().animate({opacity:"show"},{queue:true});if(i.chaptersEl!=""){i.chaptersEl.css({width:i.dims.chaptersW,height:i.dims.chaptersH,top:i.dims.chaptersY,left:i.dims.chaptersX}).appendTo(i.wrapperEl).animate({opacity:"show"}).queue(function(){iVideojQuery(this).dequeue();i.chaptersScrollEl.css({width:i.dims.chaptersW,height:i.dims.chaptersH});try{i.chaptersApi=i.chaptersScrollEl.scrollable({clickable:false,vertical:true,size:3,items:".iVideoChaptersItems",api:true,onSeek:function(r){var p=this.getIndex();var q=this.getSize();if(p==0){i.chaptersScrollPrevEl.addClass("disabled")}else{i.chaptersScrollPrevEl.removeClass("disabled")}if(p==q-1){i.chaptersScrollNextEl.addClass("disabled")}else{i.chaptersScrollNextEl.removeClass("disabled")}}});i.chaptersScrollNextEl.click(function(p){p.preventDefault();i.chaptersApi.move(6)});i.chaptersScrollPrevEl.click(function(p){p.preventDefault();i.chaptersApi.move(-5)})}catch(o){if(b){console.log("prepare: scrollable thrown an exception: "+o.message)}}});i.chaptersTabEl.appendTo(i.wrapperEl).animate({opacity:"show"})}i.controlsEl.queue(function(){iVideojQuery(this).dequeue();i.isVisible=true;i.playerEl=i.videoFrameEl.append('<div class="player"></div>');try{i._initVideo(i.playerEl)}catch(o){return i.criticalError()}iVideojQuery(window).bufferBind(200,"resize",i.onResize);i.isMorphing=false})},escHandler:function(f){if(f.keyCode==27){iVideo.Viewer.hide()}},hide:function(){var f=iVideo.Viewer;f.isVisible=false;f.isMorphing=true;f.isLoaded=false;f.isLoading=false;f.isResizing=false;iVideojQuery(window).unbind("keydown",iVideo.Viewer.escHandler);f.training="";f.actions="";f.actionsRoll="";iVideojQuery(window).bufferUnbind("resize");f._unregisterTick();if(f.player!=""){f.player.stop();f.player.unload();f.player=""}iVideojQuery.deleteNode(f.playerEl);f.playerEl="";if(f.chaptersEl!=""){iVideojQuery.deleteNode(f.chaptersEl)}if(f.chaptersTabEl!=""){iVideojQuery.deleteNode(f.chaptersTabEl)}if(f.controlsEl!=""){iVideojQuery.deleteNode(f.controlsEl)}if(f.loaderEl!=""){iVideojQuery.deleteNode(f.loaderEl)}f.chaptersEl="";f.controlsEl="";f.loaderEl="";if(f.mediaFrameEl!=""){if(f.media!=""){f.media.hide()}f.mediaFrameEl.fadeOut("fast",function(){iVideojQuery.deleteNode(f.mediaEl);iVideojQuery.deleteNode(f.mediaFrameEl);f.mediaEl="";f.mediaFrameEl="";f.media=""})}var g=function(){f.overlayEl.fadeOut("normal",function(){iVideojQuery.deleteNode(this);f.overlayEl="";iVideojQuery.deleteNode(f.wrapperEl);f.wrapperEl="";var i=iVideojQuery(window).scrollTop();var j=iVideojQuery(window).scrollLeft();iVideojQuery("html").css("overflow","").css("margin","").css("padding","");iVideojQuery("body").css("overflow","").css("margin","").css("padding","");iVideojQuery(window).scrollTop(i);iVideojQuery(window).scrollLeft(j);f.isMorphing=false;f.layout=0;f.layoutData={};f.dims={}})};if(f.videoFrameEl!=""){f.videoFrameEl.fadeOut("fast",function(){iVideojQuery.deleteNode(this);f.videoFrameEl="";g()})}else{g()}},goToChapter:function(j,l,o){var i=iVideo.Viewer;if(!i.isVisible||!i.isLoaded||i.isMorphing||i.isResizing||!i.player||i.player.getState()<=1){return false}if(!i.hasChapters){return false}if(b){console.log("goToChapter: "+(o?"marking chapter ":"going to ")+j)}if(l){var k=j;j="";for(var g=0;g<i.training.chapters.length;g++){var n=i.training.chapters[g];if(n.id==k){j=n;break}}if(j==""){return false}var f=g}else{if(typeof(i.training.chapters[j])!="object"){return false}var f=j;j=i.training.chapters[j]}iVideojQuery(".iVideoChapter").removeClass("active");iVideojQuery("#iVideoChapter"+j.id).addClass("active");if(typeof(i.training.chapters[f+1])!="undefined"){i.player.nextChapter=f+1;i.player.nextChapterMark=i.training.chapters[i.player.nextChapter].time/1000}else{i.player.nextChapterMark=-1;i.player.nextChapter=-1}if(b){console.log("goToChapter: next chapter is "+i.player.nextChapter+" at "+i.player.nextChapterMark)}if(typeof(o)=="undefined"||!o){i.isSeeking=true;if(b){console.log("goToChapter: will seek to "+(j.time/1000))}i.player.seek(parseFloat(j.time/1000)+1e-8);if(i.player.getState()==4){i.player.play()}}setTimeout(function(){if(i.player&&i.player.getClip){i._tick(i,i.player.getClip(),true)}},300);return true},findChapter:function(i,k){var g=iVideo.Viewer;if(k){var j=i;i="";for(var f=0;f<g.training.chapters.length;f++){var l=g.training.chapters[f];if(l.id==j){i=l;break}}if(i==""){return false}else{return i}}else{if(typeof(g.training.chapters[i])!="object"){return false}else{return g.training.chapters[i]}}},toggleChapters:function(){var f=iVideo.Viewer;if(f.isMorphing||f.isResizing){return}if(!f.hasChapters){return false}c=c?false:true;if(b){console.log("toggleChapters: "+(c?"showing chapters tab":"hiding chapters tab"))}f._layout(f.layoutData,null,true)},changeQuality:function(j,f,k){j.preventDefault();var g=iVideo.Viewer;var i=g.training.formats[k].bitrate;g.player.getPlugin("bwcheck").setBitrate(i);g.qualitySelection.children().each(function(){if(this.id=="iVideoQualitySelection"+i){iVideojQuery(this).addClass("iVideoQualitySelectionOptionSelected")}else{iVideojQuery(this).removeClass("iVideoQualitySelectionOptionSelected")}})},onResize:function(){var f=iVideo.Viewer;if(b){console.log("Window has been resized...")}if(f.isResizing){iVideojQuery(window).trigger("resize");if(b){console.log("onResize: Will not resize player, because it is currently animating")}return false}else{return f._layout(f.layoutData)}},eop:function(){try{var g=iVideo.Viewer;var f=new iVideo.action.PreviewEnd({layout:2,url:g.training.eopUrl});f.execute.call(f)}catch(i){}},_layout:function(i,k,g){var f=iVideo.Viewer;if(b){console.log("Layout: Received "+(g?"force ":"")+"layout request  with "+(k?"a callback":"no callback"))}if(!f.isVisible){if(b){console.log("Layout: Cannot resize Viewer canvas - Viewer not visible")}return false}if(f.isResizing){if(b){console.log("Layout: Will not relayout, because it is currently resizing")}return false}if(typeof k=="undefined"&&typeof e=="function"){k=e}var j=f._calcDimensions(f.layout,i);if(!g&&f.dims.windowW==j.windowW&&f.dims.windowH==j.windowH&&f.layout==f.dims.layout){if(b){console.log("Layout: No need to relayout")}if(typeof k=="function"){k.call(this)}return false}if(b){console.log("Layout: doing "+(g?"FORCE ":"")+"layout in mode "+f.layout+" with "+(k?"a callback":"no callback"))}f.isResizing=true;f.dims=j;f.overlayEl.css({top:iVideojQuery(window).scrollTop()-100,left:iVideojQuery(window).scrollLeft()-100,width:iVideojQuery(window).width()+500,height:iVideojQuery(window).height()+500});if(b){console.log("Layout: Resizing layout "+f.layout+" to new dims "+j.playerW+"x"+j.playerH)}if(!g&&f.hasChapters){f.chaptersEl.fadeTo("fast",0);f.chaptersTabEl.fadeTo("fast",0)}f.controlsEl.fadeTo("fast",g?1:0,function(){var l=function(){if(f.hasChapters){f.chaptersScrollEl.css({width:f.dims.chaptersW,height:f.dims.chaptersH});f.chaptersEl.css({width:j.chaptersW,height:j.chaptersH,left:j.chaptersX,top:j.chaptersY}).fadeTo("fast",1);f.chaptersTabEl.css({left:j.chaptersTabX,top:j.chaptersTabY}).fadeTo("fast",1)}f.player.previewW=j.trackW*f.training.previewLength/f.training.fullLength;if(f.training.isPreview){f.player.previewMarkEl.style.left=f.player.previewW+"px"}f._tick(f,f.player.getClip(),true);f.controlsEl.css({width:j.controlsW,height:j.controlsH,left:j.controlsX,top:j.controlsY}).fadeTo("fast",1,function(){f.isResizing=false;if(typeof k=="function"){k.call()}})};if(f.layout==2||f.layout==3){if(iVideojQuery.browser.mozilla){f.videoFrameEl.css({width:j.playerW,height:j.playerH,left:j.playerX,top:j.playerY})}else{f.videoFrameEl.animate({width:j.playerW,height:j.playerH,left:j.playerX,top:j.playerY},config.speed.fast,"")}if(!f.mediaFrameEl.is(":visible")){f.mediaFrameEl.css({width:50,height:50,top:iVideojQuery(window).scrollTop()+iVideojQuery(window).height()/2-25,left:iVideojQuery(window).width()/2-25,opacity:0,display:"block"}).animate({width:j.mediaW,height:j.mediaH,left:j.mediaX,top:j.mediaY,opacity:1},config.speed.slow,"",l)}else{if(f.loaderEl!=""){f.loaderEl.hide()}f.mediaFrameEl.animate({width:j.mediaW,height:j.mediaH,left:j.mediaX,top:j.mediaY},(f.media.canBeTransformed?config.speed.fast:0),"",function(){if(f.loaderEl!=""){var o=f.loaderAnchor.offset().left+f.loaderEl.width()/2;var n=f.loaderAnchor.offset().top+f.loaderEl.height()/2;f.loaderEl.css({top:o,left:n}).show()}if(f.media&&f.media!=""&&f.media.isLoaded==true){f.media.layout()}l.call()})}}else{if(iVideojQuery.browser.mozilla){f.videoFrameEl.css({width:j.playerW,height:j.playerH,left:j.playerX,top:j.playerY});l.call()}else{f.videoFrameEl.animate({width:j.playerW,height:j.playerH,left:j.playerX,top:j.playerY},config.speed.fast,"",l)}}});return true},_action:function(){var f=iVideo.Viewer;f.action=f.actions[f.nextActionIndex];if(f.actions.length>f.nextActionIndex+1){f.nextActionIndex++;f.nextActionMark=f.actions[f.nextActionIndex].time}else{f.nextActionIndex=-1;f.nextActionMark=-1}if(b){console.log("Action "+f.action.type+" at "+f.action.time)}return f.action.execute.call(f.action)},_morph:function(g,j){var f=iVideo.Viewer;if(g==f.layout){return true}if(f.isMorphing){if(b){console.log("Morph: Cannot morph now! A morph is currently being performed...")}return}f.isMorphing=true;if(b){console.log("Morph: "+f.layout+" -> "+g)}try{f.player.getPlugin("titleBar").hide()}catch(i){}if(f.layout==1&&(g==2||g==3)){if(f.mediaFrameEl==""){f.mediaFrameEl=iVideojQuery('<div class="iVideoMediaFrame"></div>').hide().appendTo(f.wrapperEl)}f.layout=g;f._layout(f.layoutData,function(){if(b){console.log("Morph: layout "+g+" complete")}f.isMorphing=false;if(typeof j=="function"){if(b){console.log("Morph: calling external callback")}j.call(f)}})}else{if((f.layout==2||f.layout==3)&&g==1){if(f.media!=""&&f.media.hide){f.media.hide()}iVideojQuery.deleteNode(f.mediaEl);f.media="";f.mediaEl="";if(b){console.log("Morph: hiding media frame...")}f.mediaFrameEl.fadeOut(config.speed.slow,function(){if(b){console.log("Morph: media frame is hidden - will layout")}f.mediaFrameEl.remove();f.mediaFrameEl="";f.layout=g;f._layout(f.layoutData,function(){if(b){console.log("Morph: layout 1 complete")}iVideo.Viewer.isMorphing=false;if(typeof j=="function"){j.call(f)}})})}else{f.layout=g;f._layout(f.layoutData,function(){iVideo.Viewer.isMorphing=false;if(typeof j=="function"){j.call(f)}})}}},_calcDimensions:function(x,A){var q=iVideo.Viewer;var k=iVideojQuery(window).width();var t=iVideojQuery(window).height();var g=iVideojQuery(document).width();var o=iVideojQuery(document).height();var z=q.training.rev==1?A.videoWidth/A.videoHeight:q.training.aspectRatio;var f=iVideojQuery(window).scrollTop();var n={windowW:k,windowH:t,layout:x};if(x==1){var l=config.layout1;var i=t-(config.layout1.margin*2||(config.layout1.marginTop+config.layout1.marginBottom));var B=k-(config.layout1.margin*2||(config.layout1.marginLeft+config.layout1.marginRight));var v=0;n.controlsW=B;n.controlsH=l.controlsH;n.playerH=i-n.controlsH;n.playerW=n.playerH*z;if(n.playerW>(B-(c?l.chaptersW+l.chaptersBW:0))){n.playerW=(B-(c?l.chaptersW+l.chaptersBW:0));n.playerH=n.playerW/z}var w=(B-(c?l.chaptersW+l.chaptersBW:0))-l.chaptersTabW*2;if(n.playerW>w){var p=n.playerW-w;n.playerW=n.playerW-p;n.playerH=n.playerH-(p/z)}n.chaptersW=l.chaptersW;n.chaptersH=i-l.controlsH;n.playerY=f+(i-n.controlsH-n.playerH)/2;n.playerX=((B-(c?l.chaptersW+l.chaptersBW:0))-n.playerW)/2;n.controlsX=0;n.controlsY=f+i-l.controlsH;n.chaptersX=B-(c?n.chaptersW:0);n.chaptersY=f;n.chaptersTabX=n.chaptersX-l.chaptersTabW;n.chaptersTabY=n.chaptersY+l.chaptersTabY}else{if(x==2||x==3){var l=x==2?config.layout2:config.layout3;var i=t;var B=k;var v=0;n.controlsW=B;n.controlsH=l.controlsH;n.centerW=B-(c?l.chaptersW:0);n.centerH=i-n.controlsH;n.chaptersW=l.chaptersW;n.chaptersH=n.centerH;n.centerX=0;n.centerY=f;n.playerH=n.centerH;n.playerW=Math.floor(n.centerW/2);var y=n.centerW-n.playerW-(l.mediaInnerPadding*2+l.mediaBorderWidth*2)-l.mediaMargin*2;var r=n.centerH-(l.mediaInnerPadding*2+l.mediaBorderWidth*2);if(A.mediaWidth&&A.mediaHeight&&parseInt(A.mediaWidth)>0&&parseInt(A.mediaHeight)>0){var u=A.mediaWidth/A.mediaHeight;if(!A.mediaFitMode||A.mediaFitMode==1||A.mediaFitMode==2){if(A.mediaWidth<=y){n.mediaW=A.mediaWidth;n.mediaH=Math.min(n.mediaW/u,r,A.mediaHeight)}else{n.mediaW=y;n.mediaH=Math.min(n.mediaW/u,r,A.mediaHeight)}}else{if(A.mediaFitMode==3||A.mediaFitMode==4){if(A.mediaWidth>y||A.mediaHeight>r){n.mediaW=Math.min(y,A.mediaWidth);n.mediaH=Math.floor(n.mediaW/u);if(n.mediaH>r){n.mediaH=r;n.mediaW=Math.floor(r*u)}}else{if(A.mediaFitMode==4&&(A.mediaWidth<y)){n.mediaW=y;n.mediaH=Math.floor(n.mediaW/u);if(n.mediaH>r){n.mediaH=r;n.mediaW=Math.floor(r*u)}}else{if(A.mediaFitMode==4&&(A.mediaHeight<r)){n.mediaH=r;n.mediaW=Math.floor(n.mediaH*u);if(n.mediaW>y){n.mediaW=y;n.mediaH=Math.floor(y/u)}}else{n.mediaW=A.mediaWidth;n.mediaH=A.mediaHeight}}}}}}else{n.mediaW=y;n.mediaH=r}var j=n.mediaW+l.mediaInnerPadding*2+l.mediaBorderWidth*2+n.playerW;n.playerY=n.centerY;n.playerX=n.centerX;n.mediaY=n.centerY+n.centerH/2-((n.mediaH+l.mediaInnerPadding*2+l.mediaBorderWidth*2)/2);n.mediaX=n.playerX+n.playerW+l.mediaMargin;n.controlsX=0;n.controlsY=n.playerY+n.playerH;n.chaptersX=n.centerX+n.centerW;n.chaptersY=n.centerY;n.chaptersTabX=n.chaptersX-l.chaptersTabW;n.chaptersTabY=n.chaptersY+l.chaptersTabY}}n.trackW=n.controlsW-config.controlsTrackWDelta;if(b){console.log("Calculated dimensions for layout "+q.layout)}if(b){console.log(n)}return n},_initHTML5Video:function(i){var j=iVideo.Viewer;var n="";if(j.training.rev==1){n=j.training.videoUrlMp4}else{if(j.training.rev==2){n="";bitrates=[];var f=0;iVideojQuery.each(j.training.formats,function(p,o){bitrates.push({isDefault:f++==0,width:o.width,height:o.height,bitrate:o.bitrate,url:o.url});if(n===""){n=o.url}});var g=bitrates.length>1}else{return j.criticalError()}}var l=iVideojQuery(i)[0].className;var k=iVideojQuery('<video class="'+l+'" controls preload><source src="'+n+'" /></video>');iVideojQuery(i).replaceWith(k);i=k;j.player=k[0];window.h5player=j.player;j.player.play()},_initVideo:function(g){var o=iVideo.Viewer;if(o.training.rev==1){var j=!flashembed.isSupported([9,115])||(window.location&&window.location.hash&&window.location.hash=="#forceFlv");if(o.training.useRTMP){var n=j?o.training.videoUrlFlv:o.training.videoUrlMp4;var k=n.match(/^(rtmp\:\/\/[^\/]*?\/[a-z0-9]+)\/(\S+)$/);var n=(j?"":"mp4:")+k[2];var i=k[1]}else{var n=j?o.training.videoUrlFlv:o.training.videoUrlMp4}}else{if(o.training.rev==2){var j=false;var n="";bitrates=[];var l=0;iVideojQuery.each(o.training.formats,function(r,q){bitrates.push({isDefault:l++==0,width:q.width,height:q.height,bitrate:q.bitrate,url:q.url});if(n===""){n=q.url}});var p=bitrates.length>1}}var f={key:"#$161de352625dcfe686e",canvas:{backgroundGradient:"none"},plugins:{controls:null,pseudostreaming:{url:config.flowplayerPseudostreamingUrl,queryString:escape("start=${start}")},bwcheck:{url:config.flowplayerBwCheckUrl,serverType:"http",dynamic:false,rememberBitrate:true,maxWidth:iVideojQuery(window).width(),dynamicBuffer:true,netConnectionUrl:config.flowplayerUrl+"?"+Math.random(),onBwDone:function(q,r){o.qualitySelection.children().each(function(){if(this.id=="iVideoQualitySelection"+q.bitrate){iVideojQuery(this).addClass("iVideoQualitySelectionOptionSelected")}else{iVideojQuery(this).removeClass("iVideoQualitySelectionOptionSelected")}})}},rtmp:{url:config.flowplayerRTMPUrl},linkContent:{url:config.flowplayerContentUrl,display:"none",height:27,fontSize:"14px",style:{p:{color:"#ffffff",textAlign:"center"},a:{display:"block"}},onClick:function(q){if(typeof this.onClickHandler=="function"){this.onClickHandler.call(this)}}},titleBar:{url:config.flowplayerContentUrl,backgroundColor:"#000000",backgroundGradient:[0.2,0],opacity:0,border:"0px none",borderRadius:0,padding:10,html:"<p>"+o.training.name+"</p>",display:"block",height:50,width:"100%",top:0,left:0,style:{p:{color:"#ffffff",fontSize:21}}}},play:{replayLabel:"Od początku",rotateSpeed:100,opacity:1,height:"20%"},clip:{url:n,provider:o.training.useRTMP?"rtmp":"pseudostreaming",netConnectionUrl:o.training.useRTMP?i:"",scaling:"fit",urlResolvers:p?"bwcheck":undefined,bitrates:p?bitrates:undefined,autoPlay:true,onFinish:function(){if(b){console.log("player: Finished playback...")}o.player.playEl.className="iVideoPlay";if(o.training.isPreview){o.eop()}},onStart:function(q){if(b){console.log("player: Starting playback...")}if(o.hasChapters){o.goToChapter(0,false,true)}o._registerTick();o.player.playEl.className="iVideoPause";if(!a){o.player.getPlugin("titleBar").fadeTo(0.9,1000,function(){a=true;setTimeout(function(){if(o.player&&o.player.getPlugin){o.player.getPlugin("titleBar").fadeTo(0,1000)}},4000)})}if(o.layout!=1){o.player.pause();o._morph(1,function(){if(o.player.getState()==4){o.player.play()}})}},onBeforeResume:function(){if(o.isMorphing||o.isResizing){return false}if(b){console.log("player: About to resume playback...")}if(o.resetOnPlay){if(b){console.log("ResetOnPlay: Reseting view after media display...")}o.resetOnPlay=false;o.resetOnSeek=false;if(o.layout!=1){if(b){console.log("ResetOnPlay: have to change layout")}o._morph(1,function(){if(b){console.log("ResetOnPlay: layout changed")}if(o.player.getState()==4){o.player.play()}});return false}}return true},onResume:function(q){if(b){console.log("player: Resuming playback...")}o.player.playEl.className="iVideoPause";if(o.media!=""&&o.action.pause){o.media.stop()}},onPause:function(q){if(b){console.log("player: Pausing playback...")}o.player.playEl.className="iVideoPlay"},onStop:function(q){if(b){console.log("player: Stopping playback...")}},onBufferEmpty:function(q){},onSeek:o._onSeek},onLoad:function(){if(b){console.log("flowplayer: Loaded player")}o.player.setVolume(100)},onError:function(r,q){if(b){console.log("flowplayer: Received an error from flowplayer: "+r+": "+q)}o.criticalError()},onKeyPress:function(q){if(q==27){iVideo.Viewer.hide()}}};if(b){console.log("Prepared player config:");console.log(f)}o.player=flowplayer((g.tagName?g:g[0]),{src:config.flowplayerUrl,wmode:"window",menu:false,quality:"autohigh",cachebusting:iVideojQuery.browser.msie},f);o.player.trackEl=iVideojQuery(".iVideoTrack",o.controlsEl)[0];o.player.progressEl=iVideojQuery(".iVideoProgress",o.controlsEl)[0];o.player.bufferEl=iVideojQuery(".iVideoBuffer",o.controlsEl)[0];o.player.headEl=iVideojQuery(".iVideoPlayhead",o.controlsEl)[0];o.player.playEl=iVideojQuery(".iVideoPlay",o.controlsEl)[0];o.player.previewMarkEl=iVideojQuery(".iVideoPreviewMark",o.controlsEl)[0];iVideojQuery(o.player.playEl).click(function(){if(this.className=="iVideoPlay"&&!o.isMorphing&&!o.isResizing){o.player.play();this.className=="iVideoPause"}else{if(this.className=="iVideoPause"&&!o.isMorphing&&!o.isResizing){o.player.pause();this.className=="iVideoPlay"}}});iVideojQuery(o.muteEl).click(function(q){if(!o.player||!o.player.getStatus){return}if(o.player.getStatus().muted){if(b){console.log("flowplayer: unmuting")}this.className="iVideoMute";o.player.unmute()}else{if(b){console.log("flowplayer: muting")}this.className="iVideoUnmute";o.player.mute()}});iVideojQuery(o.player.trackEl).click(function(t){if(o.player.isSeeking||t.target.className=="iVideoPlayhead"){return}var q=(t.pageX-iVideojQuery(t.target).offset().left)/o.dims.trackW;var r=o.training.fullLength*q;if(o.training.isPreview&&r>o.training.previewLength){if(b){console.log("Scrubber: Clicked beyond preview time at: "+q+"% - time "+r)}o.isSeeking=true;r=o.training.previewLength-1;o.player.seek(r)}else{if(b){console.log("Scrubber: Clicked "+q+"% - time "+r)}o.isSeeking=true;o.player.seek(r)}var u=(t.pageX-iVideojQuery(o.player.trackEl).offset().left);if(u<0){u=0}else{if(u>o.dims.trackW){u=o.dims.trackW}else{if(o.training.isPreview&&u>o.player.previewW){u=o.player.previewW}}}o.player.headEl.style.left=Math.min(Math.max(0,(u-config.controlsHeadW/2)),(o.dims.trackW-config.controlsHeadW))+"px";o.player.progressEl.style.width=u+"px"});o.player.previewW=o.dims.trackW*(o.training.previewLength/o.training.fullLength);if(o.training.isPreview){o.player.previewMarkEl.style.display="block";o.player.previewMarkEl.style.left=o.player.previewW+"px"}iVideojQuery(o.player.headEl).mousedown(function(t){o.player.lastSeek="";o.player.isSeeking=true;o.player.seekTimer=0;var r=function(x){var y=(x.pageX-iVideojQuery(o.player.trackEl).offset().left);if(y<0){y=0}else{if(y>o.dims.trackW){y=o.dims.trackW}else{if(o.training.isPreview&&y>o.player.previewW){y=o.player.previewW}}}var v=y/o.dims.trackW;var w=o.training.fullLength*v;o.player.headEl.style.left=Math.min(Math.max(0,(y-config.controlsHeadW/2)),(o.dims.trackW-config.controlsHeadW))+"px";o.player.progressEl.style.width=y+"px";o.timeEl.html("<strong>"+o.getDottedTime(w,o.training.fullLength>=3600)+"</strong>"+o.getDottedTime(o.training.fullLength,o.training.fullLength>=3600));var u=(new Date()).getTime();if(o.player.lastSeek==""||(u-o.player.lastSeek<config.seekTimeout)){if(o.player.seekTimer>0){clearTimeout(o.player.seekTimer)}o.player.seekCallback=function(z){this.lastSeek="";this.seekTimer=0;o.isSeeking=true;this.seek(z)}.createDelegate(o.player,[w],false);o.player.seekTimer=setTimeout(o.player.seekCallback,config.seekTimeout)}o.player.lastSeek=u;x.preventDefault()};var q=function(u){o.player.isSeeking=false;if(o.player.seekTimer!=0){clearTimeout(o.player.seekTimer);o.player.seekCallback()}iVideojQuery(document).unbind("mousemove",r)};iVideojQuery(document).bind("mousemove",r).one("mouseup",q);t.preventDefault()});o.player.load()},_registerTick:function(){var f=iVideo.Viewer;if(f.tickTimer>0){return}f.tickTimer=setInterval(f._tick.createDelegate(f,[f,f.player.getClip()],false),config.tickInterval)},_unregisterTick:function(){var f=iVideo.Viewer;clearInterval(f.tickTimer);f.tickTimer=0},_onSeek:function(k,j){var i=iVideo.Viewer;var g=i.player.getStatus();if(b){console.log("onSeek: Seeking to "+j)}try{i.player.getPlugin("titleBar").hide()}catch(k){}if(i.hasActions){i.nextActionIndex=-1;i.nextActionMark=-1;for(var f=0;f<i.actionsRoll.length;f++){if(i.actionsRoll[f]>=j){if(b){console.log("onSeek: found next action "+(f)+" at time "+i.actionsRoll[f])}i.nextActionIndex=f;i.nextActionMark=i.actionsRoll[f];break}if(b&&i.nextActionIndex==-1){console.log("onSeek: cannot find next action")}}}if(i.hasChapters){i.player.nextChapterMark=-1;i.player.nextChapter=-1;for(var f=1;f<i.training.chapters.length;f++){if(i.training.chapters[f].time/1000>j){if(b){console.log("onSeek: current chapter is "+(f-1)+" at time "+(i.training.chapters[f-1].time/1000))}i.goToChapter(f-1,false,true);break}}}i.isSeeking=false;if(i.resetOnSeek){if(b){console.log("ResetOnSeek: Reseting view after media display...")}i.resetOnSeek=false;if(i.layout!=1){if(b){console.log("ResetOnSeek: have to change layout")}i._morph(1,function(){if(b){console.log("ResetOnSeek: layout changed")}})}else{if(i.media!=""){i.media.hide();i.media=""}}}},_tick:function(i,k,n){var f=i.player.getStatus();var l=parseInt(f.bufferEnd/i.training.fullLength*i.dims.trackW,10);i.player.bufferEl.style.width=l+"px";if((f.state==3&&!i.isSeeking)||n===true){var g=parseInt(f.time/i.training.fullLength*i.dims.trackW,10);i.player.progressEl.style.width=g+"px";i.player.headEl.style.left=(g-config.controlsHeadW/2)+"px";i.timeEl.html("<strong>"+i.getDottedTime(f.time,i.training.fullLength>=3600)+"</strong>"+i.getDottedTime(i.training.fullLength,i.training.fullLength>=3600));if(i.hasChapters&&i.player.nextChapterMark!=-1&&f.time>=i.player.nextChapterMark){if(b){console.log("tick: it's "+f.time+" so the chapter is "+i.player.nextChapter+" at time "+i.player.nextChapterMark)}i.goToChapter(i.player.nextChapter,false,true)}if(i.hasActions&&i.nextActionMark!=-1&&f.time>=i.nextActionMark){if(b){console.log("tick: it's "+f.time+" so we should execute action "+i.nextActionIndex+" at time "+i.nextActionMark)}i._action()}if(!i.training.isPreview&&((f.time%11)==0)&&f.time>30){if(f.time>i.training.fullLength-30){var j=new Date();j.setSeconds(j.getSeconds()+config.posSaveTime);Cookies.set("pos"+i.training.id,f.time,j)}else{Cookies.clear("pos"+i.training.id)}}}},_showLoader:function(g){var f=iVideo.Viewer;g=iVideojQuery(g);if(f.loaderEl!=""){var j=g.offset().left+f.loaderEl.width()/2;var i=g.offset().top+f.loaderEl.height()/2;f.loaderEl.css({top:j,left:i});return}f.loaderAnchor=g;f.loaderEl=iVideojQuery('<img src="'+config.loaderUrl+'"/>').load(function(){f.loaderEl.hide().appendTo("body");var l=g.offset().left+g.width()/2-f.loaderEl.width()/2;var k=g.offset().top+g.height()/2-f.loaderEl.height()/2;f.loaderEl.css({top:k,left:l,position:"absolute","z-index":9500,opacity:0});f.loaderEl.show().fadeTo("fast",1)})},_hideLoader:function(){var f=iVideo.Viewer;if(f.loaderEl==""){return}else{f.loaderEl.unbind().stop().queue([]).remove();f.loaderEl="";return}},criticalError:function(i,g){var f=iVideo.Viewer;if(f.player!=""){f.player.stop();f.player.unload();f.player=""}if(f.overlayEl){f.overlayEl.stop().clearQueue(true);f.hide()}alert(i?i:"Przepraszamy, ale wybrane szkolenie jest chwilowo niedostępne. Spróbuj za chwilę lub skontaktuj się z Obsługą Klienta na www.eMentor.pl.")},getDottedTime:(function(){tPad=function(f){return f<10?"0"+f:f};return function(i,f,g){i=parseInt(i)||0;h=0;m=0;s=0;ms=0;if(i>=3600){h=Math.floor(i/3600);m=Math.floor((i-h*3600)/60);s=Math.floor((i-h*3600-m*60)%60);ms=Math.round((i-((h*3600)+(m*60)+s))*10000)}else{if(i>=60){h=0;m=Math.floor(i/60);s=Math.floor((i-m*60)%60);ms=Math.round((i-((m*60)+s))*10000)}else{h=0;m=0;s=Math.floor(i);ms=Math.round((i-s)*10000)}}return(h>0||f?tPad(h)+":":"")+tPad(m)+":"+tPad(s)+(g?":"+ms:"")}})()}}();if(document.readyState&&typeof(document.readyState)=="string"&&document.readyState==="complete"){iVideo.Viewer.init()}else{if(window.iVideojQuery){window.iVideojQuery(iVideo.Viewer.init);var checkiVideoInit=function(){if(!window.iVideo.Viewer.isInit()){if((typeof(window.iVideojQuery)=="function")&&(typeof(window.iVideojQuery.prototype)=="object")&&(typeof(window.iVideojQuery.prototype.get)=="function")){window.iVideojQuery(iVideo.Viewer.init)}setTimeout(checkiVideoInit,500)}};setTimeout(checkiVideoInit,500)}else{throw"Cannot init iVideo Viewer - jQuery is required but has not been loaded."}}if(typeof(iVideo.media)!="object"){iVideo.media={}}iVideo.media.Media=function(b,c){if(b.id===undefined||b.id==""){b.id=(Math.round(Math.random()*100000))}var a=this;iVideojQuery.each(b,function(d,f){if(typeof a[d]!="function"){a[d]=f}});if(this.container!=""){this.container=iVideojQuery(b.container)}this.init(this)};iVideo.media.Media.prototype={canBeTransformed:false,container:"",isInit:false,isLoading:false,isLoaded:false,isPlaying:false,fitMode:1,onLoad:"",onInit:"",onLoadFail:"",onHide:"",onShow:"",onFinish:"",getEl:function(){return this.container},init:function(){},stop:function(){},show:function(){},hide:function(){},layout:function(){}};iVideo.media.Image=iVideojQuery.classExtend(iVideo.media.Media,{canBeTransformed:true,type:"Image",src:"",imgEl:"",width:0,height:0,fadeIn:true,scrollbars:false,zooming:false,fitMode:1,duration:-1,init:function(){if(!this.src||this.width==0||this.height==0){throw"Cannot use iVideo Image, because src or dimensions are invalid";return false}this.imgEl=new Image();if(this.scrollbars){this.container.css({overflow:"auto"})}else{this.container.css({overflow:"hidden"})}this.isInit=true;console.log("Init Image "+this.src);if(typeof(this.onInit)=="function"){this.onInit.call(this)}},show:function(){prop=typeof this.imgEl.naturalWidth=="undefined"?"width":"naturalWidth";this.isLoading=true;this.isLoaded=false;console.log("Loading image "+this.src);this.imgEl.src=this.src;var a=function(){if(!this.isLoading){return}this.isLoading=false;this.isLoaded=true;if(typeof(this.onLoad)=="function"){this.onLoad.call(this)}iVideojQuery(this.imgEl).hide();this.container.append(this.imgEl);this.layout();if(this.fadeIn!=0&&this.fadeIn!=""){iVideojQuery(this.imgEl).css({opacity:0}).show().fadeTo(this.fadeIn===true?"fast":this.fadeIn,1,function(){if(!this.scrollbars&&(iVideojQuery(this.imgEl).width()>this.container.width()||iVideojQuery(this.imgEl).height()>this.container.height())){this.container.scrollview()}if(typeof(this.onShow)=="function"){this.onShow.call(this)}}.createDelegate(this))}else{if(!this.scrollbars&&(iVideojQuery(this.imgEl).width()>this.container.width()||iVideojQuery(this.imgEl).height()>this.container.height())){this.container.scrollview()}iVideojQuery(this.imgEl).show();if(typeof(this.onShow)=="function"){this.onShow.call(this)}}};var b=function(){if(!this.isLoading){return}this.isLoading=false;this.isLoaded=false;if(typeof(this.onLoadFail)=="function"){this.onLoadFail.call(this)}};if(this.imgEl.complete||parseInt(this.imgEl[prop])>0){console.log("Image "+this.src+" is already in browser cache");if(this.imgEl[prop]){a.call(this)}else{console.log("Image "+this.src+" is reported as loaded, but it has no dimensions");b.call(this)}}else{this.imgEl.onload=function(){if(this.imgEl[prop]>0&&this.imgEl[prop]>0){a.call(this)}else{console.log("Image "+this.src+" has loaded, but it is not valid");console.dir(this.imgEl);b.call(this)}}.createDelegate(this);this.imgEl.onerror=b.createDelegate(this)}},hide:function(){this.imgEl="";this.container.html("");this.isLoading=false;this.isLoaded=false},layout:function(){if(this.container==""||this.imgEl==""){return false}if(this.fitMode==2){var d=this.width/this.height;var c=Math.min(this.width,this.container.width());var a=Math.floor(c/d);iVideojQuery(this.imgEl).css({width:c,height:a})}else{if(this.fitMode==3){var d=this.width/this.height;var f=0;var b=0;if(this.width>this.container.width()||this.height>this.container.height()){f=Math.min(this.container.width(),this.width);b=Math.floor(f/d);if(b>this.container.height()){b=this.container.height();f=Math.floor(this.container.height()*d)}}else{f=this.width;b=this.height}iVideojQuery(this.imgEl).css({width:f,height:b})}else{return true}}}});iVideo.media.Youtube=iVideojQuery.classExtend(iVideo.media.Media,{canBeTransformed:true,type:"Youtube",src:"",width:560,height:430,showControls:false,showInfo:true,volume:70,start:0,end:60,fitMode:1,youtubePlayerChromelessUrl:"http://www.youtube.com/apiplayer?enablejsapi=1",youtubePlayerUrl:"http://www.youtube.com/v/:VIDEOID&enablejsapi=1&egm=0&border=0&autoplay=1&rel=0&start=:START&showInfo=:SHOWINFO",tickInterval:500,onPause:"",onResume:"",el:"",embed:"",lastState:"",api:"",init:function(){if(!this.src){throw"Cannot use this media, because src or dimensions are invalid";return false}window.onYouTubePlayerReady=function(){window.onYouTubePlayerReady=undefined;this.api=document.getElementById("youtube"+this.id+"Embed");var a="youtubePlayer"+this.id+"eh";window[a]=this._onPlayerError.createDelegate(this);this.api.addEventListener("onError",a);this.isInit=true;if(typeof(this.onInit)=="function"){this.onInit.call(this)}}.createDelegate(this);setTimeout(function(){if(!this.isInit){if(typeof window.onYouTubePlayerReady!="undefined"){window.onYouTubePlayerReady=undefined}this._onPlayerError(-1)}}.createDelegate(this),10000);this.el=iVideojQuery('<div id="youtube'+this.id+'Container" style="width:100%;height:100%;"></div>').appendTo(this.container);this.embed=flashembed(this.el[0],{src:this.showControls?this.youtubePlayerUrl.replace(":VIDEOID",this.src).replace(":START",this.start).replace(":SHOWINFO",this.showInfo?"1":"0"):this.youtubePlayerChromelessUrl,id:"youtube"+this.id+"Embed",bgcolor:"#000000",onFail:this.onLoadFail})},_onPlayerError:function(b){if(b==-1){var a="YouTube video player could not be loaded"}else{if(b==100){var a="Video was not found or has been removed"}else{if(b==101||b==150){var a="Video can not be embedded"}else{var a="YouTube encountered unknown error"}}}this._unregisterTick();if(typeof this.onLoadFail=="function"){this.onLoadFail.call(this,b,a)}},_registerTick:function(){if(this.tickTimer>0){return}this.tickTimer=setInterval(this._tick.createDelegate(this),this.tickInterval)},_unregisterTick:function(){clearInterval(this.tickTimer)},_tick:function(){var b=this.api.getPlayerState();var a=this.lastState;this.lastState=b;if(b!=a){if(b==2&&typeof this.onPause=="function"){this.onPause.call(this)}else{if((b==1||b==3)&&a==2&&typeof this.onResume=="function"){this.onResume.call(this)}else{if((b==1||b==3||b==5)&&(a==-1||a=="")){if(typeof(this.onLoad)=="function"){this.onLoad.call(this)}}else{if(b==0){this._unregisterTick();if(typeof this.onFinish=="function"){this.onFinish.call(this)}}}}}}},show:function(){this.isLoading=true;this.isLoaded=false;this._registerTick();if(!this.showControls){this.api.loadVideoById(this.src,parseInt(this.start))}else{}this.api.setVolume(this.volume)},hide:function(){this._unregisterTick();if(this.api!=""&&this.api.stopVideo){this.api.stopVideo();this.api.clearVideo();iVideojQuery.deleteNode(this.el);this.api="";if(typeof this.onHide=="function"){this.onHide.call(this)}}},stop:function(){if(this.api!=""&&this.api.pauseVideo){this.api.pauseVideo();return true}},layout:function(){return;if(this.container==""||this.imgEl==""){return false}if(this.fitMode==2){var d=this.width/this.height;var c=Math.min(this.width,this.container.width());var a=Math.floor(c/d);iVideojQuery(this.imgEl).css({width:c,height:a})}else{if(this.fitMode==3){var d=this.width/this.height;var f=0;var b=0;if(this.width>this.container.width()||this.height>this.container.height()){f=Math.min(this.container.width(),this.width);b=Math.floor(f/d);if(b>this.container.height()){b=this.container.height();f=Math.floor(this.container.height()*d)}}else{f=this.width;b=this.height}iVideojQuery(this.imgEl).css({width:f,height:b})}else{return true}}}});iVideo.media.Snippet=iVideojQuery.classExtend(iVideo.media.Media,{canBeTransformed:true,type:"Snippet",src:"",html:"",width:0,height:0,className:"",background:"",fitMode:1,template:"",templateData:"",el:"",init:function(){if(this.src==""&&this.html==""&&this.template==""){throw"Cannot use this media";return false}if(this.id===undefined||this.id==""){this.id=(Math.round(Math.random()*100000))}if(this.html!=""||this.template!=""){this.el=iVideojQuery('<div class="iVideoMediaSnippet"></div>');if(this.className!=""){this.el.addClass(this.className)}if(this.html!=""){this.el.html(this.html)}else{this.html=this.template;iVideojQuery.each(this.templateData,function(a,b){this.html=this.html.replace(new RegExp("{"+a+"}","g"),b)}.createDelegate(this));this.el.html(this.html)}if(this.fitMode==1){this.container.css("overflow","auto")}else{if(this.fitMode==2){this.container.css("overflow","hidden")}else{if(this.fitMode==3){this.container.css("overflow","auto");this.el.css({width:"100%",height:"100%"})}else{if(this.fitMode==4){this.container.css("overflow","hidden");this.el.css({width:"100%",height:"100%"})}}}}}else{this.el=iVideojQuery('<iframe class="iVideoMediaSnippet" style="background: black" frameborder="0" marginheight="0" marginwidth="0"></iframe>');if(this.className!=""){this.el.addClass(this.className)}this.el.attr("src",this.src);this.el.css({width:this.container.innerWidth()+"px",height:this.container.innerHeight()+"px"})}if(this.background!=""){this.container.css("background",this.background)}this.isInit=true;if(typeof this.onInit=="function"){this.onInit.call(this)}},show:function(){this.isLoading=false;this.isLoaded=true;this.container.append(this.el);this.layout();if(typeof this.onLoad=="function"){this.onLoad.call(this)}if(typeof this.onShow=="function"){this.onShow.call(this)}},hide:function(){if(this.el!=""){iVideojQuery.deleteNode(this.el);this.el="";if(typeof this.onHide=="function"){this.onHide.call(this)}}},layout:function(){if(this.fitMode==1||this.fitMode==2){if(this.el.outerHeight()<this.container.outerHeight()){this.el.css({position:"relative",top:this.container.outerHeight()/2-this.el.outerHeight()/2})}if(this.el.outerWidth()<this.container.outerWidth()){this.el.css({position:"relative",left:this.container.outerWidth()/2-this.el.outerWidth()/2})}}if(this.src!=""){this.el.css({width:this.container.innerWidth()+"px",height:this.container.innerHeight()+"px"})}return}});iVideo.media.Mindomo=iVideojQuery.classExtend(iVideo.media.Snippet,{canBeTransformed:false,type:"Mindomo",fitMode:4,mapId:"",titleBar:false,statusBar:false,scrollBar:false,description:false,author:false,modified:false,views:false,rating:false,template:'<object 	codebase= "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"	classid	= "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"   width   = "100%"	height	= "100%">	<param name="movie" 	value="http://www.mindomo.com/MindomoViewer.swf" />	<param name="flashvars" value="mapId={mapId}&showTitleBar={titleBar}&showStatusBar={statusBar}&showScrollBar={scrollBar}&showDescription={description}&showAuthor={author}&showModified={modified}&showViews={views}&showRating={rating}&" />	<embed 		pluginspage	= "http://www.adobe.com/go/getflashplayer"		width	 	= "100%"		height   	= "100%"		src		 	= "http://www.mindomo.com/MindomoViewer.swf"		flashvars	= "mapId={mapId}&showTitleBar={titleBar}&showStatusBar={statusBar}&showScrollBar={scrollBar}&showDescription={description}&showAuthor={author}&showModified={modified}&showViews={views}&showRating={rating}&"		type	 	= "application/x-shockwave-flash">	</embed></object>',templateData:"",init:function(){this.templateData={mapId:this.mapId,titleBar:this.titleBar?1:0,statusBar:this.statusBar?1:0,scrollBar:this.scrollBar?1:0,description:this.description?1:0,author:this.author?1:0,modified:this.modified?1:0,views:this.views?1:0,rating:this.rating?1:0};return iVideo.media.Mindomo.superclass.init.call(this)}});iVideo.media.Link=iVideojQuery.classExtend(iVideo.media.Media,{canBeTransformed:true,type:"Link",label:"",url:"",target:"_blank",background:"",inPlayer:true,width:"",height:"",size:1,align:"b",margin:5,el:"",plugin:"",init:function(){var f=iVideo.Viewer;if(this.href==""){throw"Cannot use this media";return false}if(this.id===undefined||this.id==""){this.id=(Math.round(Math.random()*100000))}if(this.label==""){if(this.url.length>11&&this.url.substr(0,11)=="chapter://#"){var d=parseInt(this.url.substr(11));var a=false;if(d!=NaN&&d>=0&&(a=f.findChapter(d,false))!=false){this.label=a.name}else{this.label=this.url}}else{if(this.url.length>10&&this.url.substr(0,10)=="chapter://"){var c=parseInt(this.url.substr(10));var a=false;if(c!=NaN&&c>=0&&(a=f.findChapter(c,true))!=false){this.label=a.name}else{this.label=this.url}}else{this.label=this.url}}}if(this.inPlayer){var b=iVideo.Viewer.player;this.plugin=b.getPlugin("linkContent");this.plugin.setHtml('<p><a href="javascript:void()">'+this.label+"</a></p>");if(this.align=="b"){this.plugin.css({bottom:this.margin+"px",left:"50%"})}else{if(this.align=="t"){this.plugin.css({top:this.margin+"px",left:"50%"})}}this.plugin.onClickHandler=function(){if(this.url.length>11&&this.url.substr(0,10)=="chapter://#"){var j=parseInt(this.url.substr(11));var g=false;if(j!=NaN&&j>=0&&(g=f.findChapter(j,true))!=false){f.goToChapter(j,false)}}else{if(this.url.length>10&&this.url.substr(0,10)=="chapter://"){var i=parseInt(this.url.substr(10));var g=false;if(i!=NaN&&i>=0&&(g=f.findChapter(i,true))!=false){f.goToChapter(i,true)}}else{b.pause();window.open(this.url)}}return false}.createDelegate(this);if(this.background!=""){this.plugin.css({background:this.background})}if(this.width!=""){this.plugin.css({width:this.width})}if(this.height!=""){this.plugin.css({height:this.height})}if(this.size>0){this.plugin.css({height:27+(20*(this.size-1)*0.7),p:{fontSize:Math.round(14+(14*(this.size-1)*0.7))+"px"}})}console.log({height:27*this.size*0.7,fontSize:Math.round(14*this.size*0.7)+"px"})}this.isInit=true;if(typeof this.onInit=="function"){this.onInit.call(this)}},show:function(){this.isLoading=false;this.isLoaded=true;if(typeof this.onLoad=="function"){this.onLoad.call(this)}if(this.inPlayer){this.plugin.fadeIn(500,function(){if(typeof this.onShow=="function"){this.onShow.call(this)}}.createDelegate(this))}},hide:function(){if(this.plugin!=""){this.plugin.fadeOut(500,function(){if(typeof this.onHide=="function"){this.onHide.call(this)}}.createDelegate(this))}},layout:function(){return}});iVideo.media.Error=iVideojQuery.classExtend(iVideo.media.Snippet,{type:"Error",failedMedia:"",errNo:0,errMsg:"",background:"#ffcc00",init:function(){if(this.failedMedia.type=="Youtube"){this.html="Przepraszamy. Nie można było wyświetlić tego filmiku, ponieważ został on usunięty z YouTube"}this.className=this.className!=""?this.className+" iVideoMediaError":"iVideoMediaError";iVideo.media.Error.superclass.init.call(this)}});if(typeof(iVideo.action)!="object"){iVideo.action={}}iVideo.action.Action=function(b){var a=this;iVideojQuery.each(b,function(c,d){if(typeof a[c]!="function"){a[c]=d}});this.init(this)};iVideo.action.Action.prototype={id:"",time:"",timeStart:"",timeEnd:"",onInit:"",init:function(){},execute:function(){},abort:function(){},cleanup:function(){}};iVideo.action.Reset=iVideojQuery.classExtend(iVideo.action.Action,{type:"Reset",pause:false,execute:function(){var a=iVideo.Viewer;if(this.pause){a.player.pause()}if(a.media!=""){a.media.hide();a.media="";if(a.mediaEl!=""){a.mediaEl.html("")}}if(a.layout!=1){return a._morph(1,this.execute.createDelegate(this))}if(this.pause){a.player.play()}a.resetOnSeek=false;a.resetOnPlay=false;return iVideo.action.Reset.superclass.execute.call(this)}});iVideo.action.ShowMedia=iVideojQuery.classExtend(iVideo.action.Action,{type:"ShowMedia",mediaId:"",media:"",layout:-1,pause:false,waitForLoad:true,resumeAfterFinish:false,resetAfterFinish:false,init:function(){if(!this.mediaId&&!this.media){throw"Cannot use this action because required parameters are missing";return false}if(typeof(this.onInit)=="function"){this.onInit.call(this)}return true},execute:function(){var c=iVideo.Viewer;var a=this;if(this.layout==""||this.layout==1){this.layout=2}c.layoutData.mediaWidth=this.media.width;c.layoutData.mediaHeight=this.media.height;c.layoutData.mediaFitMode=this.fitMode;if(this.waitForLoad||this.pause){c.player.pause()}if(c.media!=""){c.media.hide();c.media="";if(c.mediaEl!=""){c.mediaEl.html("")}if(this.layout!=-1&&this.layout!=c.layout){return c._morph(this.layout,this.execute.createDelegate(this))}else{if(c.layout>1){return c._layout(c.layoutData,this.execute.createDelegate(this),true)}}}else{if(this.layout!=-1&&this.layout!=c.layout){return c._morph(this.layout,this.execute.createDelegate(this))}}if(c.mediaEl==""&&c.mediaFrameEl!=""){c.mediaEl=iVideojQuery(c.mediaFrameEl.append('<div class="iVideoMedia"></div>')[0].firstChild)}c._showLoader(c.mediaEl);this.media.container=c.mediaEl;c.media=new iVideo.media[this.media.type](this.media);var b=function(){c.media.fitMode=this.fitMode;if(this.pause&&!(parseInt(this.timeEnd)>0)&&this.resetAfterFinish){c.resetOnPlay=true;c.resetOnSeek=true}else{if(this.timeEnd>0){c.resetOnSeek=true}}c.media.onLoad=function(){c._hideLoader();if(this.waitForLoad&&!this.pause&&c.player.getState()==4){c.player.play()}}.createDelegate(this);c.media.onLoadFail=this._handleLoadError.createDelegate(this);c.media.onShow=function(){};if(this.resumeAfterFinish){c.media.onFinish=function(){c.resetOnPlay=false;c.resetOnSeek=false;if(this.resetAfterFinish){c._morph(1,c.player.play.createDelegate(c.player,[]))}else{c.player.play()}}.createDelegate(this)}else{if(this.resetAfterFinish){c.media.onFinish=function(){c._morph(1)}}}c.media.show()};if(!c.media.isInit){c.media.onInit=b.createDelegate(this)}else{b.call(this)}},_handleLoadError:function(c,b){var d=iVideo.Viewer;var a=this;d._hideLoader();d.media.hide();d.mediaEl.html("");d.media=new iVideo.media.Error({container:d.mediaEl,failedMedia:this.media,errNo:c,errMsg:b});d.media.show();if(this.waitForLoad||this.pause){setTimeout(function(){d.player.play()},5000)}}});iVideo.action.PauseAndShowMedia=iVideojQuery.classExtend(iVideo.action.ShowMedia,{type:"ShowMedia",execute:function(){iVideo.Viewer.player.pause();return iVideo.action.PauseAndShowMedia.superclass.execute.call(this)}});iVideo.action.PreviewEnd=iVideojQuery.classExtend(iVideo.action.ShowMedia,{type:"PreviewEnd",url:"",waitForLoad:false,resumeAfterFinish:false,resetAfterFinish:false,init:function(){this.media={type:"Snippet",src:this.url,width:900,height:700};return iVideo.action.PreviewEnd.superclass.init.call(this)}});
