var ictinus=(function(){var D=navigator.userAgent.toLowerCase();var E=/msie/.test(D)&&!/opera/.test(D);function C(H,G){return H.nodeType==1&&H.className.indexOf(G)!=-1;}function F(){function G(L){var K;if(L.className.indexOf("ictinus-init")!=-1){if(L.nodeName=="IMG"&&L.previousSibling.nodeName=="CANVAS"){K=L.previousSibling;}else{if(L.getElementsByTagName("canvas").length){K=L.getElementsByTagName("canvas")[0];}}}if(!K){K=document.createElement("canvas");K.width=L.offsetWidth+1;K.height=L.offsetHeight+1;K.className="ictinus";if(L.tagName=="IMG"){L.parentNode.insertBefore(K,L);}else{L.appendChild(K);}L.className=(L.className?L.className+" ":"")+"ictinus-init";}return K.getContext("2d");}function J(K,L){K.beginPath();L.traverse(function(M){M.drawCanvas(K);});K.closePath();}function I(L,M){L.fillStyle="#ffcc00";L.lineWidth=1;L.strokeStyle="#00ff00";function O(P,R,Q){L.fillRect(P-Q/2,R-Q/2,Q,Q);}function K(S,R,Q,P){L.beginPath();L.moveTo(S,R);L.lineTo(Q,P);L.stroke();L.closePath();}var N=M.getPaths();L.beginPath();M.traverse(function(P){L.moveTo(P.x,P.y);O(P.x,P.y,6);if(P.typeOf("bezier")){K(P.x,P.y,P.cpx2,P.cpy2);K(P.prev().x,P.prev().y,P.cpx1,P.cpy1);O(P.cpx1,P.cpy1,2);O(P.cpx2,P.cpy2,2);L.moveTo(P.x,P.y);}});}function H(K,L){K.clearRect(0,0,K.canvas.width,K.canvas.height);K.canvas.width=Math.ceil(L.width()+L.paddingLeft+L.paddingRight+L.strokeWidth*2);K.canvas.height=Math.ceil(L.height()+L.paddingTop+L.paddingBottom+L.strokeWidth*2);K.save();K.translate(L.paddingLeft,L.paddingTop);}return{decorate:function(M,L){var K=G(M);H(K,L);K.save();J(K,L);K.clip();if(L.fillColor){K.rect(0,0,M.offsetWidth,M.offsetHeight);K.fillStyle=L.fillColor;K.fill();}K.translate(L.contentBox.x,L.contentBox.y);K.drawImage(M,0,0,M.offsetWidth,M.offsetHeight);K.restore();if(L.strokeWidth){K.save();var N=(L.strokeWidth%2)/2;K.translate(N,N);J(K,L);K.strokeStyle=L.strokeColor;K.lineWidth=L.strokeWidth;K.stroke();K.restore();}K.restore();},draw:function(M,L){var K=G(M);H(K,L);J(K,L);K.fillStyle=L.fillColor;K.fill();if(L.strokeWidth){K.strokeStyle=L.strokeColor;K.lineWidth=L.strokeWidth;K.stroke();}K.restore();}};}function B(){var L=10;var K=0;function J(M){var N=[];M.traverse(function(O){var P=O.clone();if(N.length){N[N.length-1].next(P);P.prev(N[N.length-1]);}P.walkOnCoords(function(Q){this[Q]=Math.round(this[Q]*L);});N.push(P);},M.getPaths());return N;}if(!document.namespaces["v"]){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var I=document.createStyleSheet();I.cssText="v\\:* {behavior:url(#default#VML);display:block;}";}function H(M){var N=[];M.traverse(function(O){N.push(O.drawVML());},J(M));N.push("x e");return N.join(" ");}function G(P){var M;if(P.className.indexOf("ictinus-init")!=-1){if(P.nodeName=="IMG"&&C(P.previousSibling,"ictinus")){M=P.previousSibling;}else{if(P.getElementsByTagName("div").length){var O=P.getElementsByTagName("div");for(var N=0;N<O.length;N++){if(C(O[N],"ictinus")){M=O[N];break;}}}}}if(!M){M=document.createElement("div");M.style.width=P.offsetWidth+"px";M.style.height=P.offsetHeight+"px";M.className="ictinus";if(P.tagName=="IMG"){P.parentNode.insertBefore(M,P);}else{P.appendChild(M);}P.className=(P.className?P.className+" ":"")+"ictinus-init";}return M;}return{decorate:function(N,M){var Q;this.draw(N,M);var P=M._cache.shape_elem;var O=Boolean(M._cache.fill_elem);if(O){Q=M._cache.fill_elem;}else{Q=document.createElement("v:fill");Q.type="tile";P.appendChild(Q);M._cache.fill_elem=Q;}Q.origin=((P.offsetLeft+K-M.paddingLeft)/N.offsetWidth)+" "+((P.offsetTop+K-M.paddingTop)/N.offsetHeight);Q.size=N.width+"px,"+N.height+"px";Q.src=N.src;},draw:function(S,O){var R;var N;var Q=Boolean(O._cache.shape_elem);if(Q){R=O._cache.shape_elem;}else{R=document.createElement("v:shape");N=G(S);O._cache.shape_elem=R;}if(!O.strokeWidth){R.stroked=false;}else{R.strokeweight=O.strokeWidth;R.strokecolor=O.strokeColor;}R.fillcolor=O.fillColor;var M=O.width()+O.paddingLeft+O.paddingRight;var P=O.height()+O.paddingTop+O.paddingBottom;R.style.width=M+"px";R.style.height=P+"px";R.coordorigin=(-O.paddingLeft*L)+" "+(-O.paddingTop*L);R.coordsize=(M*L+K)+" "+(P*L+K);R.path=H(O);if(!Q){N.appendChild(R);}}};}var A=E?B():F();return{decorate:function(H,G){A.decorate(H,G);},draw:function(H,G){A.draw(H,G);}};})();ictinus.drawItems=(function(){function E(K,M){var L=function(){};L.prototype=M.prototype;K.prototype=new L();K.prototype.constructor=K;K.baseConstructor=M;K.superClass=M.prototype;}function F(K){return Math.round(K*1000)/1000;}function J(N,K,O,M){K=(typeof (K)=="string")?K.split(","):K;O=(typeof (O)=="string")?O.split(","):O;for(var L=0;L<K.length;L++){M.call(N,K[L],"x");}for(var L=0;L<O.length;L++){M.call(N,O[L],"y");}}function H(M,L){if(M&&L){for(var K in L){M[K]=L[K];}}}var I={no_prev:"Этот элемент рисования не может быть первым в списке"};function D(K){throw new Error(I[K]);}function B(){this._next=null;this._prev=null;}B.prototype={toString:function(){return"";},getBounds:function(){return{minX:0,minY:0,maxX:0,maxY:0};
},next:function(K){if(arguments.length){this._next=K;}return this._next||null;},prev:function(K){if(arguments.length){this._prev=K;}return this._prev||null;},clone:function(){return new this.constructor();},typeOf:function(K){switch(K){case"move":return this.constructor==G;case"line":return this.constructor==C;case"bezier":return this.constructor==A;}return false;},walkOnCoords:function(){},drawCanvas:function(K){},drawVML:function(){return this.toString().toLowerCase();}};function G(K,L){G.baseConstructor.call(this);this.x=K;this.y=L;}E(G,B);H(G.prototype,{clone:function(){return new this.constructor(this.x,this.y);},walkOnCoords:function(K){J(this,"x","y",K);},drawCanvas:function(K){K.moveTo(this.x,this.y);}});G.prototype.toString=function(){return"M"+F(this.x)+","+F(this.y);};function C(K,L){C.baseConstructor.call(this);this.x=K;this.y=L;}E(C,G);H(C.prototype,{getBounds:function(){if(!this.prev()){D(I.no_prev);}return{minX:Math.min(this.prev().x,this.x),minY:Math.min(this.prev().y,this.y),maxX:Math.max(this.prev().x,this.x),maxY:Math.max(this.prev().y,this.y)};},drawCanvas:function(K){K.lineTo(this.x,this.y);}});C.prototype.toString=function(){return"L"+F(this.x)+","+F(this.y);};function A(K,Q,N,P,M,O,L){A.baseConstructor.call(this);this.x=K;this.y=Q;this.cpx1=N;this.cpy1=P;this.cpx2=M;this.cpy2=O;this.locked=L||false;}E(A,B);H(A.prototype,{clone:function(){return new this.constructor(this.x,this.y,this.cpx1,this.cpy1,this.cpx2,this.cpy2,this.locked);},walkOnCoords:function(K){J(this,"x,cpx1,cpx2","y,cpy1,cpy2",K);},getBounds:function(){function M(O,P){this.x=O;this.y=P;}var K=[];function L(P,O,S){var Q=O*O-4*P*S;if(P==0){K.push(-S/O);return ;}if(Q==0){K.push(-O/(2*P));}else{if(Q>0){var R=Math.sqrt(O*O-4*P*S);if((-O+R)/(2*P)<1&&(-O+R)/(2*P)>0){K.push((-O+R)/(2*P));}if((-O-R)/(2*P)<1&&(-O-R)/(2*P)>0){K.push((-O-R)/(2*P));}}}}function N(S,R,Q,P,O){return Math.pow(1-O,3)*S+3*O*Math.pow(1-O,2)*R+3*O*O*(1-O)*Q+O*O*O*P;}return function(){if(!this.prev()){D(I.no_prev);}var W=new M(this.prev().x,this.prev().y);var U=new M(this.cpx1,this.cpy1);var S=new M(this.cpx2,this.cpy2);var R=new M(this.x,this.y);K=[];K.push(0);K.push(1);L(-3*W.x+9*U.x-9*S.x+3*R.x,6*W.x-12*U.x+6*S.x,-3*W.x+3*U.x);L(-3*W.y+9*U.y-9*S.y+3*R.y,6*W.y-12*U.y+6*S.y,-3*W.y+3*U.y);var Q=-1,P=-1,V=1000,T=1000;for(var O=0;O<K.length;O++){var X;if(V>(X=N(W.x,U.x,S.x,R.x,K[O]))){V=X;}if(T>(X=N(W.y,U.y,S.y,R.y,K[O]))){T=X;}if(Q<(X=N(W.x,U.x,S.x,R.x,K[O]))){Q=X;}if(P<(X=N(W.y,U.y,S.y,R.y,K[O]))){P=X;}}return{minX:V,minY:T,maxX:Q,maxY:P};};}(),drawCanvas:function(K){K.bezierCurveTo(this.cpx1,this.cpy1,this.cpx2,this.cpy2,this.x,this.y);},drawVML:function(){return this.toString().toLowerCase().replace("o","c");}});A.prototype.toString=function(){return(this.locked?"O":"C")+F(this.cpx1)+","+F(this.cpy1)+","+F(this.cpx2)+","+F(this.cpy2)+","+F(this.x)+","+F(this.y);};return{Item:B,MoveTo:G,LineTo:C,BezierTo:A};})();ictinus.Shape=function(A){this._cache={};this._session={};if(typeof (A)=="string"){A=ictinus.Shape.pathData.parse(A);}this.paths=A||[];this.strokeWidth=1;this.strokeColor="#000000";this.fillColor="";this.scaleGrid={x1:0,x2:0,y1:0,y2:0};this.paddingLeft=0;this.paddingRight=0;this.paddingTop=0;this.paddingBottom=0;this.contentBox={x:0,y:0,width:0,height:0};this._scaleX=1;this._scaleY=1;};ictinus.Shape.calculateTangentPoint=function(F,E,I,G,D,C){var J=Math.atan2(E-C,F-D);var H=(J+Math.PI)%(Math.PI*2);var A=I-D;var K=G-C;var B=Math.sqrt(A*A+K*K);return{x:Math.cos(H)*B+D,y:Math.sin(H)*B+C};};ictinus.Shape.fromJSON=function(G){function F(H){return(H||"").replace(/^\s+|\s+$/g,"").replace(/\s+/," ").split(" ");}var B=new ictinus.Shape(G.paths);B.scaleX(G.scaleX);B.scaleY(G.scaleY);var E="strokeWidth,strokeColor,fillColor".split(",");for(var C=0;C<E.length;C++){if(G.hasOwnProperty(E[C])){B[E[C]]=G[E[C]];}}B.padding(G.padding);var D=F(G.scaleGrid);if(D.length==4){B.scaleGrid.x1=D[0];B.scaleGrid.x2=D[1];B.scaleGrid.y1=D[2];B.scaleGrid.y2=D[3];}var A=F(G.contentBox);if(A.length==4){B.contentBox.x=A[0];B.contentBox.y=A[1];B.contentBox.width=A[2];B.contentBox.height=A[3];}return B;};ictinus.Shape.prototype={fixTangents:function(E){if(!E){throw new Error("No paths specified");}var D,C,A,B;this.traverse(function(F){if(!F.prev()){D=F;}else{if(!F.next()){C=F;}}},this.paths);this.traverse(function(G,H){if(!G.prev()){A=G;}else{if(!G.next()){B=G;}}if(G.typeOf("bezier")&&G.locked&&G.prev().typeOf("bezier")){var I=G.prev();var F=ictinus.Shape.calculateTangentPoint(I.cpx2,I.cpy2,G.cpx1,G.cpy1,I.x,I.y);G.cpx1=F.x;G.cpy1=F.y;}},E);if(D.x==C.x&&D.y==C.y){B.x=A.x;B.y=A.y;}return E;},traverse:function(E,F,D){F=F||this.getPaths();if(D){var A=F.slice(0).sort(D);for(var C=0;C<A.length;C++){E(A[C],C);}}else{for(var C=0;C<F.length;C++){if(F[C] instanceof ictinus.drawItems.MoveTo){var G=F[C];var B=0;do{E(G,B++);}while(G=G.next());break;}}}},getPaths:function(){if(this._session.paths){return this.fixTangents(this._session.paths);}var K=[];var F={x:["x","cpx","cpx1","cpx2"],y:["y","cpy","cpy1","cpy2"]};
function D(P,N,M){for(var L=0;L<F[M].length;L++){var O=F[M][L];if(P.hasOwnProperty(O)){P[O]=N(P[O]);}}}var I=this.scaleX();var G=this.scaleY();var B=this.getBounds(true);var C=(B.maxX-B.minX)*(I-1);var E=(B.maxY-B.minY)*(G-1);var H={moveX:function(L){return L+C;},moveY:function(L){return L+E;},scaleX:function(L){return L*I;},scaleY:function(L){return L*G;}};if(!this.isEmptyGrid()){var A=this.scaleGrid;function J(L,O){var N,M;if(L<=A.x1){M=1;}else{if(L>=A.x2){M=3;}else{M=2;}}if(O<=A.y1){N=10;}else{if(O>=A.y2){N=30;}else{N=20;}}return N+M;}this.traverse(function(P){var Q=P.clone();if(K.length){Q.prev(K[K.length-1]);K[K.length-1].next(Q);}var L;for(var N=0;N<F.x.length;N++){var O=F.x[N],M=F.y[N];if(Q.hasOwnProperty(O)&&Q.hasOwnProperty(M)){switch(J(Q[O],Q[M])){case 12:Q[O]=H.scaleX(Q[O]);break;case 13:Q[O]=H.moveX(Q[O]);break;case 21:Q[M]=H.scaleY(Q[M]);break;case 22:Q[O]=H.scaleX(Q[O]);Q[M]=H.scaleY(Q[M]);break;case 23:Q[O]=H.moveX(Q[O]);Q[M]=H.scaleY(Q[M]);break;case 31:Q[M]=H.moveY(Q[M]);break;case 32:Q[O]=H.scaleX(Q[O]);Q[M]=H.moveY(Q[M]);break;case 33:Q[O]=H.moveX(Q[O]);Q[M]=H.moveY(Q[M]);break;}}}K.push(Q);},this.paths);}else{this.traverse(function(L){var M=L.clone();if(K.length){M.prev(K[K.length-1]);K[K.length-1].next(M);}D(M,H.scaleX,"x");D(M,H.scaleY,"y");K.push(M);},this.paths);}return this.fixTangents(K);},scaleX:function(A){if(arguments.length){this._scaleX=parseFloat(A,10);}return this._scaleX;},scaleY:function(A){if(arguments.length){this._scaleY=parseFloat(A,10);}return this._scaleY;},width:function(C){var B=this.getBounds(true);var A=B.maxX-B.minX;if(arguments.length){this.scaleX(parseFloat(C,10)/A);}return A*this.scaleX();},height:function(C){var B=this.getBounds(true);var A=B.maxY-B.minY;if(arguments.length){this.scaleY(parseFloat(C,10)/A);}return A*this.scaleY();},setScaleGrid:function(B,A,D,C){this.scaleGrid.x1=Math.min(B,A);this.scaleGrid.x2=Math.max(B,A);this.scaleGrid.y1=Math.min(D,C);this.scaleGrid.y2=Math.max(D,C);},isEmptyGrid:function(){var A=this.scaleGrid;return(!A.x1&&!A.x2&&!A.y1&&!A.y2);},draw:function(A,B){this._session.paths=B;ictinus.draw(A,this);delete this._session.paths;},decorate:function(A,B){this._session.paths=B;ictinus.decorate(A,this);delete this._session.paths;},padding:function(A){if(typeof (A)=="number"){this.paddingLeft=this.paddingRight=this.paddingTop=this.paddingBottom=A;}else{if(typeof (A)=="string"){A=A.split(/\s+/);var B=function(C){return parseInt(C,10);};switch(A.length){case 1:this.paddingLeft=this.paddingRight=this.paddingTop=this.paddingBottom=B(A[0]);break;case 2:this.paddingTop=this.paddingBottom=B(A[0]);this.paddingLeft=this.paddingRight=B(A[1]);break;case 3:this.paddingTop=B(A[0]);this.paddingLeft=this.paddingRight=B(A[1]);this.paddingBottom=B(A[2]);break;case 4:this.paddingTop=B(A[0]);this.paddingRight=B(A[1]);this.paddingBottom=B(A[2]);this.paddingLeft=B(A[3]);break;}}}},updateSizeBy:function(A){if(this.contentBox.width&&this.contentBox.height){this.scaleX(A.offsetWidth/this.contentBox.width);this.scaleY(A.offsetHeight/this.contentBox.height);}else{this.width(A.offsetWidth);this.height(A.offsetHeight);}},getBounds:function(B){var A={minX:0,minY:0,maxX:0,maxY:0};this.traverse(function(D){var C=D.getBounds();A.minX=Math.min(A.minX,C.minX);A.minY=Math.min(A.minY,C.minY);A.maxX=Math.max(A.maxX,C.maxX);A.maxY=Math.max(A.maxY,C.maxY);},(B)?this.paths:null);return A;},toJSON:function(){function D(){return Array.prototype.join.call(arguments," ");}var A={};var C="strokeWidth,strokeColor,fillColor".split(",");for(var B=0;B<C.length;B++){A[C[B]]=this[C[B]];}A.scaleX=this.scaleX();A.scaleY=this.scaleY();A.padding=D(this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft);A.contentBox=D(this.contentBox.x,this.contentBox.y,this.contentBox.width,this.contentBox.height);A.scaleGrid=D(this.scaleGrid.x1,this.scaleGrid.y1,this.scaleGrid.x2,this.scaleGrid.y2);var E=[];for(var B=0;B<this.paths.length;B++){E.push(this.paths[B].toString());}A.paths=E.join("");return A;}};ictinus.Shape.pathData=(function(){function A(D){return(D||"").replace(/^\s+|\s+$/g,"");}function B(D,E){this.x=D;this.y=E;}var C=(function(){var Q=0,O=0;var K;var H=[];var S=null;function G(U){if(S){S.next(U);}U.prev(S);H.push(U);S=U;}function R(X,V,Y){V=D(V,2);for(var W=0;W<V.length;W++){var U=V[W];if(X=="M"||Y==0){Q=U[0];O=U[1];}else{Q+=U[0];O+=U[1];}if(W==0){G(new ictinus.drawItems.MoveTo(Q,O));}else{G(new ictinus.drawItems.LineTo(Q,O));}}}function F(){}function E(X,V,Y){V=D(V,2);for(var W=0;W<V.length;W++){var U=V[W];switch(X){case"L":Q=U[0];O=U[1];break;case"l":Q+=U[0];O+=U[1];break;}G(new ictinus.drawItems.LineTo(Q,O));}}function M(X,V,Y){V=D(V,1);for(var W=0;W<V.length;W++){var U=V[W];switch(X){case"H":Q=U[0];break;case"h":Q+=U[0];break;case"V":O=U[0];break;case"v":O+=U[0];break;}G(new ictinus.drawItems.LineTo(Q,O));}}function N(Y,W,Z){W=D(W,6);for(var X=0;X<W.length;X++){var U=W[X];var V=(Y.toLowerCase()=="o");switch(Y){case"C":case"O":G(new ictinus.drawItems.BezierTo(U[4],U[5],U[0],U[1],U[2],U[3],V));
K=new B(U[2],U[3]);Q=U[4];O=U[5];break;case"c":case"o":G(new ictinus.drawItems.BezierTo(Q+U[4],O+U[5],Q+U[0],O+U[1],Q+U[2],O+U[3],V));K=new B(Q+U[2],O+U[3]);Q+=U[4];O+=U[5];break;}}}function T(Y,V,Z){V=D(V,4);for(var W=0;W<V.length;W++){var U=V[W];var X=ictinus.Shape.calculateTangentPoint(K.x,K.y,K.x,K.y,Q,O);switch(Y){case"S":G(new ictinus.drawItems.BezierTo(U[2],U[3],X.x,X.y,U[0],U[1],true));K=new B(U[0],U[1]);Q=U[2];O=U[3];break;case"s":G(new ictinus.drawItems.BezierTo(Q+U[2],O+U[3],X.x,X.y,Q+U[0],O+U[1],true));K=new B(Q+U[0],O+U[1]);Q+=U[2];O+=U[3];break;}}}function P(X,V,Y){throw new Error("Not implemented yet");V=D(V,4);for(var W=0;W<V.length;W++){var U=V[W];switch(X){case"Q":G(ictinus.draw_type.quadratic(U[2],U[3],U[0],U[1]));K=new B(U[0],U[1]);Q=U[2];O=U[3];break;case"q":G(ictinus.draw_type.quadratic(Q+U[2],O+U[3],Q+U[0],O+U[1]));K=new B(Q+U[0],O+U[1]);Q+=U[2];O+=U[3];break;}}}function I(Y,V,Z){throw new Error("Not implemented yet");V=D(V,2);for(var W=0;W<V.length;W++){var U=V[W];var X=L(K,new B(Q,O));switch(Y){case"T":G(ictinus.draw_type.bezier(U[0],U[1],X.x,X.y));Q=U[0];O=U[1];break;case"s":G(ictinus.draw_type.bezier(Q+U[0],O+U[1],X.x,X.y));Q+=U[2];O+=U[3];break;}K=X;}}function L(c,W){var V=Math.atan2(c.y-W.y,c.x-W.x);var U=(V+Math.PI)%(Math.PI*2);var Z=c.x-W.x;var Y=c.y-W.y;var X=Math.sqrt(Z*Z+Y*Y);return new B(Math.cos(U)*X+W.x,Math.sin(U)*X+W.y);}function D(W,a){if(typeof W!="string"){return W;}var Z=/(\-?\d+(?:\.\d+)?)/g;var Y,V=[];W=A(W);while((Y=Z.exec(W))){V.push(Y[1]);}for(var X=0;X<V.length;X++){V[X]=parseFloat(V[X],10);}var U=[];a=a||1;for(var X=0;X<V.length;X+=a){U.push(V.slice(X,X+a));}return U;}var J={m:R,z:F,l:E,h:M,v:M,c:N,o:N,s:T,q:P,t:I};return function(V){Q=O=0;S=K=null;H=[];for(var U=0;U<V.length;U++){var W=V[U];J[W.command.toLowerCase()](W.command,W.args,U);}return H;};})();return{parse:function(I){var K=A(I);K=K.replace(/\n|\r/g," ");var E=[],F=/([a-z])/ig,H=0,D,G=null;function J(M,L){E.push({command:M,args:A(L)});}while((D=F.exec(K))){if(G!==null){J(G,K.substring(H,F.lastIndex-G.length));}G=D[0];H=F.lastIndex;}J(G,K.substring(H));return C(E);}};})();