var root = this; src="https://unpkg.com/mathjs@10.4.3/lib/browser/math.js" var sliderAV = root.sliderAV; var sliderAQ = root.sliderAQ; var sliderBV = root.sliderBV; var sliderBQ = root.sliderBQ; var propSlider = root.propSlider; var disNormal = root.disNormal; var disBron = root.disBron; var disEmph = root.disEmph; var disPulEmbA = root.disPulEmb; var disPulEmbB = root.disPulEmbB; var disAsth = root.disAsth; var disIdPulFib = root.disIdPulFib; var disShunt = root.disShunt; var disArray = ["normal", "bron", "emph", "pulemba", "asth", "idpulfib", "shunt", "pulembb"]; var disButtArray = [disNormal, disBron, disEmph, disPulEmbA, disAsth, disIdPulFib, disShunt, disPulEmbB]; var disAVArray = [50, 50, 30, 50, 50, 50, 50, 25]; var disAQArray = [50, 50, 75, 50, 50, 50, 50, 100]; var disBVArray = [50, 5, 80, 50, 5, 0.5, 0, 50]; var disBQArray = [50, 50, 20, 5, 50, 50, 50, 5]; var disPropArray = [50, 80, 90, 80, 75, 70, 65, 80]; var disButtHide = root.disButtHide; var iButArray = [root.iProp, root.iVQ, root.iPAO2, root.iMidAlv, root.iPulEmbA, root.iSliders, root.iPulEmbB, root.iPartO2, root.iSaO2, root.iPaCO2 ]; var iTextPopupArray = [root.iTextPropPopup, root.iTextVQPopup, root.iTextiPAO2Popup, root.iTextiMidAlvPopup, root.iTextPulEmbAPopup, root.iTextSlidersPopup, root.iTextPulEmbBPopup, root.iTextiPartO2Popup, root.iTextiSaO2Popup, root.iTextiPaCO2Popup ]; var sPageURL = window.location.search.substring(1); var sPageURLbuttShowHide = window.location.search.substring(1,2); var sPageURLpastOne = window.location.search.substring(2); var disURLdelay = 1800; //in milliseconds var stepNumb = 10; //Number of desired snapping steps on the 0-100 scale var lightSnapMargin = 5; // controls how snappy the slider snapping is. It uses pixels for scale. 0 = no snapping. 3 = snapps if slider is within 3 units of the stepNumb var sliderStep = []; //array of 0-100 scale positions of snapping steps. array is made in init //proportional slider (5th slider) var stepNumbProp = 10; //Number of desired snapping steps on the 0-100 scale var lightSnapMarginProp = 10; // controls how snappy the slider snapping is. It uses pixels for scale. 0 = no snapping. 3 = snapps if slider is within 3 units of the stepNumb var sliderStepProp = []; //array of 0-100 scale positions of snapping steps. array is made in init var slidersMax = 100; var slidersMin = 0; sliderMaxProp = 100; sliderMinProp = 0; sliderAV.max = slidersMax; sliderAV.min = slidersMin; sliderAV.currentValue = 50; // starting position, in units of position, so 0 - 100 as they are set now. sliderAQ.max = slidersMax; sliderAQ.min = slidersMin; sliderAQ.currentValue = 50; // starting position, in units of position, so 0 - 100 as they are set now. sliderBV.max = slidersMax; sliderBV.min = slidersMin; sliderBV.currentValue = 50; // starting position, in units of position, so 0 - 100 as they are set now. sliderBQ.max = slidersMax; sliderBQ.min = slidersMin; sliderBQ.currentValue = 50; // starting position, in units of position, so 0 - 100 as they are set now. propSlider.max = slidersMax; propSlider.min = slidersMin; propSlider.currentValue = 50; // starting position, in units of position, so 0 - 100 as they are set now. var patientAge = 22; //used only to calculate the conversion of PAO2 into PaO2 var AQtimeScale = 1; var AVtimeScale = 1; var BQtimeScale = 1; var BVtimeScale = 1; var AQdefaultDurationOfAnisAtVQ1 = 2000; var AVdefaultDurationOfAnisAtVQ1 = 2000; var BQdefaultDurationOfAnisAtVQ1 = 2000; var BVdefaultDurationOfAnisAtVQ1 = 2000; var VQATextBox = this.VQATextBox; var PAO2ATextBox = this.PAO2ATextBox; var PartO2ATextBox = this.PartO2ATextBox; var SaO2ATextBox = this.SaO2ATextBox; var VQBTextBox = this.VQBTextBox; var PAO2BTextBox = this.PAO2BTextBox; var PartO2BTextBox = this.PartO2BTextBox; var SaO2BTextBox = this.SaO2BTextBox; var PACO2ATextBox = this.PACO2ATextBox; var PACO2BTextBox = this.PACO2BTextBox; var PartO2ComboTextBox = this.PartO2ComboTextBox; var SaO2ComboTextBox = this.SaO2ComboTextBox; var PartCO2ComboTextBox = this.PartCO2ComboTextBox; var meterA = this.meterA; var meterB = this.meterB; var sliderPosStepAV = []; //array of pixel positions of snapping steps array is made in init var sliderPosStepAQ = []; var sliderPosStepBV = []; var sliderPosStepBQ = []; var propSliderPosStep = []; var AV = 50; var AQ = 50; var VQA; var PAO2A; var PartO2A; var SaO2A; var PACO2A; var CaCO2A; var BV = 50; var BQ = 50; var VQB; var PAO2B; var PartO2B; var SaO2B; var PACO2B; var CaCO2B; var comboSaO2; var comboPartO2; var comboPartCO2; var comboCaCO2; var propUnitAforCombo = 50; //hide all active button color states for (var i = 0; i < disButtArray.length; i++) { disButtArray[i].active.visible = false; }//end for loop updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo); //fill the form with appropreate other numbers //change background color of the whole page document.body.style.backgroundColor = '#333333'; root.start = function() { //AV Section sliderAV.positionFromMouseY = function() { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; var posY = (this.stage.mouseY / this.stage.scaleY) - this.y; var stepSize = hitHeight / stepNumb; //Snapping for (var i = 0; i < sliderPosStepAV.length; i++) { if( posY > (sliderPosStepAV[i] - lightSnapMargin) && posY < (sliderPosStepAV[i] + lightSnapMargin) ){ // if we are near a snapping spot this.buttonAV.y = root.clamp(sliderPosStepAV[i], hitPosFromTop, hitHeight + hitPosFromTop); //snap to! i=99; } else { this.buttonAV.y = root.clamp(posY, hitPosFromTop, hitHeight + hitPosFromTop); //clamp the button position on to the teal hit bar //No snapping } //end else }//end for loop AV = ((this.buttonAV.y - hitPosFromTop) / hitHeight) * (this.min - this.max) + this.max; AV = AV.toFixed(); updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo); aniSpeedUpdateAV() }; //end sliderAV.positionFromMouseY sliderAV.mouseDownHandler = function(e) { this.stage.stageMouseMove = this.stage.on("stagemousemove", this.stage.stageMouseMoveHandlerAV); this.stage.stageMouseUp = this.stage.on("stagemouseup", endFollow.bind(this)); }; // end sliderAV.mouseDownHandler stage.stageMouseMoveHandlerAV = function(e) { sliderAV.positionFromMouseY(); }; // end stageMouseMoveHandler sliderAV.mouseDown = sliderAV.on("mousedown", sliderAV.mouseDownHandler); //AQ Section sliderAQ.positionFromMouseY = function() { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; var posY = (this.stage.mouseY / this.stage.scaleY) - this.y; var stepSize = hitHeight / stepNumb; //Snapping for (var i = 0; i < sliderPosStepAQ.length; i++) { if( posY > (sliderPosStepAQ[i] - lightSnapMargin) && posY < (sliderPosStepAQ[i] + lightSnapMargin) ){ // if we are near a snapping spot this.buttonAQ.y = root.clamp(sliderPosStepAQ[i], hitPosFromTop, hitHeight + hitPosFromTop); //snap to! i=99; } else { this.buttonAQ.y = root.clamp(posY, hitPosFromTop, hitHeight + hitPosFromTop); //clamp the button position on to the teal hit bar //No snapping } //end else }//end for loop AQ = ((this.buttonAQ.y - hitPosFromTop) / hitHeight) * (this.min - this.max) + this.max; AQ = AQ.toFixed(); updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo); aniSpeedUpdateAQ(); }; //end sliderAQ.positionFromMouseY sliderAQ.mouseDownHandler = function(e) { this.stage.stageMouseMove = this.stage.on("stagemousemove", this.stage.stageMouseMoveHandlerAQ); this.stage.stageMouseUp = this.stage.on("stagemouseup", endFollow.bind(this)); }; // end sliderAQ.mouseDownHandler stage.stageMouseMoveHandlerAQ = function(e) { sliderAQ.positionFromMouseY(); }; // end stageMouseMoveHandlerAQ sliderAQ.mouseDown = sliderAQ.on("mousedown", sliderAQ.mouseDownHandler); //BV Section sliderBV.positionFromMouseY = function() { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; var posY = (this.stage.mouseY / this.stage.scaleY) - this.y; var stepSize = hitHeight / stepNumb; //Snapping for (var i = 0; i < sliderPosStepBV.length; i++) { if( posY > (sliderPosStepBV[i] - lightSnapMargin) && posY < (sliderPosStepBV[i] + lightSnapMargin) ){ // if we are near a snapping spot this.buttonBV.y = root.clamp(sliderPosStepBV[i], hitPosFromTop, hitHeight + hitPosFromTop); //snap to! i=99; } else { this.buttonBV.y = root.clamp(posY, hitPosFromTop, hitHeight + hitPosFromTop); //clamp the button position on to the teal hit bar //No snapping } //end else }//end for loop BV = ((this.buttonBV.y - hitPosFromTop) / hitHeight) * (this.min - this.max) + this.max; BV = BV.toFixed(); updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo); aniSpeedUpdateBV(); }; //end sliderBV.positionFromMouseY sliderBV.mouseDownHandler = function(e) { this.stage.stageMouseMove = this.stage.on("stagemousemove", this.stage.stageMouseMoveHandlerBV); this.stage.stageMouseUp = this.stage.on("stagemouseup", endFollow.bind(this)); }; // end sliderBV.mouseDownHandler stage.stageMouseMoveHandlerBV = function(e) { sliderBV.positionFromMouseY(); }; // end stageMouseMoveHandler sliderBV.mouseDown = sliderBV.on("mousedown", sliderBV.mouseDownHandler); //BQ Section sliderBQ.positionFromMouseY = function() { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; var posY = (this.stage.mouseY / this.stage.scaleY) - this.y; var stepSize = hitHeight / stepNumb; //Snapping for (var i = 0; i < sliderPosStepBQ.length; i++) { if( posY > (sliderPosStepBQ[i] - lightSnapMargin) && posY < (sliderPosStepBQ[i] + lightSnapMargin) ){ // if we are near a snapping spot this.buttonBQ.y = root.clamp(sliderPosStepBQ[i], hitPosFromTop, hitHeight + hitPosFromTop); //snap to! i=99; } else { this.buttonBQ.y = root.clamp(posY, hitPosFromTop, hitHeight + hitPosFromTop); //clamp the button position on to the teal hit bar //No snapping } //end else }//end for loop BQ = ((this.buttonBQ.y - hitPosFromTop) / hitHeight) * (this.min - this.max) + this.max; BQ = BQ.toFixed(); updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo); aniSpeedUpdateBQ(); }; //end sliderBQ.positionFromMouseY sliderBQ.mouseDownHandler = function(e) { this.stage.stageMouseMove = this.stage.on("stagemousemove", this.stage.stageMouseMoveHandlerBQ); this.stage.stageMouseUp = this.stage.on("stagemouseup", endFollow.bind(this)); }; // end sliderBQ.mouseDownHandler stage.stageMouseMoveHandlerBQ = function(e) { sliderBQ.positionFromMouseY(); }; // end stageMouseMoveHandlerBQ sliderBQ.mouseDown = sliderBQ.on("mousedown", sliderBQ.mouseDownHandler); //Proportional Slider Section propSlider.positionFromMouseX = function() { var hitWidth = this.hit.nominalBounds.width; var hitPosFromEdge = this.hit.x; var posX = (this.stage.mouseX / this.stage.scaleX) - this.x; var stepSize = hitWidth / stepNumbProp; //Snapping for (var i = 0; i < propSliderPosStep.length; i++) { if( posX > (propSliderPosStep[i] - lightSnapMarginProp) && posX < (propSliderPosStep[i] + lightSnapMarginProp) ){ // if we are near a snapping spot this.buttonProp.x = root.clamp(propSliderPosStep[i], hitPosFromEdge, hitWidth + hitPosFromEdge); //snap to! i=99; } else { this.buttonProp.x = root.clamp(posX, hitPosFromEdge, hitWidth + hitPosFromEdge); //clamp the button position on to the teal hit bar //No snapping } //end else }//end for loop propUnitAforCombo = (this.max - this.min) - (((this.buttonProp.x - hitPosFromEdge) / hitWidth) * (this.min - this.max) + this.max); propUnitAforCombo = propUnitAforCombo.toFixed(); updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo); }; //end propSlider.positionFromMouseX propSlider.mouseDownHandler = function(e) { this.stage.stageMouseMove = this.stage.on("stagemousemove", this.stage.stageMouseMoveHandlerProp); this.stage.stageMouseUp = this.stage.on("stagemouseup", endFollow.bind(this)); }; // end sliderAV.mouseDownHandler stage.stageMouseMoveHandlerProp = function(e) { propSlider.positionFromMouseX(); propSlider.gotoAndStop(convertPropUnitAforComboToFrameNumb(propUnitAforCombo)); // set movie clip frame to match the porportion of unit A vs unit }; // end stageMouseMoveHandler propSlider.mouseDown = propSlider.on("mousedown", propSlider.mouseDownHandler); //Universal to all 4 sliders canvas.addEventListener("mouseout", endFollow.bind(this)); createjs.Touch.enable(stage); //This is required for it to work on a phone! stage.preventSelection = true; //to prevent the canvas from being selected (and getting an ugly selection highlight). Try disabling this functionality by using: myStage.preventSelection = false function endFollow() { this.stage.off("stagemousemove", this.stage.stageMouseMove); this.stage.off("stagemouseup", this.stage.stageMouseUp); }; }; //end root start function function isThisAListedDis() { for (var i = 0; i < disButtArray.length; i++) { if (AV == disAVArray[i] && AQ == disAQArray[i] && BV == disBVArray[i] && BQ == disBQArray[i] && propUnitAforCombo == disPropArray[i]) { disButtArray[i].active.visible = true; } else { disButtArray[i].active.visible = false; }//end match if/else }//end for loop } //end function isThisAListedDis function aniSpeedUpdateAV() { AVtimeScale = determineSpeed(AV); tweenO2A01.timeScale = AVtimeScale; tweenO2A02.timeScale = AVtimeScale; tweenO2A03.timeScale = AVtimeScale; tweenO2A04.timeScale = AVtimeScale; tweenO2A05.timeScale = AVtimeScale; tweenO2A06.timeScale = AVtimeScale; tweenO2A07.timeScale = AVtimeScale; tweenO2A08.timeScale = AVtimeScale; tweenO2A09.timeScale = AVtimeScale; tweenO2A10.timeScale = AVtimeScale; } function aniSpeedUpdateAQ() { AQtimeScale = determineSpeed(AQ); tweenA101.timeScale = AQtimeScale; tweenA201.timeScale = AQtimeScale; tweenA102.timeScale = AQtimeScale; tweenA202.timeScale = AQtimeScale; tweenA103.timeScale = AQtimeScale; tweenA203.timeScale = AQtimeScale; tweenA104.timeScale = AQtimeScale; tweenA204.timeScale = AQtimeScale; tweenA105.timeScale = AQtimeScale; tweenA205.timeScale = AQtimeScale; tweenA106.timeScale = AQtimeScale; tweenA206.timeScale = AQtimeScale; tweenA107.timeScale = AQtimeScale; tweenA207.timeScale = AQtimeScale; tweenA108.timeScale = AQtimeScale; tweenA208.timeScale = AQtimeScale; tweenA109.timeScale = AQtimeScale; tweenA209.timeScale = AQtimeScale; tweenA110.timeScale = AQtimeScale; tweenA210.timeScale = AQtimeScale; } function aniSpeedUpdateBV() { BVtimeScale = determineSpeed(BV); tweenO2B01.timeScale = BVtimeScale; tweenO2B02.timeScale = BVtimeScale; tweenO2B03.timeScale = BVtimeScale; tweenO2B04.timeScale = BVtimeScale; tweenO2B05.timeScale = BVtimeScale; tweenO2B06.timeScale = BVtimeScale; tweenO2B07.timeScale = BVtimeScale; tweenO2B08.timeScale = BVtimeScale; tweenO2B09.timeScale = BVtimeScale; tweenO2B10.timeScale = BVtimeScale; } function aniSpeedUpdateBQ() { BQtimeScale = determineSpeed(BQ); tweenB101.timeScale = BQtimeScale; tweenB201.timeScale = BQtimeScale; tweenB102.timeScale = BQtimeScale; tweenB202.timeScale = BQtimeScale; tweenB103.timeScale = BQtimeScale; tweenB203.timeScale = BQtimeScale; tweenB104.timeScale = BQtimeScale; tweenB204.timeScale = BQtimeScale; tweenB105.timeScale = BQtimeScale; tweenB205.timeScale = BQtimeScale; tweenB106.timeScale = BQtimeScale; tweenB206.timeScale = BQtimeScale; tweenB107.timeScale = BQtimeScale; tweenB207.timeScale = BQtimeScale; tweenB108.timeScale = BQtimeScale; tweenB208.timeScale = BQtimeScale; tweenB109.timeScale = BQtimeScale; tweenB209.timeScale = BQtimeScale; tweenB110.timeScale = BQtimeScale; tweenB210.timeScale = BQtimeScale; } root.clamp = function(value, max, min) { if (value < max) return max; if (value > min) return min; return value; } setTimeout(root.start, 0); //Dissease State buttons at bottom function variousDis(dis) { var n = disArray.indexOf(dis); if (n < 1) { console.log("dissease not found in list"); AV = 50; AQ = 50; BV = 50; BQ = 50; propUnitAforCombo = 50; updateSliders(); } AV = disAVArray[n]; AQ = disAQArray[n]; BV = disBVArray[n]; BQ = disBQArray[n]; propUnitAforCombo = disPropArray[n]; updateSliders(); } disNormal.mouseDownHandler = function(e) { variousDis("normal"); }; // end mouseDownHandler disNormal.mouseDown = disNormal.on("mousedown", disNormal.mouseDownHandler); disBron.mouseDownHandler = function(e) { variousDis("bron"); }; // end mouseDownHandler disBron.mouseDown = disBron.on("mousedown", disBron.mouseDownHandler); disEmph.mouseDownHandler = function(e) { variousDis("emph"); }; // end mouseDownHandler disEmph.mouseDown = disEmph.on("mousedown", disEmph.mouseDownHandler); disPulEmbA.mouseDownHandler = function(e) { variousDis("pulembA"); }; // end mouseDownHandler disPulEmbA.mouseDown = disPulEmbA.on("mousedown", disPulEmbA.mouseDownHandler); disAsth.mouseDownHandler = function(e) { variousDis("asth"); }; // end mouseDownHandler disAsth.mouseDown = disAsth.on("mousedown", disAsth.mouseDownHandler); disIdPulFib.mouseDownHandler = function(e) { variousDis("idpulfib"); }; // end mouseDownHandler disIdPulFib.mouseDown = disIdPulFib.on("mousedown", disIdPulFib.mouseDownHandler); disShunt.mouseDownHandler = function(e) { variousDis("shunt"); }; // end mouseDownHandler disShunt.mouseDown = disShunt.on("mousedown", disShunt.mouseDownHandler); disPulEmbB.mouseDownHandler = function(e) { variousDis("pulembB"); }; // end mouseDownHandler disPulEmbB.mouseDown = disPulEmbB.on("mousedown", disPulEmbB.mouseDownHandler); //(i) info buttons and their popups function showPopup(popup) { if (popup.currentFrame == 0 || popup.currentFrame == 1 || popup.currentFrame == 19){ //if the pop is currently NOT displayed popup.gotoAndPlay(1); //It will play from the start to frame ~10, which will show it poping up } else { //If it is already displayed, close it popup.gotoAndPlay(10); //will play from it's peak display at frame 10 to frame 20 where it's gone again } //end else } //end function iButArray[0].mouseDownHandler = function(e) { //Apparently, you can't put a mouse handler within a forloop. The i won't work. showPopup(iTextPopupArray[0]); }; // end mouseDownHandler iButArray[0].mouseDown = iButArray[0].on("mousedown", iButArray[0].mouseDownHandler); iTextPopupArray[0].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[0].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[0].iText.XClose.mouseDown = iTextPopupArray[0].iText.XClose.on("mousedown", iTextPopupArray[0].iText.XClose.mouseDownHandler); iButArray[1].mouseDownHandler = function(e) { showPopup(iTextPopupArray[1]); }; // end mouseDownHandler iButArray[1].mouseDown = iButArray[1].on("mousedown", iButArray[1].mouseDownHandler); iTextPopupArray[1].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[1].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[1].iText.XClose.mouseDown = iTextPopupArray[1].iText.XClose.on("mousedown", iTextPopupArray[1].iText.XClose.mouseDownHandler); iButArray[2].mouseDownHandler = function(e) { showPopup(iTextPopupArray[2]); }; // end mouseDownHandler iButArray[2].mouseDown = iButArray[2].on("mousedown", iButArray[2].mouseDownHandler); iTextPopupArray[2].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[2].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[2].iText.XClose.mouseDown = iTextPopupArray[2].iText.XClose.on("mousedown", iTextPopupArray[2].iText.XClose.mouseDownHandler); iButArray[3].mouseDownHandler = function(e) { showPopup(iTextPopupArray[3]); }; // end mouseDownHandler iButArray[3].mouseDown = iButArray[3].on("mousedown", iButArray[3].mouseDownHandler); iTextPopupArray[3].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[3].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[3].iText.XClose.mouseDown = iTextPopupArray[3].iText.XClose.on("mousedown", iTextPopupArray[3].iText.XClose.mouseDownHandler); iButArray[4].mouseDownHandler = function(e) { showPopup(iTextPopupArray[4]); }; // end mouseDownHandler iButArray[4].mouseDown = iButArray[4].on("mousedown", iButArray[4].mouseDownHandler); iTextPopupArray[4].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[4].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[4].iText.XClose.mouseDown = iTextPopupArray[4].iText.XClose.on("mousedown", iTextPopupArray[4].iText.XClose.mouseDownHandler); iButArray[5].mouseDownHandler = function(e) { showPopup(iTextPopupArray[5]); }; // end mouseDownHandler iButArray[5].mouseDown = iButArray[5].on("mousedown", iButArray[5].mouseDownHandler); iTextPopupArray[5].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[5].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[5].iText.XClose.mouseDown = iTextPopupArray[5].iText.XClose.on("mousedown", iTextPopupArray[5].iText.XClose.mouseDownHandler); iButArray[6].mouseDownHandler = function(e) { showPopup(iTextPopupArray[6]); }; // end mouseDownHandler iButArray[6].mouseDown = iButArray[6].on("mousedown", iButArray[6].mouseDownHandler); iTextPopupArray[6].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[6].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[6].iText.XClose.mouseDown = iTextPopupArray[6].iText.XClose.on("mousedown", iTextPopupArray[6].iText.XClose.mouseDownHandler); iButArray[7].mouseDownHandler = function(e) { showPopup(iTextPopupArray[7]); }; // end mouseDownHandler iButArray[7].mouseDown = iButArray[7].on("mousedown", iButArray[7].mouseDownHandler); iTextPopupArray[7].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[7].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[7].iText.XClose.mouseDown = iTextPopupArray[7].iText.XClose.on("mousedown", iTextPopupArray[7].iText.XClose.mouseDownHandler); iButArray[8].mouseDownHandler = function(e) { showPopup(iTextPopupArray[8]); }; // end mouseDownHandler iButArray[8].mouseDown = iButArray[8].on("mousedown", iButArray[8].mouseDownHandler); iTextPopupArray[8].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[8].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[8].iText.XClose.mouseDown = iTextPopupArray[8].iText.XClose.on("mousedown", iTextPopupArray[8].iText.XClose.mouseDownHandler); iButArray[9].mouseDownHandler = function(e) { showPopup(iTextPopupArray[9]); }; // end mouseDownHandler iButArray[9].mouseDown = iButArray[9].on("mousedown", iButArray[9].mouseDownHandler); iTextPopupArray[9].iText.XClose.mouseDownHandler = function(e) { //make sure the inner object of the popup is called iText iTextPopupArray[9].gotoAndPlay(10); }; // end mouseDownHandler iTextPopupArray[9].iText.XClose.mouseDown = iTextPopupArray[9].iText.XClose.on("mousedown", iTextPopupArray[9].iText.XClose.mouseDownHandler); function updateSliders() { sliderAV.moveToValueY(AV); sliderBV.moveToValueY(BV); sliderAQ.moveToValueY(AQ); sliderBQ.moveToValueY(BQ); propSlider.moveToValueX(propUnitAforCombo); updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo); isThisAListedDis(); } propSlider.moveToValueX = function(value) { var hitWidth = this.hit.nominalBounds.width; var hitPosFromEdge = this.hit.x; this.buttonProp.x = root.clamp((value/(sliderMaxProp-sliderMinProp))*hitWidth+hitPosFromEdge, hitPosFromEdge, hitWidth + hitPosFromEdge); } //end propSlider.moveToValueX sliderAV.moveToValueY = function(value) { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; this.buttonAV.y = root.clamp((((slidersMax-slidersMin)-value)/(slidersMax-slidersMin))*hitHeight+hitPosFromTop, hitPosFromTop, hitHeight + hitPosFromTop); aniSpeedUpdateAV(); }; //end sliderAV.moveToValueY sliderBV.moveToValueY = function(value) { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; this.buttonBV.y = root.clamp((((slidersMax-slidersMin)-value)/(slidersMax-slidersMin))*hitHeight+hitPosFromTop, hitPosFromTop, hitHeight + hitPosFromTop); aniSpeedUpdateBV(); }; //end sliderBV.moveToValueY sliderAQ.moveToValueY = function(value) { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; this.buttonAQ.y = root.clamp((((slidersMax-slidersMin)-value)/(slidersMax-slidersMin))*hitHeight+hitPosFromTop, hitPosFromTop, hitHeight + hitPosFromTop); aniSpeedUpdateAQ(); }; //end sliderAQ.moveToValueY sliderBQ.moveToValueY = function(value) { var hitHeight = this.hit.nominalBounds.height; var hitPosFromTop = this.hit.y; this.buttonBQ.y = root.clamp((((slidersMax-slidersMin)-value)/(slidersMax-slidersMin))*hitHeight+hitPosFromTop, hitPosFromTop, hitHeight + hitPosFromTop); aniSpeedUpdateBQ(); }; //end sliderAQ.moveToValueY function convertPropUnitAforComboToFrameNumb(prop) { //Used to select whcih frame of the 'meter' animation to show. It goes from frame zero to 101. var iniFrameNumb = (propSlider.max - propSlider.min) - prop; if (iniFrameNumb <= 0) { return 0; } else { if (iniFrameNumb > propSlider.totalFrames) { return propSlider.totalFrames; } else { return iniFrameNumb; } } } function determineSpeed(sliderValue) { if (sliderValue < 50) { return 0.02 * sliderValue; //Arbitrary EQ made by Kate to show speeds visible to human eye } else { if (sliderValue == 50) { return 1; } else { if (sliderValue > 50 && sliderValue < 97) { return (0.04 * sliderValue - 1); //arbitraty eq derived in excel that seems to result in a pleaseing slowdown } else { if (sliderValue >= 97) { return 3; } else { return "NA"; } } } } //end elses } //end function determineSpeed function VQtoHundred(VQ) { //Used to select whcih frame of the 'meter' animation to show. It has 100 frames. if (VQ <= 1) { return (49 * VQ) + 0.8333; } else { if (VQ < 55) { return 11.251 * Math.log(VQ) + 54.24; } else { return 100; } } } function convertVQtoPAO2(VQ) { if (VQ == "∞") { return 150; } else { return (17.5229 + 44.295 * VQ + 361.931 * Math.pow(VQ, 2)) / (0.437074 + 1.11927 * VQ + 2.4552 * Math.pow(VQ, 2)); //this equation is from Jason Torchinsky's email from February 8, 2022 } } function convertPAO2toPartO2(PAO2) { return PAO2 - ((patientAge + 10) / 4); //Chris's email March 25th 9:26 AM } function convertPartO2toSaO2(PartO2) { if (PartO2 == 150) { return 100; } else { var numerator = math.add(math.multiply(1955.0394699543847, PartO2), math.add(math.multiply(-213.2662843886982, math.pow(PartO2, 2)), math.add(math.multiply(41.54640092306389, math.pow(PartO2, 3)), math.pow(PartO2, 4)))); var denominator = math.add(-106448.2587420381, math.add(math.multiply(65913.51184300154, PartO2), math.add(math.multiply(-851.451203713157, math.pow(PartO2, 2)), math.add(math.multiply(45.05377099788284, math.pow(PartO2, 3)), math.pow(PartO2, 4))))); return math.divide(numerator, denominator); //this is an updated version of Jason's formula which they converted into javascript and also added more decimals to on april 14th. } } function convertVQtoPACO2(VQ) { if (VQ == "∞") { return 0; } else { var a0 = 76.2751; var a1 = 70.0209; var a2 = 33.6502; var a3 = -0.34346; var b0 = 1.77389; var b1 = 1.61767; var b2 = 1.33013; var b3 = 0.0772792; return ( (a0) + (a1 * VQ) + (a2 * math.pow(VQ, 2)) + (a3 * math.pow(VQ, 3)) ) / ( (b0) + (b1 * VQ) + (b2 * math.pow(VQ, 2)) + (b3 * math.pow(VQ, 3)) ); //From Jason's PDF "main3.pdf" equation 2.6.1 } } function convertPACO2toCaCO2(PACO2) { var a0 = 450.766; var a1 = -324.839; var b0 = 0.00447017; var b1 = -0.0455131; return (a0 * math.exp(b0*PACO2)) + (a1 * math.exp(b1*PACO2)); } function calculateCombinedSaO2(AQ, SaO2A, BQ, SaO2B, PropA) { if (AQ == 0 && BQ == 0) { return .988; } else { if (AQ == 0 && PropA == 100) { return .988; } else { if (BQ == 0 && (100-PropA) == 100) { return .988; } else { return ((AQ*PropA) * SaO2A + (BQ*(100-PropA)) * SaO2B) / ((AQ*PropA) + (BQ*(100-PropA))); // this equation is a modification from Chris Green's email from Thu, Feb 17, 3:54 PM. Kate added the PropA parts when the 5th slider was added } } } } function calculateCombinedPartO2(comboSaO2) { //Start new EQ from Jason var a0 = math.divide(math.subtract(10.38660023076597, math.multiply(11.26344274947071, comboSaO2)), math.subtract(comboSaO2, 1)); var b0 = math.divide(math.add(math.multiply(comboSaO2, math.subtract(math.multiply(1075.0947060911885, comboSaO2), 1645.7226752215443)), 573.7033803407896), math.pow(math.subtract(comboSaO2, 1), 2)); var c0 = math.multiply(3.940786557660247e-14, math.multiply(math.pow(math.pow(math.subtract(comboSaO2, 1), 3), 1./3.), math.subtract(math.multiply(math.subtract(3.6519627291763246e63, math.multiply(3.678206421048116e63, comboSaO2)), comboSaO2), 7.704925727224935e61))); var c1 = math.subtract(math.multiply(math.add(3.0493168812921595e140, math.multiply(math.subtract(math.multiply(6.139089782895964e141, comboSaO2), 6.396790839353522e141), comboSaO2)), comboSaO2), 1.1635911791364433e139); var c2 = math.add(2.0877433016741836e278, math.multiply(math.subtract(math.multiply(math.add(7.469118128223332e281, math.multiply(math.subtract(math.multiply(math.add(6.87738499223727e283, math.multiply(math.subtract(math.multiply(4.5671677653081645e283, comboSaO2), 1.0231982990880378e284), comboSaO2)), comboSaO2), 1.2853844024371706e283), comboSaO2)), comboSaO2), 1.7530444761963444e280), comboSaO2)); var b1 = math.divide(c0, math.multiply(math.pow(math.subtract(comboSaO2, 1), 2), math.pow(math.add(c1, math.pow(c2, 1./2.)), 1./3.))); var b2 = math.multiply(math.multiply(math.divide(1, math.pow(math.pow(math.subtract(comboSaO2, 1), 3), 1./3.)), 7.252577143003733e-45), math.pow(math.add(c1, math.pow(c2, 1./2.)), 1./3.)); var a1 = math.multiply(0.5, math.pow(math.add(b0, math.add(b1, b2)), 1./2.)); var b3 = math.divide(math.add(1147.4067606815793, math.multiply(math.subtract(math.multiply(2150.189412182377, comboSaO2), 3291.4453504430885), comboSaO2)), math.pow(math.subtract(comboSaO2, 1), 2)); var c3 = math.add(30698.87177532589, math.multiply(math.subtract(math.multiply(math.subtract(414157.8781909889, math.multiply(193051.12355792642, comboSaO2)), comboSaO2), 251816.41301363567), comboSaO2)); var b4 = math.divide(c3, math.multiply(2, math.multiply(math.pow(math.subtract(comboSaO2, 1), 3), a1))); var a2 = math.multiply(0.5, math.pow(math.add(math.subtract(math.subtract(b3, b1), b2), b4), 1./2.)); var tempComboPartO2 = math.re(math.add(a0, math.add(a1, a2))); //this beauty of an EQ was made my Jason L Torchinsky in Mathematica on April 10th, but then they translated it into javascript and math.JS on april 14th if (tempComboPartO2 < 150 && tempComboPartO2 > 0) { //right now, the equation goes higher than 150, and I think we want it to max out at 150 for physiological reasons return tempComboPartO2; } else { return 150; } } function calculateComboCaCO2(AQ, CaCO2A, BQ, CaCO2B, PropA) { if (AQ == 0 && BQ == 0) { return 125.927; } else { if (AQ == 0 && PropA == 100) { return 125.927; } else { if (BQ == 0 && (100-PropA) == 100) { return 125.927; } else { return ((AQ*PropA) * CaCO2A + (BQ*(100-PropA)) * CaCO2B) / ((AQ*PropA) + (BQ*(100-PropA))); // this equation is from Jason's PDF document #2.10.10, but also extrapolated to match the format of the calculateCombinedSaO2 eq in this document. } } } } //end function function calculatePartCO2Combo(comboCaCO2) { var d0first = math.add( math.bignumber('4.6939e+470'), math.multiply(-1, math.bignumber('1.9981e+468'), math.bignumber(comboCaCO2)), math.multiply( math.bignumber('3.6701e+465'), math.pow(math.bignumber(comboCaCO2),2)), math.multiply( -1, math.bignumber('4.0437e+462'), math.pow(math.bignumber(comboCaCO2),3) ) ); var d0secd = math.add( math.multiply(math.bignumber('2.6762e+459'), math.pow(math.bignumber(comboCaCO2),4)), math.multiply(-1, math.bignumber('4.1493e+455'), math.pow(math.bignumber(comboCaCO2),5) ), math.multiply(math.bignumber('5.7768e+451'), math.pow( math.bignumber(comboCaCO2),6)) ); var d0 = math.add( d0first, d0secd ); var c0 = math.cbrt( 1.99406 * math.pow(10,51) + 2.37391*math.pow(10,49)*comboCaCO2 + 9.42036*math.pow(10,46)*math.pow(comboCaCO2,2) + 1.24609*math.pow(10,44)*math.pow(comboCaCO2,3) ); var c1 = 1.25867 * math.pow(10,17) + 4.99478 * math.pow(10,14) * comboCaCO2; var c2 = math.cbrt( math.add( math.bignumber( -5.9963 * math.pow(10,232) + 1.1836 * math.pow(10,232) * comboCaCO2 - 3.1032 * math.pow(10,229) * math.pow(comboCaCO2,2) - 1.1522 * math.pow(10,225) * math.pow(comboCaCO2,3)), math.sqrt(d0) ) ); var b0 = ( -6.23596*math.pow(10,100) + 8.84235*math.pow(10,97)*comboCaCO2 + -3.07793*math.pow(10,94)*math.pow(comboCaCO2,2) ) * c0; var b1 = math.pow(c1, 2) * c2; var b2 = 8.02407 * math.pow(10,-57) * c2; var b3num = 2.25696 * math.pow(10,40) - 2.62944 * math.pow(10,37) * comboCaCO2 + 2.27933 * math.pow(10,34) * math.pow(comboCaCO2,2); var b3denom = math.pow( 1.25867 * math.pow(10,17) + 4.99478 * math.pow(10,14) * comboCaCO2, 2 ) var b3 = b3num / b3denom; var b4num = 4.51392 * math.pow(10,40) - 5.25887 * math.pow(10,37) * comboCaCO2 + 4.55866 * math.pow(10,34) * math.pow(comboCaCO2,2); var b4denom = b3denom; var b4 = b4num / b4denom; var b5 = 6.93781 * math.pow(10,60) - 1.07485 * math.pow(10,58) * comboCaCO2 + 1.50266 * math.pow(10,55) * math.pow(comboCaCO2,2) - 7.97666 * math.pow(10,51) * math.pow(comboCaCO2,3); var a0num = (-7.68214 * math.pow(10,19)) + (4.24789 * math.pow(10,16)) * comboCaCO2; var a0denom = (1.25867 * math.pow(10,17)) + (4.99478 * math.pow(10,14)) * comboCaCO2; var a0 = a0num / a0denom; var a1 = (1/2) * math.sqrt( b3 + (b0/b1) + (b2/c0) ); var a2 = (1/2) * math.sqrt( b4 - (b0/b1) - (b2/c0) + (b5/(2*math.pow(c1,3)*a1)) ); var comboPaCO2 = math.add(a0, math.multiply(-1, a1), a2); return comboPaCO2; } function updateTextBoxes(AV, AQ, BV, BQ, propUnitAforCombo) { //Unit A text Boxes VQA = calculateVQ(AV, AQ); VQATextBox.text = roundingVQ(VQA); meterA.gotoAndStop(VQtoHundred(VQA)); PAO2A = convertVQtoPAO2(VQA); PAO2ATextBox.text = Math.round(PAO2A) + " mmHG"; PartO2A = convertPAO2toPartO2(PAO2A); PartO2ATextBox.text = Math.round(PartO2A) + " mmHG"; SaO2A = convertPartO2toSaO2(PartO2A); SaO2ATextBox.text = (SaO2A*100).toFixed(1) + "%"; PACO2A = convertVQtoPACO2(VQA); PACO2ATextBox.text = Math.round(PACO2A) + " mmHG"; //new CaCO2A = convertPACO2toCaCO2(PACO2A); //Unit B text Boxes VQB = calculateVQ(BV, BQ); VQBTextBox.text = roundingVQ(VQB); meterB.gotoAndStop(VQtoHundred(VQB)); PAO2B = convertVQtoPAO2(VQB); PAO2BTextBox.text = Math.round(PAO2B) + " mmHG"; PartO2B = convertPAO2toPartO2(PAO2B); PartO2BTextBox.text = Math.round(PartO2B) + " mmHG"; SaO2B = convertPartO2toSaO2(PartO2B); SaO2BTextBox.text = (SaO2B*100).toFixed(1) + "%"; PACO2B = convertVQtoPACO2(VQB); PACO2BTextBox.text = Math.round(PACO2B) + " mmHG"; //new CaCO2B = convertPACO2toCaCO2(PACO2B); //Combo text Boxes comboSaO2 = calculateCombinedSaO2(AQ, SaO2A, BQ, SaO2B, propUnitAforCombo); SaO2ComboTextBox.text = (comboSaO2*100).toFixed(1) + "%"; comboPartO2 = calculateCombinedPartO2(comboSaO2); PartO2ComboTextBox.text = Math.round(comboPartO2) + " mmHG"; //new comboCaCO2 = calculateComboCaCO2(AQ, CaCO2A, BQ, CaCO2B, propUnitAforCombo); PartCO2Combo = calculatePartCO2Combo(comboCaCO2); PartCO2ComboTextBox.text = Math.round(PartCO2Combo) + " mmHG"; propSlider.gotoAndStop(convertPropUnitAforComboToFrameNumb(propUnitAforCombo)); // set movie clip frame to match the porportion of unit A vs unit B isThisAListedDis(); } function calculateVQ(V, Q) { if (Q == 0) { return "∞"; } else { return V / Q; } } //end function calculateVQ function roundingVQ(VQ) { if (VQ == "∞") { return "∞"; } else { if (VQ < 10) { return Number(VQ).toFixed(2); } else { return Number(VQ).toFixed(0); } } //end elses } //end function convertPostionToVQRatio var RBCPathA1 = []; var arrayOfPathDotsA1 = [this.PathDot02, this.PathDot02, this.PathDot03, this.PathDot04, this.PathDot05, this.PathDot06, this.PathDot07, this.PathDot08, this.PathDot09, this.PathDot10, this.PathDot11, this.PathDot12, this.PathDot13, this.PathDot14, this.PathDot15]; //Must be an odd number. Just cause. var RBCPathA2 = []; var arrayOfPathDotsA2 = [this.PathDotA201, this.PathDotA202, this.PathDotA203, this.PathDotA204, this.PathDotA205, this.PathDotA206, this.PathDotA207, this.PathDotA208, this.PathDotA209, this.PathDotA210, this.PathDotA211, this.PathDotA212, this.PathDotA213, this.PathDotA214, this.PathDotA215, this.PathDotA216, this.PathDotA217]; //Must be an odd number. Just cause. var O2PathA = []; var arrayOfO2PathA = [this.PathDotO2A01, this.PathDotO2A02, this.PathDotO2A03, this.PathDotO2A04, this.PathDotO2A05, this.PathDotO2A06, this.PathDotO2A07, this.PathDotO2A08, this.PathDotO2A09, this.PathDotO2A10, this.PathDotO2A11, this.PathDotO2A12, this.PathDotO2A13, this.PathDotO2A14, this.PathDotO2A15, this.PathDotO2A16, this.PathDotO2A17, this.PathDotO2A18, this.PathDotO2A19]; //Must be an odd number. Just cause. var RBCPathB1 = []; var arrayOfPathDotsB1 = [this.PathDotB101, this.PathDotB102, this.PathDotB103, this.PathDotB104, this.PathDotB105, this.PathDotB106, this.PathDotB107, this.PathDotB108, this.PathDotB109, this.PathDotB110, this.PathDotB111, this.PathDotB112, this.PathDotB113, this.PathDotB114, this.PathDotB115]; //Must be an odd number. Just cause. var RBCPathB2 = []; var arrayOfPathDotsB2 = [this.PathDotB201, this.PathDotB202, this.PathDotB203, this.PathDotB204, this.PathDotB205, this.PathDotB206, this.PathDotB207, this.PathDotB208, this.PathDotB209, this.PathDotB210, this.PathDotB211, this.PathDotB212, this.PathDotB213, this.PathDotB214, this.PathDotB215, this.PathDotB216, this.PathDotB217]; //Must be an odd number. Just cause. var O2PathB = []; var arrayOfO2PathB = [this.PathDotO2B01, this.PathDotO2B02, this.PathDotO2B03, this.PathDotO2B04, this.PathDotO2B05, this.PathDotO2B06, this.PathDotO2B07, this.PathDotO2B08, this.PathDotO2B09, this.PathDotO2B10, this.PathDotO2B11, this.PathDotO2B12, this.PathDotO2B13, this.PathDotO2B14, this.PathDotO2B15, this.PathDotO2B16, this.PathDotO2B17, this.PathDotO2B18, this.PathDotO2B19]; //Must be an odd number. Just cause. function init() { createjs.MotionGuidePlugin.install(createjs.Tween); //This is absolutely required for the RBCs to follow a path RBCPathA1.length = 0; for (var i = 0; i < arrayOfPathDotsA1.length; i++) { RBCPathA1.push( arrayOfPathDotsA1[i].x, arrayOfPathDotsA1[i].y ); } RBCPathA2.length = 0; for (var i = 0; i < arrayOfPathDotsA2.length; i++) { RBCPathA2.push( arrayOfPathDotsA2[i].x, arrayOfPathDotsA2[i].y ); } O2PathA.length = 0; for (var i = 0; i < arrayOfO2PathA.length; i++) { O2PathA.push( arrayOfO2PathA[i].x, arrayOfO2PathA[i].y ); } RBCPathB1.length = 0; for (var i = 0; i < arrayOfPathDotsB1.length; i++) { RBCPathB1.push( arrayOfPathDotsB1[i].x, arrayOfPathDotsB1[i].y ); } RBCPathB2.length = 0; for (var i = 0; i < arrayOfPathDotsB2.length; i++) { RBCPathB2.push( arrayOfPathDotsB2[i].x, arrayOfPathDotsB2[i].y ); } O2PathB.length = 0; for (var i = 0; i < arrayOfO2PathB.length; i++) { O2PathB.push( arrayOfO2PathB[i].x, arrayOfO2PathB[i].y ); } function makeArrayOfSnappingSteps() { //make an array of all the step locations on the 1-100 scale, ie 0,10,20, etc for (var i = 0; i <= stepNumb; i++) { sliderStep.push( ((slidersMax - slidersMin) / stepNumb) * i); } } //end makeArrayOfSnappingSteps function makeArrayOfSnappingSteps(); function makeArrayOfSnappingStepsProp() { //make an array of all the step locations on the 1-100 scale, ie 0,10,20, etc for (var i = 0; i <= stepNumbProp; i++) { sliderStepProp.push( ((sliderMaxProp - sliderMinProp) / stepNumbProp) * i); } } //end makeArrayOfSnappingSteps function makeArrayOfSnappingSteps(); function makeArrayOfSnappingPosAV() { //make an array of all the step locations on the 1-100 scale, ie 0,10,20, etc for (var i = 0; i <= stepNumb; i++) { sliderPosStepAV.push( (((sliderAV.max - sliderAV.min) - sliderStep[i])/ (sliderAV.max - sliderAV.min)) * sliderAV.hit.nominalBounds.height + sliderAV.hit.y); } //end for loop } //end makeArrayOfSnappingPos function makeArrayOfSnappingPosAV(); function makeArrayOfSnappingPosAQ() { //make an array of all the step locations on the 1-100 scale, ie 0,10,20, etc for (var i = 0; i <= stepNumb; i++) { sliderPosStepAQ.push( (((sliderAQ.max - sliderAQ.min) - sliderStep[i])/ (sliderAQ.max - sliderAQ.min)) * sliderAQ.hit.nominalBounds.height + sliderAQ.hit.y); } //end for loop } //end makeArrayOfSnappingPos function makeArrayOfSnappingPosAQ(); function makeArrayOfSnappingPosBV() { //make an array of all the step locations on the 1-100 scale, ie 0,10,20, etc for (var i = 0; i <= stepNumb; i++) { sliderPosStepBV.push( (((sliderBV.max - sliderBV.min) - sliderStep[i])/ (sliderBV.max - sliderBV.min)) * sliderBV.hit.nominalBounds.height + sliderBV.hit.y); } //end for loop } //end makeArrayOfSnappingPos function makeArrayOfSnappingPosBV(); function makeArrayOfSnappingPosBQ() { //make an array of all the step locations on the 1-100 scale, ie 0,10,20, etc for (var i = 0; i <= stepNumb; i++) { sliderPosStepBQ.push( (((sliderBQ.max - sliderBQ.min) - sliderStep[i])/ (sliderBQ.max - sliderBQ.min)) * sliderBQ.hit.nominalBounds.height + sliderBQ.hit.y); } //end for loop } //end makeArrayOfSnappingPos function makeArrayOfSnappingPosBQ(); function makeArrayOfSnappingPosProp() { //make an array of all the step locations on the 1-100 scale, ie 0,10,20, etc for (var i = 0; i <= stepNumb; i++) { propSliderPosStep.push( ((sliderStep[i])/ (propSlider.max - propSlider.min)) * propSlider.hit.nominalBounds.width + propSlider.hit.x); } //end for loop } //end makeArrayOfSnappingPos function makeArrayOfSnappingPosProp(); } //end func init init(); //run init //universal section var VlapTime = 200; var QlapTime = 200; var maxAirRotation = 0; //AQ section var RBCA101 = this.RBCA101; //instance name var RBCA201 = this.RBCA201; var RBCA102 = this.RBCA102; var RBCA202 = this.RBCA202; var RBCA103 = this.RBCA103; var RBCA203 = this.RBCA203; var RBCA104 = this.RBCA104; var RBCA204 = this.RBCA204; var RBCA105 = this.RBCA105; var RBCA205 = this.RBCA205; var RBCA106 = this.RBCA106; var RBCA206 = this.RBCA206; var RBCA107 = this.RBCA107; var RBCA207 = this.RBCA207; var RBCA108 = this.RBCA108; var RBCA208 = this.RBCA208; var RBCA109 = this.RBCA109; var RBCA209 = this.RBCA209; var RBCA110 = this.RBCA110; var RBCA210 = this.RBCA210; var tweenA101; var tweenA201; var tweenA102; var tweenA202; var tweenA103; var tweenA203; var tweenA104; var tweenA204; var tweenA105; var tweenA205; var tweenA106; var tweenA206; var tweenA107; var tweenA207; var tweenA108; var tweenA208; var tweenA109; var tweenA209; var tweenA110; var tweenA210; function animationTweenA101() { tweenA101 = createjs.Tween .get(RBCA101, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA201() { tweenA201 = createjs.Tween .get(RBCA201, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA102() { tweenA102 = createjs.Tween .get(RBCA102, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA202() { tweenA202 = createjs.Tween .get(RBCA202, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA103() { tweenA103 = createjs.Tween .get(RBCA103, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA203() { tweenA203 = createjs.Tween .get(RBCA203, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA104() { tweenA104 = createjs.Tween .get(RBCA104, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA204() { tweenA204 = createjs.Tween .get(RBCA204, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA105() { tweenA105 = createjs.Tween .get(RBCA105, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA205() { tweenA205 = createjs.Tween .get(RBCA205, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA106() { tweenA106 = createjs.Tween .get(RBCA106, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA206() { tweenA206 = createjs.Tween .get(RBCA206, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA107() { tweenA107 = createjs.Tween .get(RBCA107, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA207() { tweenA207 = createjs.Tween .get(RBCA207, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA108() { tweenA108 = createjs.Tween .get(RBCA108, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA208() { tweenA208 = createjs.Tween .get(RBCA208, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA109() { tweenA109 = createjs.Tween .get(RBCA109, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA209() { tweenA209 = createjs.Tween .get(RBCA209, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA110() { tweenA110 = createjs.Tween .get(RBCA110, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA1, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenA210() { tweenA210 = createjs.Tween .get(RBCA210, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathA2, orient: "auto" } }, AQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } var AQarray_of_animations = [ animationTweenA101, animationTweenA201, animationTweenA102, animationTweenA202, animationTweenA103, animationTweenA203, animationTweenA104, animationTweenA204, animationTweenA105, animationTweenA205, animationTweenA106, animationTweenA206, animationTweenA107, animationTweenA207, animationTweenA108, animationTweenA208, animationTweenA109, animationTweenA209, animationTweenA110, animationTweenA210, ] for (var i = 0; i < AQarray_of_animations.length; i += 2) { setTimeout(AQarray_of_animations[i], (i / 2) * QlapTime); setTimeout(AQarray_of_animations[i + 1], (i / 2) * QlapTime); } //BQ section var RBCB101 = this.RBCB101; //instance name var RBCB201 = this.RBCB201; var RBCB102 = this.RBCB102; var RBCB202 = this.RBCB202; var RBCB103 = this.RBCB103; var RBCB203 = this.RBCB203; var RBCB104 = this.RBCB104; var RBCB204 = this.RBCB204; var RBCB105 = this.RBCB105; var RBCB205 = this.RBCB205; var RBCB106 = this.RBCB106; var RBCB206 = this.RBCB206; var RBCB107 = this.RBCB107; var RBCB207 = this.RBCB207; var RBCB108 = this.RBCB108; var RBCB208 = this.RBCB208; var RBCB109 = this.RBCB109; var RBCB209 = this.RBCB209; var RBCB110 = this.RBCB110; var RBCB210 = this.RBCB210; var tweenBQ101; var tweenBQ201; var tweenBQ102; var tweenBQ202; var tweenBQ103; var tweenBQ203; var tweenBQ104; var tweenBQ204; var tweenBQ105; var tweenBQ205; var tweenBQ106; var tweenBQ206; var tweenBQ107; var tweenBQ207; var tweenBQ108; var tweenBQ208; var tweenBQ109; var tweenBQ209; var tweenBQ110; var tweenBQ210; function animationTweenB101() { tweenB101 = createjs.Tween .get(RBCB101, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB201() { tweenB201 = createjs.Tween .get(RBCB201, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB102() { tweenB102 = createjs.Tween .get(RBCB102, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB202() { tweenB202 = createjs.Tween .get(RBCB202, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB103() { tweenB103 = createjs.Tween .get(RBCB103, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB203() { tweenB203 = createjs.Tween .get(RBCB203, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB104() { tweenB104 = createjs.Tween .get(RBCB104, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB204() { tweenB204 = createjs.Tween .get(RBCB204, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB105() { tweenB105 = createjs.Tween .get(RBCB105, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB205() { tweenB205 = createjs.Tween .get(RBCB205, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB106() { tweenB106 = createjs.Tween .get(RBCB106, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB206() { tweenB206 = createjs.Tween .get(RBCB206, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB107() { tweenB107 = createjs.Tween .get(RBCB107, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB207() { tweenB207 = createjs.Tween .get(RBCB207, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB108() { tweenB108 = createjs.Tween .get(RBCB108, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB208() { tweenB208 = createjs.Tween .get(RBCB208, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB109() { tweenB109 = createjs.Tween .get(RBCB109, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB209() { tweenB209 = createjs.Tween .get(RBCB209, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB110() { tweenB110 = createjs.Tween .get(RBCB110, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB1, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenB210() { tweenB210 = createjs.Tween .get(RBCB210, { loop: true }) .to({ rotation: Math.random() * 360, guide: { path: RBCPathB2, orient: "auto" } }, BQdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } var BQarray_of_animations = [ animationTweenB101, animationTweenB201, animationTweenB102, animationTweenB202, animationTweenB103, animationTweenB203, animationTweenB104, animationTweenB204, animationTweenB105, animationTweenB205, animationTweenB106, animationTweenB206, animationTweenB107, animationTweenB207, animationTweenB108, animationTweenB208, animationTweenB109, animationTweenB209, animationTweenB110, animationTweenB210, ] for (var i = 0; i < BQarray_of_animations.length; i += 2) { setTimeout(BQarray_of_animations[i], (i / 2) * QlapTime); setTimeout(BQarray_of_animations[i + 1], (i / 2) * QlapTime); } //AV Section var O2A01 = this.O2A01; //instance name var O2A02 = this.O2A02; var O2A03 = this.O2A03; var O2A04 = this.O2A04; var O2A05 = this.O2A05; var O2A06 = this.O2A06; var O2A07 = this.O2A07; var O2A08 = this.O2A08; var O2A09 = this.O2A09; var O2A10 = this.O2A10; var tweenO2A01; var tweenO2A02; var tweenO2A03; var tweenO2A04; var tweenO2A05; var tweenO2A06; var tweenO2A07; var tweenO2A08; var tweenO2A09; var tweenO2A010; function animationTweenO2A01() { tweenO2A01 = createjs.Tween .get(O2A01, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A02() { tweenO2A02 = createjs.Tween .get(O2A02, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A03() { tweenO2A03 = createjs.Tween .get(O2A03, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A04() { tweenO2A04 = createjs.Tween .get(O2A04, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A05() { tweenO2A05 = createjs.Tween .get(O2A05, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A06() { tweenO2A06 = createjs.Tween .get(O2A06, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A07() { tweenO2A07 = createjs.Tween .get(O2A07, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A08() { tweenO2A08 = createjs.Tween .get(O2A08, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A09() { tweenO2A09 = createjs.Tween .get(O2A09, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2A10() { tweenO2A10 = createjs.Tween .get(O2A10, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathA, orient: "fixed" } }, AVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } var array_of_O2A_animations = [ animationTweenO2A01, animationTweenO2A02, animationTweenO2A03, animationTweenO2A04, animationTweenO2A05, animationTweenO2A06, animationTweenO2A07, animationTweenO2A08, animationTweenO2A09, animationTweenO2A10 ] for (var i = 0; i < array_of_O2A_animations.length; i += 1) { setTimeout(array_of_O2A_animations[i], (i) * VlapTime); } //BV Section var O2B01 = this.O2B01; //instance name var O2B02 = this.O2B02; var O2B03 = this.O2B03; var O2B04 = this.O2B04; var O2B05 = this.O2B05; var O2B06 = this.O2B06; var O2B07 = this.O2B07; var O2B08 = this.O2B08; var O2B09 = this.O2B09; var O2B10 = this.O2B10; var tweenO2B01; var tweenO2B02; var tweenO2B03; var tweenO2B04; var tweenO2B05; var tweenO2B06; var tweenO2B07; var tweenO2B08; var tweenO2B09; var tweenO2B010; function animationTweenO2B01() { tweenO2B01 = createjs.Tween .get(O2B01, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B02() { tweenO2B02 = createjs.Tween .get(O2B02, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B03() { tweenO2B03 = createjs.Tween .get(O2B03, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B04() { tweenO2B04 = createjs.Tween .get(O2B04, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B05() { tweenO2B05 = createjs.Tween .get(O2B05, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B06() { tweenO2B06 = createjs.Tween .get(O2B06, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B07() { tweenO2B07 = createjs.Tween .get(O2B07, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B08() { tweenO2B08 = createjs.Tween .get(O2B08, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B09() { tweenO2B09 = createjs.Tween .get(O2B09, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } function animationTweenO2B10() { tweenO2B10 = createjs.Tween .get(O2B10, { loop: true }) .to({ rotation: Math.random() * maxAirRotation, guide: { path: O2PathB, orient: "fixed" } }, BVdefaultDurationOfAnisAtVQ1) //the last number is the base speed at v/Q = 1, aka p1 = 50 } var array_of_O2B_animations = [ animationTweenO2B01, animationTweenO2B02, animationTweenO2B03, animationTweenO2B04, animationTweenO2B05, animationTweenO2B06, animationTweenO2B07, animationTweenO2B08, animationTweenO2B09, animationTweenO2B10 ] for (var i = 0; i < array_of_O2B_animations.length; i += 1) { setTimeout(array_of_O2B_animations[i], (i) * VlapTime); } //You can hide the buttons with the URL if you put a "0" after the ? if (sPageURLbuttShowHide === "0") { disButtHide.gotoAndStop(disButtHide.totalFrames - 1); //There are 10 frames, but in here they are numbered starting with zero } //Check for dissease states being pased via url setTimeout(function() { for (var i = 0; i < disArray.length; i++) { var dis = disArray[i]; if(sPageURL.toLowerCase() == dis || sPageURLpastOne.toLowerCase() == dis) { //has a dissease state been passed in the URL variousDis(disArray[i]); }//end if }//end for loop }, disURLdelay);