// JavaScript Document
var masterColor="#bbb",secondaryColor="#cdcdcd",gridFlag=!0,flagGraph=!1,graphContainer=new createjs.Container;graphContainer.visible=flagGraph;var xSCALE=100,ySCALE=100,YG=202,XG=480,xMin=0,xMax=100,yMin=-30,yMax=120,Lpx=350,Hpx=300,xSCALE=Lpx/100,ySCALE=Hpx/150,pixelsLeft=-Lpx*xMin/(xMax-xMin),pixelsRight=Lpx*xMax/(xMax-xMin),pixelsUp=Hpx*yMax/(yMax-yMin),pixelsDown=-Hpx*yMin/(yMax-yMin),Xx=XG-Lpx/2+pixelsLeft,Yx=YG+Hpx/2-pixelsDown,xAxisLabel=xAxisTextShape(),yAxisLabel=yAxisTextShape(),xAxis=new createjs.Container;xAxis.set({x:Xx,y:Yx});var yAxis=new createjs.Container;yAxis.set({x:Xx,y:Yx});var graph=new createjs.Shape;graph.set({x:Xx,y:Yx});var point=makePoint("#ff0000","point1",2),shapeMask=new createjs.Shape;function drawAllAxis(){xAxis.xAxisCreate(-pixelsLeft/xSCALE,pixelsRight/xSCALE,8),yAxis.yAxisCreate(-pixelsDown/ySCALE,pixelsUp/ySCALE,8)}function drawGraph(s){var e=dt/4;graph.graphics.clear().ss(2).s("#ff0000").mt(0,-findθ(0)*ySCALE);for(var r=0;r<=s-e;r+=e){var a=findθ(160*r);graph.graphics.lt(r*xSCALE*5,-a*ySCALE)}a=findθ(160*s);point.set({x:Xx+s*xSCALE*5,y:Yx-a*ySCALE})}shapeMask.graphics.drawRect(Xx-3,Yx-Hpx,Lpx+6,2*Hpx),graph.mask=shapeMask,point.mask=shapeMask,createjs.Container.prototype.xAxisCreate=function(s,e,r){var a,i=xSCALE,t=Math.abs((e-s)/r).toExponential(1),x=t.indexOf("e"),r=Number(t.substr(0,x)),x=Number(t.substr(x+1));a=r<2?Number("1e"+x):r<5?Number("2e"+x):Number("5e"+x);var x=Math.trunc(s/a)*a,p=e,n=a<1?1:0;this.step=a;var l="#666";this.removeAllChildren();var h=new createjs.Shape;h.alpha=.8;var o=new createjs.Container;h.hitArea=new createjs.Shape,h.hitArea.graphics.f("#000").r(s*i,-10,Lpx+10,20),h.graphics.s(l).ss(1),h.graphics.ss(.5).s(secondaryColor);for(var c=a;c<=e;c+=a)for(var g=.2*a;g<a;g+=.2*a)c+g<e&&(gridFlag&&h.graphics.ss(.5).s(masterColor).mt((c+g)*i,-pixelsUp).lt((c+g)*i,pixelsDown),h.graphics.ss(1).s(l).mt((c+g)*i,0).lt((c+g)*i,3));for(c=a;s<=c;c-=a)for(g=.2*a;g<a;g+=.2*a)s<c-g&&(gridFlag&&h.graphics.ss(.5).s(masterColor).mt((c-g)*i,-pixelsUp).lt((c-g)*i,pixelsDown),h.graphics.ss(1).s(l).mt((c-g)*i,0).lt((c-g)*i,3));for(var d,c=x;c<=p;c+=a)0!=round(c,6)&&(gridFlag&&h.graphics.ss(1).s(masterColor).mt(c*i,-pixelsUp).lt(c*i,pixelsDown),h.graphics.ss(1).s(l).mt(c*i,0).lt(c*i,5)),0!=round(c,6)&&((d=new createjs.Text(c.toFixed(n),"9px Trebuchet MS","#333")).set({textAlign:"center"}),d.x=c*i,d.y=8,o.addChild(d));h.graphics.ss(1.5).s(l).mt(-pixelsLeft,0).lt(pixelsRight+10,0).f(l).dc(0,0,2),h.addArrow(l,e*i+10,0,0),xAxisLabel.x=Xx+pixelsRight+17,xAxisLabel.y=Yx,$("#xSpinner").spinner("option","step",a/5),this.addChild(h),this.addChild(o)},createjs.Container.prototype.yAxisCreate=function(s,e,r){var a,i=-ySCALE,t=Math.abs((e-s)/r).toExponential(1),x=t.indexOf("e"),r=Number(t.substr(0,x)),x=Number(t.substr(x+1));a=r<2?Number("1e"+x):r<5?Number("2e"+x):Number("5e"+x);var x=Math.trunc(s/a)*a,p=e,n=a<1?2:0;this.step=a;var l="#666";this.removeAllChildren();var h=new createjs.Shape;h.graphics.ss(1.5).s(l).mt(0,s*i).lt(0,e*i-10),h.alpha=.8;var o=new createjs.Container;h.graphics.ss(.5).s(secondaryColor);for(var c=a;c<=e;c+=a)for(var g=.2*a;g<a;g+=.2*a)c+g<e&&(gridFlag&&h.graphics.ss(.5).s(secondaryColor).mt(-pixelsLeft,(c+g)*i).lt(pixelsRight,(c+g)*i),h.graphics.ss(1).s(l).mt(-3,(c+g)*i).lt(0,(c+g)*i));for(c=a;s<=c;c-=a)if(s<=c)for(g=.2*a;g<a;g+=.2*a)s<c-g&&(gridFlag&&h.graphics.ss(.5).s(secondaryColor).mt(-pixelsLeft,(c-g)*i).lt(pixelsRight,(c-g)*i),h.graphics.ss(1).s(l).mt(-3,(c-g)*i).lt(0,(c-g)*i));for(c=x;c<=p;c+=a){0!=round(c,6)&&(gridFlag&&h.graphics.ss(1).s(masterColor).mt(-pixelsLeft,c*i).lt(pixelsRight,c*i),h.graphics.ss(1).s(l).mt(-5,c*i).lt(0,c*i));var d=new createjs.Text(c.toFixed(n),"9px Trebuchet MS","#333");d.set({textAlign:"right"}),d.y=c*i-4,d.x=-8,o.addChild(d)}h.addArrow(l,0,e*i-10,90),h.graphics.s(l).ss(1),h.hitArea=new createjs.Shape,h.hitArea.graphics.f("#000").r(-10,s*i,20,-Hpx),yAxisLabel.x=Xx,yAxisLabel.y=Yx-pixelsUp-18,$("#ySpinner").spinner("option","step",a/5),this.addChild(h),this.addChild(o)};