// Action script... // [Action in Frame 1] function helpPanel(textTitle, textDesc, picIcon) { textTitle = textTitle != undefined ? (textTitle) : ("Help"); textDesc = textDesc != undefined ? (textDesc) : ("There is currently no help data for this item."); mcHelpPanel.mcTitle.txtTitle.autoSize = "left"; mcHelpPanel.mcTitle.txtTitle.multiline = false; mcHelpPanel.mcTitle.txtTitle.text = textTitle; mcHelpPanel.mcDescription.txtDescription.autoSize = "left"; mcHelpPanel.mcDescription.txtDescription.text = textDesc; mcHelpPanel.btnOK._y = mcHelpPanel.mcDescription._height + 66; mcHelpPanel.mcBase._height = mcHelpPanel.mcDescription._height + 126; var _loc4 = Stage.width / 2 + 59; var _loc2 = Stage.height / 2 - mcHelpPanel._height / 2 - 10; loadIcon(mcHelpPanel, picIcon); var _loc5 = new mx.transitions.Tween(mcHelpPanel, "_x", mx.transitions.easing.Regular.easeInOut, _xmouse, _loc4, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcHelpPanel, "_y", mx.transitions.easing.Regular.easeInOut, _ymouse, _loc2, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcHelpPanel, "_xscale", mx.transitions.easing.Regular.easeOut, 0, 100, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcHelpPanel, "_yscale", mx.transitions.easing.Regular.easeOut, 0, 100, tweenSpeed, false); blurTweener(mcMain, "in"); blurTweener(mcStepButtons, "in"); blurTweener(mcSideBar, "in"); blurTweener(mcMainTitle, "in"); blurTweener(mcTitles, "in"); trace (mcMain); _loc5 = new mx.transitions.Tween(btnHidden, "_alpha", mx.transitions.easing.Regular.easeOut, btnHidden._alpha, 60, tweenSpeed, false); btnHidden.onRelease = mcHelpPanel.btnOK.onRelease = function () { blurTweener(mcMain, "out"); blurTweener(mcStepButtons, "out"); blurTweener(mcSideBar, "out"); blurTweener(mcMainTitle, "out"); blurTweener(mcTitles, "out"); delete btnHidden.onRelease; var _loc1 = new mx.transitions.Tween(btnHidden, "_alpha", mx.transitions.easing.Regular.easeOut, btnHidden._alpha, 0, tweenSpeed, false); _loc1 = new mx.transitions.Tween(mcHelpPanel, "_y", mx.transitions.easing.Regular.easeInOut, mcHelpPanel._y, -mcHelpPanel._height, tweenSpeed, false); }; btnHidden.useHandCursor = false; } // End of the function function loadIcon(whatClip, iconUrl) { whichClip._parent.mcLoader._visible = true; var _loc1 = new classes.loader(iconUrl, whatClip.mcPlaceholder, {_alpha: 100}, fadeIcon, whatClip); } // End of the function function fadeIcon(whichClip) { mx.transitions.TransitionManager.start(whichClip, {type: mx.transitions.Iris, direction: 0, duration: 1, easing: mx.transitions.easing.Strong.easeInOut, startPoint: 5, shape: "CIRCLE"}); whichClip._parent.mcLoader._visible = false; } // End of the function function loadMiniIcon(whatClip, iconUrl) { var _loc3 = new mx.transitions.Tween(whatClip.mcLoader, "_alpha", mx.transitions.easing.Strong.easeOut, whatClip.mcLoader._alpha, 100, tweenSpeed, false); var _loc2 = new classes.loader(iconUrl, whatClip.mcPlaceholder, {_alpha: 100}, fadeMiniIcon, whatClip); } // End of the function function fadeMiniIcon(whichClip) { mx.transitions.TransitionManager.start(whichClip, {type: mx.transitions.Iris, direction: 0, duration: 1, easing: mx.transitions.easing.Strong.easeInOut, startPoint: 5, shape: "CIRCLE"}); whichClip._xscale = whichClip._yscale = 50; tweenClip = new mx.transitions.Tween(whichClip._parent.mcLoader, "_alpha", mx.transitions.easing.Strong.easeOut, whichClip._parent.mcLoader._alpha, 0, tweenSpeed, false); } // End of the function function loadLargeSeat(whatClip, iconUrl) { whichClip._parent.mcLoader._visible = true; var _loc1 = new classes.loader(iconUrl, whatClip.mcPlaceholder, {_alpha: 100}, fadeLargeSeat, whatClip); } // End of the function function fadeLargeSeat(whichClip) { mx.transitions.TransitionManager.start(whichClip, {type: mx.transitions.Fade, direction: 0, duration: 1, easing: mx.transitions.easing.Strong.easeInOut, startPoint: 5, shape: "CIRCLE"}); whichClip._parent.mcLoader._visible = false; } // End of the function function blurTweener(whichClip, blurDirection) { if (blurDirection == "in") { var blurFilter = new flash.filters.BlurFilter(minBlur, minBlur, 3); var _loc1 = maxBlur; } else { var blurFilter = new flash.filters.BlurFilter(maxBlur, maxBlur, 3); _loc1 = minBlur; } // end else if blurTween = new mx.transitions.Tween(blurFilter, "blurX", mx.transitions.easing.Strong.easeOut, blurFilter.blurX, _loc1, blurLong, false); blurTween.onMotionChanged = function () { blurFilter.blurY = blurFilter.blurX; whichClip.filters = new Array(blurFilter); }; } // End of the function function setStep(changeToStep) { var _loc3 = new mx.transitions.TweenRGB(this.mcStepButtons["btnStep" + curStep], "", mx.transitions.easing.Regular.easeOut, 14882870, 8355970, tweenSpeed, false); curStep = changeToStep; for (var _loc2 = 1; _loc2 < 6; ++_loc2) { this.mcStepButtons["btnStep" + _loc2].thisID = _loc2; this.mcStepButtons["btnStep" + _loc2].useHandCursor = true; this.mcStepButtons["btnStep" + _loc2].onRelease = function () { if (curStep != this.thisID) { gotoAndPlay("step" + this.thisID); } // end if }; this.mcStepButtons["btnStep" + _loc2].onRollOver = function () { if (curStep != this.thisID) { var _loc2 = new mx.transitions.TweenRGB(this, "", mx.transitions.easing.Regular.easeOut, 8355970, 0, tweenSpeed, false); } // end if }; this.mcStepButtons["btnStep" + _loc2].onRollOut = this.mcStepButtons["btnStep" + _loc2].onDragOut = function () { if (curStep != this.thisID) { var _loc2 = new mx.transitions.TweenRGB(this, "", mx.transitions.easing.Regular.easeOut, 0, 8355970, tweenSpeed, false); } // end if }; } // end of for _loc3 = new mx.transitions.TweenRGB(this.mcStepButtons["btnStep" + curStep], "", mx.transitions.easing.Regular.easeOut, 0, 14882870, tweenSpeed, false); this.mcStepButtons["btnStep" + curStep].useHandCursor = false; mcTitles.gotoAndPlay("step" + curStep); Mouse.removeListener(mouseListener); } // End of the function function showOptionalSteps() { var _loc2 = new mx.transitions.Tween(this.mcStepButtons, "_x", mx.transitions.easing.Strong.easeInOut, this.mcStepButtons._x, 574, tweenSpeed, false); } // End of the function function hideOptionalSteps() { var _loc2 = new mx.transitions.Tween(this.mcStepButtons, "_x", mx.transitions.easing.Strong.easeInOut, this.mcStepButtons._x, 714, tweenSpeed, false); } // End of the function function initSideBar() { mcSideBar.btnResults._visible = false; mcSideBar.btnRestart._visible = false; mcSideBar.btnHelpKidInfo.enabled = false; mcSideBar.btnRestart.onRelease = function () { objectChild.childAge = 0; objectChild.childMinAge = 0; objectChild.childMaxAge = 0; objectChild.childWeight = 0; objectChild.childMinWeight = 0; objectChild.childMaxWeight = 0; objectChild.childHeight = 0; objectChild.childMinHeight = 0; objectChild.childMaxHeight = 0; objectChild.currentGroup = 0; arrayFeatures = []; objectChild.seatFeatures = arrayFeatures; mcMain.comboWeight.txtTitle.text = "Choose..."; mcMain.comboAge.txtTitle.text = "Choose..."; mcMain.comboHeight.txtTitle.text = "Choose..."; gotoAndPlay("step1"); clearUserData(); }; mcSideBar.btnResults.onRelease = function () { gotoAndPlay("step3"); }; mcSideBar.btnHelpKidInfo.onRelease = function () { var _loc1 = ""; _loc1 = _loc1 + ("Your child\'s weight = " + checkUserInfo("weight") + "\r"); _loc1 = _loc1 + ("Your child\'s age = " + checkUserInfo("age") + "\r"); helpPanel("Your child", _loc1, xmlDataTarget + "images/icon-groups/group-0plus-trans.png"); }; } // End of the function function showSideBarInfo() { mcSideBar.tweenIn(40); mcSideBar.btnHelpKidInfo.enabled = true; } // End of the function function hideSideBarInfo() { mcSideBar.tweenOut(20); mcSideBar.btnHelpKidInfo.enabled = false; } // End of the function function updateSideBar() { if (objectChild.childAge == 0 && objectChild.childAge == 0 && objectChild.childWeight == 0) { mcSideBar.btnResults._visible = false; mcSideBar.btnRestart._visible = false; } else { if (mcSideBar.btnResults._visible != true || mcSideBar.btnResults.enabled == false) { mcSideBar.btnResults.enabled = true; var _loc5 = new mx.transitions.Tween(mcSideBar.btnResults, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if if (mcSideBar.btnRestart._visible != true) { _loc5 = new mx.transitions.Tween(mcSideBar.btnRestart, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if mcSideBar.btnRestart._visible = true; mcSideBar.btnResults._visible = true; } // end else if var _loc1 = checkUserInfo("age"); var _loc2 = checkUserInfo("weight"); if (_loc1 != mcSideBar.mcKidInfo.mcKidAge.txtAge.text) { _loc5 = new mx.transitions.Tween(mcSideBar.mcKidInfo.mcKidAge, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if if (_loc2 != mcSideBar.mcKidInfo.mcKidWeight.txtWeight.text) { _loc5 = new mx.transitions.Tween(mcSideBar.mcKidInfo.mcKidWeight, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if mcSideBar.mcKidInfo.mcKidAge.txtAge.text = _loc1; mcSideBar.mcKidInfo.mcKidWeight.txtWeight.text = _loc2; var _loc3 = objectChild.currentGroup; calculateGroup(); var _loc4 = checkUserInfo("groupicon"); if (objectChild.currentGroup != _loc3) { loadIcon(mcSideBar.mcKidIcon, _loc4); } // end if calculateProducts(); adjustCount(filteredArray.length); } // End of the function function calculateGroup() { var _loc1 = objectChild.childAge; if (_loc1 == 0) { objectChild.currentGroup = 1; } else if (_loc1 >= 1 && _loc1 < 9) { objectChild.currentGroup = 1; } else if (_loc1 >= 9 && _loc1 < 16) { objectChild.currentGroup = 2; } else if (_loc1 >= 16 && _loc1 < 43) { objectChild.currentGroup = 3; } else if (_loc1 >= 43 && _loc1 < 85) { objectChild.currentGroup = 3; } else if (_loc1 >= 85) { objectChild.currentGroup = 5; } else { objectChild.currentGroup = 1; } // end else if } // End of the function function checkUserInfo(whatField) { var _loc1; switch (whatField) { case "weight": { if (objectChild.childWeight > 0) { _loc1 = objectChild.childWeight + " kg"; } else { _loc1 = "No weight selected"; } // end else if break; } case "age": { if (objectChild.childAge >= 24) { _loc1 = Math.ceil(objectChild.childAge / 12) + " years"; } else if (objectChild.childAge > 0 && objectChild.childAge < 24) { _loc1 = objectChild.childAge + " month(s)"; } else { _loc1 = "No age selected"; } // end else if break; } case "group": { if (objectChild.currentGroup == 1) { _loc1 = "0"; } else if (objectChild.currentGroup == 2) { _loc1 = "0+"; } else if (objectChild.currentGroup == 3) { _loc1 = "1"; } else if (objectChild.currentGroup == 4) { _loc1 = "0+ & 1"; } else if (objectChild.currentGroup == 5) { _loc1 = "2-3"; } else if (objectChild.currentGroup == 6) { _loc1 = "1-2-3"; } else { _loc1 = "No group selected"; } // end else if break; } case "groupicon": { if (objectChild.currentGroup == 1) { _loc1 = iconGroup0; } else if (objectChild.currentGroup == 2) { _loc1 = iconGroup0plus; } else if (objectChild.currentGroup == 3) { _loc1 = iconGroup1; } else if (objectChild.currentGroup == 4) { _loc1 = iconGroup0plus1; } else if (objectChild.currentGroup == 5) { _loc1 = iconGroup23; } else if (objectChild.currentGroup == 6) { _loc1 = iconGroup123; } else { _loc1 = iconGroup0; } // end else if break; } case "features": { break; } } // End of switch return (_loc1); } // End of the function function calculateProducts() { var _loc4 = new Array(); filteredArray = []; var _loc7 = objectChild.childMinAge > 0 && objectChild.childMaxAge > 0 ? (true) : (false); var _loc8 = objectChild.childMinWeight > 0 && objectChild.childMaxWeight > 0 ? (true) : (false); trace ("Age check = " + _loc7); trace ("Weight check = " + _loc8); if (_loc8 && _loc7) { for (var _loc3 = 0; _loc3 < productArray.length; ++_loc3) { var _loc6 = objectChild.childMinAge >= productArray[_loc3].MINAGE && objectChild.childMinAge <= productArray[_loc3].MAXAGE || objectChild.childMaxAge >= productArray[_loc3].MINAGE && objectChild.childMaxAge <= productArray[_loc3].MAXAGE ? (true) : (false); var _loc5 = objectChild.childMinWeight >= productArray[_loc3].MINWEIGHT && objectChild.childMinWeight <= productArray[_loc3].MAXWEIGHT || objectChild.childMaxWeight >= productArray[_loc3].MINWEIGHT && objectChild.childMaxWeight <= productArray[_loc3].MAXWEIGHT ? (true) : (false); if (_loc6 && _loc5) { trace ("Seat included = " + productArray[_loc3].PRODNAME); filteredArray.push(productArray[_loc3]); } // end if } // end of for } else if (!_loc8 && _loc7) { for (var _loc3 = 0; _loc3 < productArray.length; ++_loc3) { _loc6 = objectChild.childMinAge >= productArray[_loc3].MINAGE && objectChild.childMinAge <= productArray[_loc3].MAXAGE || objectChild.childMaxAge >= productArray[_loc3].MINAGE && objectChild.childMaxAge <= productArray[_loc3].MAXAGE ? (true) : (false); if (_loc6) { trace ("Seat included = " + productArray[_loc3].PRODNAME); filteredArray.push(productArray[_loc3]); } // end if } // end of for } else if (_loc8 && !_loc7) { for (var _loc3 = 0; _loc3 < productArray.length; ++_loc3) { _loc5 = objectChild.childMinWeight >= productArray[_loc3].MINWEIGHT && objectChild.childMinWeight <= productArray[_loc3].MAXWEIGHT || objectChild.childMaxWeight >= productArray[_loc3].MINWEIGHT && objectChild.childMaxWeight <= productArray[_loc3].MAXWEIGHT ? (true) : (false); if (_loc5) { trace ("Seat included = " + productArray[_loc3].PRODNAME); filteredArray.push(productArray[_loc3]); } // end if } // end of for } else { for (var _loc3 = 0; _loc3 < productArray.length; ++_loc3) { trace ("Exception encountered - seat included = " + productArray[_loc3].PRODNAME); filteredArray.push(productArray[_loc3]); } // end of for } // end else if if (objectChild.seatFeatures.length == 0) { trace ("No options are currently selected, including all products."); for (var _loc3 = 0; _loc3 < filteredArray.length; ++_loc3) { _loc4.push(filteredArray[_loc3]); } // end of for } else { for (var _loc3 = 0; _loc3 < objectChild.seatFeatures.length; ++_loc3) { for (var _loc1 = 0; _loc1 < filteredArray.length; ++_loc1) { for (var _loc2 = 0; _loc2 < filteredArray[_loc1].PRODFEATURES.length; ++_loc2) { if (objectChild.seatFeatures[_loc3] == filteredArray[_loc1].PRODFEATURES[_loc2]) { _loc4.push(filteredArray[_loc1]); } // end if } // end of for } // end of for } // end of for trace ("Temp array = " + _loc4[0]); } // end else if if (_loc4.length > 0) { filteredArray = _loc4.removeDuplicates(true); filteredArray.sortOn("PRODRANK", Array.NUMERIC); for (var _loc3 = 0; _loc3 < filteredArray.length; ++_loc3) { trace ("Array Item ID: " + filteredArray[_loc3].PRODRANK + " (type = " + typeof(filteredArray[_loc3].PRODRANK) + ")"); } // end of for } else { trace ("There were no matches, the filtered array is empty."); filteredArray = []; } // end else if chosenProduct = 99; } // End of the function function blurNumbers(whichClip) { var blurFilter = new flash.filters.BlurFilter(minBlur, numBlur, 3); blurTween = new mx.transitions.Tween(blurFilter, "blurY", mx.transitions.easing.Regular.easeInOut, blurFilter.blurY, minBlur, blurShort, false); blurTween.onMotionChanged = function () { blurFilter.blurY; whichClip.filters = new Array(blurFilter); }; } // End of the function function adjustCount(newCount) { newCount = newCount + 1; var _loc1 = mcSideBar.mcCount.countContainer; if (newCount < _loc1._currentframe) { blurNumbers(_loc1); _loc1.tweenOut(newCount); } else if (newCount > _loc1._currentframe) { blurNumbers(_loc1); _loc1.tweenIn(newCount); } // end else if } // End of the function function saveUserData() { var _loc1 = SharedObject.getLocal("userData", "/"); _loc1.data.currentStep = curStep; _loc1.data.childAge = objectChild.childAge; _loc1.data.childMinAge = objectChild.childMinAge; _loc1.data.childMaxAge = objectChild.childMaxAge; _loc1.data.childWeight = objectChild.childWeight; _loc1.data.childMinWeight = objectChild.childMinWeight; _loc1.data.childMaxWeight = objectChild.childMaxWeight; _loc1.data.childHeight = objectChild.childHeight; _loc1.data.childMinHeight = objectChild.childMinHeight; _loc1.data.childMaxHeight = objectChild.childMaxHeight; _loc1.data.currentGroup = objectChild.currentGroup; _loc1.data.seatFeatures = objectChild.seatFeatures; _loc1.data.chosenProduct = chosenProduct; _loc1.flush(); } // End of the function function loadUserData() { var _loc1 = SharedObject.getLocal("userData", "/"); if (_loc1.data.currentStep == undefined) { return; } // end if curStep = _loc1.data.currentStep; objectChild.childAge = _loc1.data.childAge; objectChild.childMinAge = _loc1.data.childMinAge; objectChild.childMaxAge = _loc1.data.childMaxAge; objectChild.childWeight = _loc1.data.childWeight; objectChild.childMinWeight = _loc1.data.childMinWeight; objectChild.childMaxWeight = _loc1.data.childMaxWeight; objectChild.childHeight = _loc1.data.childHeight; objectChild.childMinHeight = _loc1.data.childMinHeight; objectChild.childMaxHeight = _loc1.data.childMaxHeight; objectChild.currentGroup = _loc1.data.currentGroup; objectChild.seatFeatures = _loc1.data.seatFeatures; updateSideBar(); chosenProduct = _loc1.data.chosenProduct; trace ("soObject.data.chosenProduct = " + _loc1.data.chosenProduct); _loc1.flush(); var _loc2 = checkUserInfo("groupicon"); loadIcon(mcSideBar.mcKidIcon, _loc2); gotoAndPlay("step" + curStep); } // End of the function function clearUserData() { trace ("Cleared user data"); var _loc1 = SharedObject.getLocal("userData", "/"); _loc1.clear(); _loc1.flush(); } // End of the function play (); MovieClip.prototype.tweenIn = function (frame) { this.onEnterFrame = function () { if (this._currentframe < frame) { this.nextFrame(); } else { delete this.onEnterFrame; } // end else if }; }; MovieClip.prototype.tweenOut = function (frame) { this.onEnterFrame = function () { if (this._currentframe > frame) { this.prevFrame(); } else { delete this.onEnterFrame; } // end else if }; }; var anonymousWait; MovieClip.prototype.pauseMovie = function (a, b, speed) { if (anonymousWait != null) { clearInterval(anonymousWait); } // end if if (a <= b) { this.stop(); anonymousWait = setInterval(this, "pauseMovie", speed, a + 1, b, speed); } else { clearInterval(anonymousWait); this.play(); } // end else if }; Array.prototype.removeDuplicates = function () { var _loc3 = new Array(); _loc3 = this.slice(); for (var _loc4 = 0; _loc4 < _loc3.length; ++_loc4) { for (var _loc2 = 0; _loc2 < _loc3.length; ++_loc2) { if (_loc3[_loc2].PRODNAME == _loc3[_loc4].PRODNAME && _loc4 != _loc2) { _loc3.splice(_loc2, 1); --_loc2; } // end if } // end of for } // end of for return (_loc3); }; var linkCompare = _root.linkCompare != undefined ? (_root.linkCompare) : ("compare.asp"); var xmlFeatures = _root.xmlFeatures != undefined ? (_root.xmlFeatures) : ("xml/feature-data.xml"); var xmlProducts = _root.xmlProducts != undefined ? (_root.xmlProducts) : ("xml/product-data.xml"); var xmlDataTarget = _root.xmlDataTarget != undefined ? (_root.xmlDataTarget) : (""); var productArray = new Array(); var featureArray = new Array(); var dataArray = new Array(); var keyTag = "ITEM"; var xmlSortFlag = "sortAsFeature"; var filteredArray = new Array(); var finalArray = new Array(); var chosenProduct = 99; var mathFloor = Math.floor; var mathCeil = Math.ceil; var mathAbs = Math.abs; var curStep = 1; var numBlur = 18; var maxBlur = 3; var minBlur = 0; var blurTween; var blurShort = 10; var blurLong = 120; var tweenSpeed = 20; var colorTrans = new flash.geom.ColorTransform(); var tweenPanel; var tweenClip; var iconGroup0 = _root.iconGroup0 != undefined ? (_root.iconGroup0) : ("images/icon-groups/group-0-trans.png"); var iconGroup0plus = _root.iconGroup0plus != undefined ? (_root.iconGroup0plus) : ("images/icon-groups/group-0plus-trans.png"); var iconGroup1 = _root.iconGroup1 != undefined ? (_root.iconGroup1) : ("images/icon-groups/group-1-trans.png"); var iconGroup0plus1 = _root.iconGroup0plus1 != undefined ? (_root.iconGroup0plus1) : ("images/icon-groups/group-0-1-trans.png"); var iconGroup23 = _root.iconGroup23 != undefined ? (_root.iconGroup23) : ("images/icon-groups/group-2-3-trans.png"); var iconGroup123 = _root.iconGroup123 != undefined ? (_root.iconGroup123) : ("images/icon-groups/group-1-2-3-trans.png"); var arrayPhotos = new Array(); var arrayTemp = new Array(); var currentPic = 0; var incrementPic = 0; var tempPic = 0; var autoCyclePics = true; var maxTabs = 12; var txtDescrip = txtDescrip; var arrayFeatures = new Array(); var objectChild = new Object(); objectChild.childAge = 0; objectChild.childMinAge = 0; objectChild.childMaxAge = 0; objectChild.childWeight = 0; objectChild.childMinWeight = 0; objectChild.childMaxWeight = 0; objectChild.childHeight = 0; objectChild.childMinHeight = 0; objectChild.childMaxHeight = 0; objectChild.currentGroup = 0; objectChild.seatFeatures = arrayFeatures; MovieClip.prototype.tweenLoader = function (pctLoaded) { var _loc2 = new mx.transitions.Tween(this, "_x", mx.transitions.easing.Regular.easeOut, this._x, 1000 + pctLoaded * 8, tweenSpeed, false); }; MovieClip.prototype.fadeIn = function () { var _loc2 = new mx.transitions.Tween(this, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, tweenSpeed, false); }; // [Action in Frame 2] function loadXML(filename) { var _loc2 = new XML(); var _loc1 = new XML(); _loc1.ignoreWhite = true; _loc1.onLoad = loadedData; _loc2.sendAndLoad(filename, _loc1, "POST"); } // End of the function function loadedData(success) { if (success) { parsifyData(this); play (); } else { stop (); } // end else if } // End of the function function parsifyData(rootNode) { if (rootNode.hasChildNodes()) { for (var _loc1 = 0; _loc1 < rootNode.childNodes.length; ++_loc1) { if (rootNode.childNodes[_loc1].nodeName == keyTag) { extractData(rootNode.childNodes[_loc1], rootNode.nodeName); continue; } // end if parsifyData(rootNode.childNodes[_loc1], rootNode.nodeName); } // end of for } // end if } // End of the function function extractData(xmlNode, rootNode) { var _loc5 = new Object(); for (var _loc1 = xmlNode.firstChild; _loc1 != null; _loc1 = _loc1.nextSibling) { var _loc4 = new Array(); if (_loc1.firstChild.hasChildNodes()) { for (var _loc2 = 0; _loc2 < _loc1.childNodes.length; ++_loc2) { _loc4.push(_loc1.childNodes[_loc2].firstChild.nodeValue); } // end of for var _loc3 = _loc1.nodeName; _loc5[_loc3.toUpperCase()] = _loc4; continue; } // end if _loc3 = _loc1.nodeName; _loc5[_loc3.toUpperCase()] = _loc1.firstChild.nodeValue; if (_loc3.toUpperCase() == "PRODRANK") { _loc5[_loc3.toUpperCase()] = Number(_loc1.firstChild.nodeValue); } // end if } // end of for if (xmlSortFlag == "sortAsFeature") { featureArray.push(_loc5); } else if (xmlSortFlag == "sortAsProduct") { productArray.push(_loc5); } else { dataArray.push(_loc5); } // end else if } // End of the function // [Action in Frame 20] stop (); var movieLoaded = this.getBytesLoaded(); var movieTotal = this.getBytesTotal(); var moviePercent = Math.floor(movieLoaded / movieTotal * 100); if (moviePercent >= 100) { mcFade.tweenLoader(80); delete movieLoaded; delete movieTotal; delete moviePercent; play (); } else { mcFade.tweenLoader(moviePercent / 1.200000E+000); gotoAndPlay(_currentframe - 1); } // end else if // [Action in Frame 30] stop (); xmlSortFlag = "sortAsFeature"; loadXML(xmlFeatures); // [Action in Frame 31] stop (); xmlSortFlag = "sortAsProduct"; loadXML(xmlProducts); // [Action in Frame 35] mcFade.tweenLoader(100); // [Action in Frame 69] initSideBar(); loadUserData(); // [Action in Frame 71] function initStep1() { mcMain.btnNextStepOff._visible = false; mcMain.btnNextStep._visible = false; mcMain.btnNextStepOff.onRelease = function () { }; mcMain.btnNextStep.onRelease = function () { gotoAndPlay("step2"); }; mcMain.btnHelpAge.onRelease = function () { helpPanel("Your child\'s age", "Choose your child\'s age from the range of ages available in the drop down list.", xmlDataTarget + "images/icon-features/suitable-from-birth.jpg"); }; mcMain.btnHelpWeight.onRelease = function () { helpPanel("Your child\'s weight", "Choose your child\'s weight from the range of weights available in the drop down list.", xmlDataTarget + "images/icon-features/suitable-from-birth.jpg"); }; mcMain.btnHelpHeight.onRelease = function () { helpPanel("Your child\'s height", "Choose your child\'s height from the range of heights available in the drop down list.", xmlDataTarget + "images/icon-features/suitable-from-birth.jpg"); }; } // End of the function function checkNextStep() { if (objectChild.childAge == 0 || objectChild.childWeight == 0) { if (mcMain.btnNextStepOff._visible != true) { var _loc1 = new mx.transitions.Tween(mcMain.btnNextStepOff, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if mcMain.btnNextStepOff._visible = true; mcMain.btnNextStep._visible = false; } else { if (mcMain.btnNextStep._visible != true) { _loc1 = new mx.transitions.Tween(mcMain.btnNextStep, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if mcMain.btnNextStepOff._visible = false; mcMain.btnNextStep._visible = true; } // end else if updateSideBar(); } // End of the function function updateUserProperty(whichProp, whatValue) { if (whichProp == "childWeight") { objectChild.childWeight = whatValue; objectChild.childMinWeight = whatValue; objectChild.childMaxWeight = whatValue; } else if (whichProp == "childAge") { objectChild.childAge = whatValue; objectChild.childMinAge = whatValue; objectChild.childMaxAge = whatValue; } else if (whichProp == "childHeight") { objectChild.childHeight = whatValue; } // end else if saveUserData(); checkNextStep(); } // End of the function play (); setStep(1); hideOptionalSteps(); showSideBarInfo(); initStep1(); checkNextStep(); curStep = 1; // [Action in Frame 119] stop (); // [Action in Frame 121] function initStep2() { mcMain.btnNextStepOff._visible = false; mcMain.btnNextStep._visible = false; mcMain.btnNextStepOff.onRelease = function () { }; mcMain.btnNextStep.onRelease = function () { gotoAndPlay("step3"); }; mcMain.btnHelpIsofix.onRelease = function () { helpPanel("ISOFIX", "ISOFIX is a safety system that has become an international installation standard for fixing a child seat to a vehicle without the use of a seat belt. It minimises installation errors and optimises protection through a rigid connection to the car chassis.", xmlDataTarget + "images/icon-features/isofix.jpg"); }; mcMain.btnHelpBoth.onRelease = function () { helpPanel("ISOFIX", "ISOFIX is a safety system that has become an international installation standard for fixing a child seat to a vehicle without the use of a seat belt. It minimises installation errors and optimises protection through a rigid connection to the car chassis.", xmlDataTarget + "images/icon-features/isofix.jpg"); }; mcMain.mcOption1.onRollOver = function () { this.tweenIn(10); }; mcMain.mcOption1.onRollOut = mcMain.mcOption1.onDragOut = function () { if (userSelection != 1) { this.tweenOut(1); } // end if }; mcMain.mcOption1.onRelease = function () { var _loc2 = new mx.transitions.Tween(this, "_y", mx.transitions.easing.Bounce.easeOut, 70, 80, tweenSpeed, false); objectChild.seatFeatures.pop(); objectChild.seatFeatures.pop(); objectChild.seatFeatures[0] = 72; checkNextStep(); saveUserData(); }; mcMain.mcOption2.onRollOver = function () { this.tweenIn(10); }; mcMain.mcOption2.onRollOut = mcMain.mcOption2.onDragOut = function () { if (userSelection != 2) { this.tweenOut(1); } // end if }; mcMain.mcOption2.onRelease = function () { var _loc2 = new mx.transitions.Tween(this, "_y", mx.transitions.easing.Bounce.easeOut, 70, 80, tweenSpeed, false); objectChild.seatFeatures.pop(); objectChild.seatFeatures.pop(); objectChild.seatFeatures[0] = 146; checkNextStep(); saveUserData(); }; mcMain.mcOption3.onRollOver = function () { this.tweenIn(10); }; mcMain.mcOption3.onRollOut = mcMain.mcOption3.onDragOut = function () { if (userSelection != 3) { this.tweenOut(1); } // end if }; mcMain.mcOption3.onRelease = function () { var _loc2 = new mx.transitions.Tween(this, "_y", mx.transitions.easing.Bounce.easeOut, 70, 80, tweenSpeed, false); objectChild.seatFeatures.pop(); objectChild.seatFeatures.pop(); objectChild.seatFeatures[0] = 72; objectChild.seatFeatures[1] = 146; checkNextStep(); saveUserData(); }; } // End of the function function checkNextStep() { if (objectChild.seatFeatures.length == 0) { if (mcMain.btnNextStepOff._visible != true) { var _loc1 = new mx.transitions.Tween(mcMain.btnNextStepOff, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if mcMain.btnNextStepOff._visible = true; mcMain.btnNextStep._visible = false; } else { if (mcMain.btnNextStep._visible != true) { _loc1 = new mx.transitions.Tween(mcMain.btnNextStep, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); } // end if mcMain.btnNextStepOff._visible = false; mcMain.btnNextStep._visible = true; } // end else if if (objectChild.seatFeatures[0] == 72 && objectChild.seatFeatures.length == 1) { mcMain.mcOption1.tweenIn(10); mcMain.mcOption2.tweenOut(1); mcMain.mcOption3.tweenOut(1); userSelection = 1; } else if (objectChild.seatFeatures[0] == 146 && objectChild.seatFeatures.length == 1) { mcMain.mcOption1.tweenOut(1); mcMain.mcOption2.tweenIn(10); mcMain.mcOption3.tweenOut(1); userSelection = 2; } else if (objectChild.seatFeatures.length == 2) { mcMain.mcOption1.tweenOut(1); mcMain.mcOption2.tweenOut(1); mcMain.mcOption3.tweenIn(10); userSelection = 3; } else { mcMain.mcOption1.tweenOut(1); mcMain.mcOption2.tweenOut(1); mcMain.mcOption3.tweenOut(1); userSelection = 0; } // end else if updateSideBar(); } // End of the function play (); setStep(2); hideOptionalSteps(); showSideBarInfo(); initStep2(); checkNextStep(); curStep = 2; var userSelection; // [Action in Frame 169] stop (); // [Action in Frame 171] function initStep3() { if (mcSideBar.btnResults._visible == true) { var _loc1 = new mx.transitions.Tween(mcSideBar.btnResults, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, tweenSpeed, false); mcSideBar.btnResults.enabled = false; } // end if if (filteredArray.length == 0) { mcMain._visible = false; helpPanel("There are no seats matching your chosen criteria.", "You may find more BRITAX R?MER product results by selecting all installation methods, or changing your child\'s information on Steps 1 and 2", xmlDataTarget + "images/icon-features/suitable-from-birth.jpg"); } else { buildItems(); } // end else if initArrows(); adjustArrows(); updateArrows(); } // End of the function function buildItems() { var _loc10 = 0; arrayPosition = []; for (var _loc6 = 0; _loc6 < filteredArray.length; ++_loc6) { var _loc2 = mcMain.mcItemPlaceholder.attachMovie("mcItem", "mcItem" + _loc6, mcMain.mcItemPlaceholder.getNextHighestDepth(), new itemProperties()); var _loc9 = 206 * _loc6; arrayPosition.push(_loc9); _loc10 = _loc9; _loc2._x = _loc10; _loc2._y = 0; _loc2.ID = _loc6; _loc2.CLIPWIDTH = 206; _loc2.PRODPIC = filteredArray[_loc6].PRODSMALLPIC; _loc2.PRODID = filteredArray[_loc6].PRODID; _loc2.PRODGROUP = filteredArray[_loc6].PRODGROUP; _loc2.PRODNAME = filteredArray[_loc6].PRODNAME; _loc2.PRODLINK = filteredArray[_loc6].PRODLINK; _loc2.MINWEIGHT = filteredArray[_loc6].MINWEIGHT; _loc2.MAXWEIGHT = filteredArray[_loc6].MAXWEIGHT; _loc2.MINHEIGHT = filteredArray[_loc6].MINHEIGHT; _loc2.MAXHEIGHT = filteredArray[_loc6].MAXHEIGHT; _loc2.MINAGE = filteredArray[_loc6].MINAGE; _loc2.MAXAGE = filteredArray[_loc6].MAXAGE; _loc2.MINSHOULDERHEIGHT = filteredArray[_loc6].MINSHOULDERHEIGHT; _loc2.MAXSHOULDERHEIGHT = filteredArray[_loc6].MAXSHOULDERHEIGHT; _loc2.FEATURES = filteredArray[_loc6].FEATURES; _loc2.btnMax._visible = false; _loc2.mcSeatNameTall._visible = false; _loc2.mcSeatSmall._visible = false; _loc2.COMPARE = false; _loc2.btnCompare._alpha = 0; _loc2.btnCompare.enabled = false; loadIcon(_loc2.mcSeatPic, xmlDataTarget + "uploads/product/car-seats/" + filteredArray[_loc6].PRODSMALLPIC); loadMiniIcon(_loc2.mcSeatSmall, xmlDataTarget + "uploads/product/car-seats/" + filteredArray[_loc6].PRODSMALLPIC); _loc2.mcSeatName.txtSeatName.text = filteredArray[_loc6].PRODNAME; _loc2.mcSeatNameTall.txtSeatName.text = filteredArray[_loc6].PRODNAME; for (var _loc5 = 0; _loc5 < 3; ++_loc5) { for (var _loc4 = 0; _loc4 < featureArray.length; ++_loc4) { if (filteredArray[_loc6].PRODFEATURES[_loc5] == featureArray[_loc4].FEATUREID) { var _loc3 = _loc2.mcFeatPlaceholder.attachMovie("mcFeature", "mcFeature" + _loc4, _loc2.mcFeatPlaceholder.getNextHighestDepth()); _loc3._x = 0; _loc3._y = _loc5 * 42; loadMiniIcon(_loc3.mcFeatIcon, xmlDataTarget + "uploads/features/" + featureArray[_loc4].FEATUREICON); _loc3.mcFeatName.txtFeature.autoSize = "left"; var _loc8 = featureArray[_loc4].FEATURE; _loc3.mcFeatName.txtFeature.text = _loc8; trace (featureArray[_loc4].FEATURE); if (_loc3.mcFeatName.txtFeature._height > 20 && _loc3.mcFeatName.txtFeature._height < 30) { _loc3.mcFeatName.txtFeature._y = -6; } else if (_loc3.mcFeatName.txtFeature._height > 29) { _loc3.mcFeatName.txtFeature._y = -10; } // end else if break; } // end if } // end of for } // end of for _loc2.btnChoose.onRelease = function () { trace ("Chosen button " + this._parent.PRODNAME); chosenProduct = this._parent.ID; gotoAndPlay("step4"); }; _loc2.btnCheck.onRelease = function () { trace ("Checked / unchecked"); if (this._parent.COMPARE) { this._parent.COMPARE = false; this.tweenOut(1); var _loc2 = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Bounce.easeOut, 110, 100, tweenSpeed, false); _loc2 = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Bounce.easeOut, 110, 100, tweenSpeed, false); this._parent.btnCompare.enabled = false; _loc2 = new mx.transitions.Tween(this._parent.btnCompare, "_alpha", mx.transitions.easing.Strong.easeOut, this._parent.btnCompare._alpha, 0, tweenSpeed, false); } else { this._parent.COMPARE = true; this.tweenIn(7); _loc2 = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Bounce.easeOut, 80, 100, tweenSpeed, false); _loc2 = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Bounce.easeOut, 80, 100, tweenSpeed, false); this._parent.btnCompare.enabled = true; _loc2 = new mx.transitions.Tween(this._parent.btnCompare, "_alpha", mx.transitions.easing.Strong.easeOut, this._parent.btnCompare._alpha, 100, tweenSpeed, false); } // end else if }; _loc2.btnCompare.onRelease = function () { var _loc3 = ""; for (var _loc2 = 0; _loc2 < filteredArray.length; ++_loc2) { if (this._parent._parent["mcItem" + _loc2].COMPARE == true) { _loc3 = _loc3 + (this._parent._parent["mcItem" + _loc2].PRODID + ","); } // end if } // end of for _loc3 = _loc3.slice(0, _loc3.length - 1); trace ("Comparing products ?ID=" + _loc3); getURL(linkCompare + "?ID=" + _loc3, ""); }; _loc2.btnMin.onRelease = function () { orderItems(this._parent._name, 72); this._parent.gotoAndStop("closed"); this._visible = false; this._parent.btnMax._visible = true; this._parent.btnChoose._visible = false; this._parent.btnCompare._visible = false; this._parent.mcSeatPic._visible = false; this._parent.mcSeatSmall._visible = true; this._parent.mcFeatPlaceholder._visible = false; this._parent.btnCheck._x = 41; this._parent.mcSeatName._visible = false; this._parent.mcSeatNameTall._visible = true; }; _loc2.btnMax.onRelease = function () { orderItems(this._parent._name, 206); this._parent.gotoAndStop("open"); this._visible = false; this._parent.btnMin._visible = true; this._parent.btnChoose._visible = true; this._parent.btnCompare._visible = true; this._parent.mcSeatPic._visible = true; this._parent.mcSeatSmall._visible = false; this._parent.mcFeatPlaceholder._visible = true; this._parent.btnCheck._x = 115; this._parent.mcSeatName._visible = true; this._parent.mcSeatNameTall._visible = false; }; } // end of for } // End of the function function orderItems(whichClip, newSize) { var _loc5 = Number(whichClip.slice(6)); mcMain.mcItemPlaceholder[whichClip].CLIPWIDTH = newSize; var _loc3 = 0; for (var _loc1 = 0; _loc1 < filteredArray.length; ++_loc1) { _loc3 = _loc3 + mcMain.mcItemPlaceholder["mcItem" + _loc1].CLIPWIDTH; arrayPosition[_loc1 + 1] = _loc3; var _loc2 = mcMain.mcItemPlaceholder["mcItem" + _loc1]; var _loc4 = new mx.transitions.Tween(_loc2, "_x", mx.transitions.easing.Strong.easeOut, _loc2._x, arrayPosition[_loc1], tweenSpeed, false); } // end of for checkVisibleClips(); } // End of the function function initArrows() { if (filteredArray.length < 3) { mcMain.btnLeft._visible = false; mcMain.btnRight._visible = false; } // end if } // End of the function function updateArrows() { if (currentPosition == arrayPosition.length - 3) { var _loc1 = new mx.transitions.Tween(mcMain.btnRight, "_alpha", mx.transitions.easing.Strong.easeOut, mcMain.btnRight._alpha, 20, tweenSpeed, false); } else { _loc1 = new mx.transitions.Tween(mcMain.btnRight, "_alpha", mx.transitions.easing.Strong.easeOut, mcMain.btnRight._alpha, 100, tweenSpeed, false); } // end else if if (currentPosition == 0) { _loc1 = new mx.transitions.Tween(mcMain.btnLeft, "_alpha", mx.transitions.easing.Strong.easeOut, mcMain.btnLeft._alpha, 20, tweenSpeed, false); } else { _loc1 = new mx.transitions.Tween(mcMain.btnLeft, "_alpha", mx.transitions.easing.Strong.easeOut, mcMain.btnLeft._alpha, 100, tweenSpeed, false); } // end else if } // End of the function function adjustArrows() { mcMain.btnLeft.onRelease = function () { var _loc1 = currentPosition; if (currentPosition - 1 >= 0) { --currentPosition; } // end if var _loc2 = new mx.transitions.Tween(mcMain.mcItemPlaceholder, "_x", mx.transitions.easing.Strong.easeOut, -arrayPosition[_loc1], -arrayPosition[currentPosition], tweenSpeed, false); updateArrows(); checkVisibleClips(); }; mcMain.btnLeft.onRollOver = function () { this.tweenIn(10); }; mcMain.btnLeft.onRollOut = mcMain.btnLeft.onDragOut = function () { this.tweenOut(1); }; mcMain.btnRight.onRelease = function () { var _loc1 = currentPosition; if (currentPosition + 1 <= arrayPosition.length - 3) { ++currentPosition; } // end if var _loc2 = new mx.transitions.Tween(mcMain.mcItemPlaceholder, "_x", mx.transitions.easing.Strong.easeOut, -arrayPosition[_loc1], -arrayPosition[currentPosition], tweenSpeed, false); updateArrows(); checkVisibleClips(); }; mcMain.btnRight.onRollOver = function () { this.tweenIn(10); }; mcMain.btnRight.onRollOut = mcMain.btnRight.onDragOut = function () { this.tweenOut(1); }; } // End of the function function checkVisibleClips() { for (var _loc2 = 0; _loc2 < filteredArray.length; ++_loc2) { var _loc1 = mcMain.mcItemPlaceholder["mcItem" + _loc2]; var _loc3 = _loc1._x + mcMain.mcItemPlaceholder._x; if (_loc3 < 1000 && _loc3 > -600) { _loc1._visible = true; continue; } // end if _loc1._visible = false; } // end of for } // End of the function play (); var currentPosition = 0; var arrayPosition = new Array(); setStep(3); hideOptionalSteps(); showSideBarInfo(); initStep3(); curStep = 3; saveUserData(); Mouse.removeListener(mouseListener); var mouseListener = new Object(); mouseListener.onMouseWheel = function (deltaWheel) { trace ("Delta = " + deltaWheel); if (deltaWheel < 0) { mcMain.btnRight.gotoAndStop(10); mcMain.btnRight.tweenOut(1); var _loc1 = currentPosition; if (currentPosition + 1 <= arrayPosition.length - 3) { ++currentPosition; } // end if var _loc3 = new mx.transitions.Tween(mcMain.mcItemPlaceholder, "_x", mx.transitions.easing.Strong.easeOut, -arrayPosition[_loc1], -arrayPosition[currentPosition], tweenSpeed, false); updateArrows(); checkVisibleClips(); } else { mcMain.btnLeft.gotoAndStop(10); mcMain.btnLeft.tweenOut(1); _loc1 = currentPosition; if (currentPosition - 1 >= 0) { --currentPosition; } // end if _loc3 = new mx.transitions.Tween(mcMain.mcItemPlaceholder, "_x", mx.transitions.easing.Strong.easeOut, -arrayPosition[_loc1], -arrayPosition[currentPosition], tweenSpeed, false); updateArrows(); checkVisibleClips(); } // end else if }; Mouse.addListener(mouseListener); // [Action in Frame 219] stop (); // [Action in Frame 221] function initStep4() { trace ("Chosen product = " + chosenProduct + " / filter length = " + filteredArray.length); if (mcSideBar.btnResults._visible == true && mcSideBar.btnResults.enabled == false) { var _loc1 = new mx.transitions.Tween(mcSideBar.btnResults, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); mcSideBar.btnResults.enabled = true; } // end if if (filteredArray.length == 0 || chosenProduct == 99) { mcMain._visible = false; helpPanel("You must choose a product from Step 3", "This detailed product view requires you to select a product from Step 3.", xmlDataTarget + "images/icon-features/suitable-from-birth.jpg"); } else { trace ("Choose " + chosenProduct); showChosenProduct(); saveUserData(); } // end else if } // End of the function function showChosenProduct() { trace ("Chosen product name = " + filteredArray[chosenProduct].PRODNAME); mcMain.mcSeatName.txtSeat.text = filteredArray[chosenProduct].PRODNAME; loadLargeSeat(mcMain.mcSeatPic, xmlDataTarget + "uploads/product/car-seats/" + filteredArray[chosenProduct].PRODLARGEPIC); mcMain.btnView.onRelease = function () { trace ("View button = " + filteredArray[chosenProduct].PRODLINK); var _loc1 = xmlDataTarget + filteredArray[chosenProduct].PRODLINK; getURL(_loc1, ""); }; mcMain.btnFabrics.onRelease = function () { trace ("Fabrics button = " + xmlDataTarget + filteredArray[chosenProduct].PRODLINK + "fabric-options/"); var _loc1 = xmlDataTarget + filteredArray[chosenProduct].PRODLINK + "fabric-options/"; getURL(_loc1, ""); }; mcMain.btnFeatures.onRelease = function () { trace ("Features button = " + filteredArray[chosenProduct].PRODLINK); var _loc1 = xmlDataTarget + filteredArray[chosenProduct].PRODLINK; getURL(_loc1, ""); }; mcMain.btnSpecs.onRelease = function () { trace ("Specs button = " + filteredArray[chosenProduct].PRODLINK + "specs/"); var _loc1 = xmlDataTarget + filteredArray[chosenProduct].PRODLINK + "specs/"; getURL(_loc1, ""); }; mcMain.btnGrow.onRelease = function () { gotoAndPlay("step5"); }; } // End of the function play (); setStep(4); hideOptionalSteps(); showSideBarInfo(); initStep4(); curStep = 4; trace ("Step 4: chosenProduct = " + chosenProduct); // [Action in Frame 269] stop (); // [Action in Frame 271] function initStep5() { if (mcSideBar.btnResults._visible == true && mcSideBar.btnResults.enabled == false) { var _loc1 = new mx.transitions.Tween(mcSideBar.btnResults, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, tweenSpeed, false); mcSideBar.btnResults.enabled = true; } // end if if (filteredArray.length == 0 || chosenProduct == 99) { mcMain._visible = false; helpPanel("You must choose a product from Step 3", "You must at least select an option on Step 1 before we can display any Britax product results. Additional filters are available on Step 2 to refine your results. Step 3 will allow you to choose a product to view.", xmlDataTarget + "images/icon-features/suitable-from-birth.jpg"); } else { showChosenProduct(); } // end else if } // End of the function function showChosenProduct() { mcMain.mcTitle.txtSeat.text = filteredArray[chosenProduct].PRODNAME; mcMain.mcWeight.txtWeight.text = "Weight range: " + productValue("weight", filteredArray[chosenProduct].MINWEIGHT) + " - " + productValue("weight", filteredArray[chosenProduct].MAXWEIGHT); mcMain.mcAge.txtAge.text = "Age limit: " + productValue("age", filteredArray[chosenProduct].MINAGE) + " - " + productValue("age", filteredArray[chosenProduct].MAXAGE); mcMain.mcWeightChild.txtWeight.text = "Child\'s weight: " + checkUserInfo("weight"); mcMain.mcAgeChild.txtAge.text = "Child\'s age: " + checkUserInfo("age"); loadLargeSeat(mcMain.mcSeatPic, xmlDataTarget + "uploads/product/car-seats/" + filteredArray[chosenProduct].PRODMEDPIC); mcMain.mcBarAge.tweenIn(20); var _loc2 = calculateRange("age", filteredArray[chosenProduct].MINAGE); var _loc3 = calculateRange("age", filteredArray[chosenProduct].MAXAGE); _loc3 = _loc3 - _loc2; var _loc4 = calculateRange("age", objectChild.childMinAge); if (objectChild.childMinAge == 0 && objectChild.childMaxAge == 0) { mcMain.mcRange.mcChildBar._visible = false; } else { mcMain.mcRange.mcChildBar._visible = true; } // end else if var _loc5 = new mx.transitions.Tween(mcMain.mcBarWeight, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 50, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange, "_y", mx.transitions.easing.Strong.easeOut, mcMain.mcRange._y, 299, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcRangeBar, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcRangeBar._x, _loc2, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcSeatText, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcSeatText._x, _loc2 + 7, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcRangeBar, "_width", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcRangeBar._width, _loc3, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcChildBar, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcChildBar._x, _loc4, tweenSpeed, false); viewBar = "age"; mcMain.mcBarWeight.btnBar.onRelease = function () { if (viewBar != "weight") { this._parent.tweenIn(20); mcMain.mcBarAge.tweenOut(1); var _loc2 = calculateRange("weight", filteredArray[chosenProduct].MINWEIGHT); var _loc3 = calculateRange("weight", filteredArray[chosenProduct].MAXWEIGHT); _loc3 = _loc3 - _loc2; var _loc4 = calculateRange("weight", objectChild.childMinWeight); if (objectChild.childMinWeight == 0 && objectChild.childMaxWeight == 0) { mcMain.mcRange.mcChildBar._visible = false; } else { mcMain.mcRange.mcChildBar._visible = true; } // end else if var _loc5 = new mx.transitions.Tween(this._parent, "_alpha", mx.transitions.easing.Strong.easeOut, 50, 100, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcBarAge, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 50, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange, "_y", mx.transitions.easing.Strong.easeOut, mcMain.mcRange._y, 330, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcRangeBar, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcRangeBar._x, _loc2, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcSeatText, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcSeatText._x, _loc2 + 7, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcRangeBar, "_width", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcRangeBar._width, _loc3, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcChildBar, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcChildBar._x, _loc4, tweenSpeed, false); viewBar = "weight"; } // end if }; mcMain.mcBarAge.btnBar.onRelease = function () { if (viewBar != "age") { this._parent.tweenIn(20); mcMain.mcBarWeight.tweenOut(1); var _loc2 = calculateRange("age", filteredArray[chosenProduct].MINAGE); var _loc3 = calculateRange("age", filteredArray[chosenProduct].MAXAGE); _loc3 = _loc3 - _loc2; var _loc4 = calculateRange("age", objectChild.childMinAge); if (objectChild.childMinAge == 0 && objectChild.childMaxAge == 0) { mcMain.mcRange.mcChildBar._visible = false; } else { mcMain.mcRange.mcChildBar._visible = true; } // end else if var _loc5 = new mx.transitions.Tween(this._parent, "_alpha", mx.transitions.easing.Strong.easeOut, 50, 100, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcBarWeight, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 50, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange, "_y", mx.transitions.easing.Strong.easeOut, mcMain.mcRange._y, 299, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcRangeBar, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcRangeBar._x, _loc2, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcSeatText, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcSeatText._x, _loc2 + 7, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcRangeBar, "_width", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcRangeBar._width, _loc3, tweenSpeed, false); _loc5 = new mx.transitions.Tween(mcMain.mcRange.mcChildBar, "_x", mx.transitions.easing.Strong.easeOut, mcMain.mcRange.mcChildBar._x, _loc4, tweenSpeed, false); viewBar = "age"; } // end if }; } // End of the function function calculateRange(whichProperty, lookupNumber) { if (whichProperty == "age") { if (lookupNumber == 0) { return (0); } else if (lookupNumber == 1) { return (18); } else if (lookupNumber == 2) { return (32); } else if (lookupNumber == 3) { return (45); } else if (lookupNumber == 4) { return (60); } else if (lookupNumber == 5) { return (76); } else if (lookupNumber == 6) { return (90); } else if (lookupNumber == 7) { return (102); } else if (lookupNumber == 8) { return (118); } else if (lookupNumber == 9) { return (135); } else if (lookupNumber == 10) { return (148); } else if (lookupNumber == 11) { return (168); } else if (lookupNumber == 12) { return (185); } else if (lookupNumber == 13) { return (200); } else if (lookupNumber == 14) { return (225); } else if (lookupNumber == 15) { return (255); } else if (lookupNumber == 16) { return (280); } else if (lookupNumber == 17) { return (290); } else if (lookupNumber >= 18 && lookupNumber < 24) { return (300); } else if (lookupNumber == 24) { return (300); } else if (lookupNumber == 36) { return (340); } else if (lookupNumber == 48) { return (385); } else if (lookupNumber == 49) { return (385); } else if (lookupNumber == 60) { return (400); } else if (lookupNumber == 72) { return (430); } else if (lookupNumber == 84) { return (450); } else if (lookupNumber == 96) { return (485); } else if (lookupNumber == 108) { return (500); } else if (lookupNumber == 120) { return (530); } else if (lookupNumber == 132) { return (560); } else if (lookupNumber == 144) { return (590); } else { return (0); } // end else if } else if (whichProperty == "weight") { if (lookupNumber < 1) { return (0); } else if (lookupNumber >= 1 && lookupNumber < 9) { return (10 + Math.floor(lookupNumber / 10 * lookupNumber) * 10); } else if (lookupNumber == 9) { return (80); } else if (lookupNumber == 10) { return (90); } else if (lookupNumber == 11) { return (142); } else if (lookupNumber == 12) { return (184); } else if (lookupNumber == 13) { return (235); } else if (lookupNumber == 14) { return (278); } else if (lookupNumber == 15) { return (325); } else if (lookupNumber == 16) { return (370); } else if (lookupNumber == 17) { return (412); } else if (lookupNumber == 18) { return (460); } else if (lookupNumber == 19) { return (480); } else if (lookupNumber == 20) { return (488); } else if (lookupNumber == 21) { return (496); } else if (lookupNumber == 22) { return (505); } else if (lookupNumber == 23) { return (512); } else if (lookupNumber == 24) { return (520); } else if (lookupNumber == 25) { return (528); } else if (lookupNumber == 26) { return (536); } else if (lookupNumber == 27) { return (544); } else if (lookupNumber == 28) { return (552); } else if (lookupNumber >= 29 && lookupNumber < 36) { return (552 + Math.floor(lookupNumber / 30 * lookupNumber)); } else if (lookupNumber == 36) { return (600); } else { return (0); } // end else if } // end else if } // End of the function function productValue(whichProperty, lookupNumber) { if (whichProperty == "age") { if (lookupNumber >= 18) { formattedData = Math.ceil(lookupNumber / 12) + " years"; } else if (lookupNumber > 0 && lookupNumber < 18) { formattedData = lookupNumber + " month(s)"; } else { formattedData = "Birth"; } // end else if return (formattedData); } else if (whichProperty == "weight") { if (lookupNumber > 0) { formattedData = lookupNumber + " kg"; } else { formattedData = "Birth"; } // end else if return (formattedData); } // end else if } // End of the function play (); setStep(5); showOptionalSteps(); showSideBarInfo(); initStep5(); curStep = 5; saveUserData(); var viewBar; // [Action in Frame 319] stop ();