Advertisement
dcomicboy

lingo functions

Jul 25th, 2012
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function loginCBS(s, sendInterval, secondBuffer, tournamentChatRoomID, teamRivalPenalty, teamRivalBracketPenalty)
  2. {
  3.     switch (s)
  4.     {
  5.         case 1:
  6.         {
  7.             if (!consoleMan)
  8.             {
  9.                 consoleMan = new classes.Console(this);
  10.             } // end if
  11.             classes.GlobalData.tournamentChatRoomID = tournamentChatRoomID;
  12.             classes.GlobalData.teamRivalPenalty = Number(teamRivalPenalty);
  13.             classes.GlobalData.teamRivalBracketPenalty = Number(teamRivalBracketPenalty);
  14.             classes.Control.loginFinished("socket");
  15.             _root.getCars();
  16.             break;
  17.         }
  18.         case 0:
  19.         {
  20.             _root.displayAlert("warning", "Unauthorized Login", "Your login is not using the correct protocol. Please try again.");
  21.             break;
  22.         }
  23.         case -1:
  24.         {
  25.             _root.displayAlert("warning", "Too Many Attempts", "You have exceeded the login limit. Please try again later.");
  26.             break;
  27.         }
  28.         case -2:
  29.         {
  30.             displayAlert("warning", "Duplicate Login", "You are already logged in. Please close any instances of the game that you have previously opened.");
  31.             break;
  32.         }
  33.         case -3:
  34.         {
  35.             _root.displayAlert("warning", "Traffic Block", "There are too many racers currently logged in. Please wait a few minutes and try again./r/rYou can bypass the traffic block if you have a membership. See www.NittoLegends.com for details.");
  36.             break;
  37.         }
  38.     } // End of switch
  39. } // End of the function
  40. function noActivityCB()
  41. {
  42.     classes.GlobalData.isDisconnected = true;
  43.     _root.abc.closeMe();
  44.     var _loc3 = (classes.AlertBox)(_root.attachMovie("alertBox", "abc", _root.getNextHighestDepth()));
  45.     _loc3.setValue("User Timed Out", "The server disconnected you because you have been inactive for over 20 minutes.", "warning");
  46.     _loc3.addButton("Quit");
  47.     _loc3.onOK = function ()
  48.     {
  49.         getURL("lingo: CLOSEGAME");
  50.     };
  51.     _loc3.addButton("Close");
  52.     var _loc4 = new Object();
  53.     _loc4.onRelease = function (theButton)
  54.     {
  55.         if (theButton.btnLabel.text == "Quit")
  56.         {
  57.             theButton._parent._parent.onOK();
  58.         } // end if
  59.         false;
  60.     };
  61.     _root.abc.addListener(_loc4);
  62. } // End of the function
  63. function showSocketConnectionErrorCB()
  64. {
  65.     classes.Control.dialogContainer("dialogSocketErrorContent");
  66. } // End of the function
  67. function sendNim(rid, msg)
  68. {
  69.     getURL("lingo: SENDNIMMESSAGE (" + rid + ",\"" + escape(msg) + "\")", "");
  70. } // End of the function
  71. function sendNimCB(s, rid)
  72. {
  73.     if (s > 0)
  74.     {
  75.     }
  76.     else
  77.     {
  78.        
  79.         var _loc1 = new Date();
  80.         var _loc4 = _loc1.getHours() + ":" + classes.NumFuncs.get2Mins(_loc1.getMinutes());
  81.         classes.Console.updateConverse(rid, "<br/><font color=\"#FF0000\">****This user is unavailable****</font>", s);
  82.         if (Number(classes.Lookup.buddyNum(rid)) < 0)
  83.         {
  84.             classes.Console._NIM.conversationGroup["conversation" + rid].tb1.txt_buddyloc.text = classes.Console.offlineText;
  85.         } // end if
  86.        
  87.     } // end else if
  88. } // End of the function
  89. function addNimUser(xmlStr)
  90. {
  91.     var _loc4;
  92.     var _loc3 = new XML();
  93.     _loc3.ignoreWhite = true;
  94.     _loc3.parseXML(xmlStr);
  95.     if (!_loc3.firstChild.attributes.s.length)
  96.     {
  97.         _loc4 = _loc3.firstChild.childNodes.length;
  98.         for (var _loc2 = 0; _loc2 < _loc4; ++_loc2)
  99.         {
  100.             var _loc1 = _loc3.firstChild.childNodes[_loc2];
  101.             classes.Console.addToBuddyList(_loc1.attributes.i, _loc1.attributes.n, _loc1.attributes.s, _loc1.attributes.b, _loc1.attributes.r);
  102.         } // end of for
  103.         if (_loc4)
  104.         {
  105.             panel.refreshMe(1);
  106.         } // end if
  107.     } // end if
  108. } // End of the function
  109. function addSingleNimUser(i, n, s, r)
  110. {
  111.     classes.Console.addToBuddyList(i, n, s, 0, r);
  112.     panel.refreshMe(1);
  113. } // End of the function
  114. function updateNimUser(id, userStatus)
  115. {
  116.     var _loc2;
  117.     _loc2 = classes.Lookup.buddyNum(id);
  118.     if (_loc2 >= 0)
  119.     {
  120.         _global.buddylist_xml.firstChild.childNodes[_loc2].attributes.s = userStatus;
  121.         panel.refreshMe(1);
  122.     } // end if
  123. } // End of the function
  124. function getNimMessage(id, fromName, ur, msg)
  125. {
  126.     if (classes.Console.findConverse(id) == undefined)
  127.     {
  128.         classes.Console.newConverse(id);
  129.     } // end if
  130.     var _loc1 = new Date();
  131.     var _loc3 = _loc1.getHours() + ":" + classes.NumFuncs.get2Mins(_loc1.getMinutes());
  132.     classes.Console.updateConverse(id, "<span class=\"e" + ur + "\"><span class=\"nim\">[" + _loc3 + "] " + fromName + ": " + msg + "</span></span>");
  133.     classes.Console.updateIndicator(id, 3);
  134. } // End of the function
  135. function deleteNimUser(id)
  136. {
  137.     getURL("lingo: DELETENIMUSER " + id, "");
  138. } // End of the function
  139. function deleteNimUserCB(stat, id)
  140. {
  141.     switch (stat)
  142.     {
  143.         case 1:
  144.         {
  145.             classes.Console.removeFromBuddyList(id);
  146.             break;
  147.         }
  148.         case 0:
  149.         {
  150.             break;
  151.         }
  152.         case -1:
  153.         {
  154.             break;
  155.         }
  156.         case -2:
  157.     } // End of switch
  158. } // End of the function
  159. function removeNimUserCB(id)
  160. {
  161.     classes.Console.removeFromBuddyList(id);
  162. } // End of the function
  163. function blockNimUser(id)
  164. {
  165.     getURL("lingo: BLOCKNIMUSER " + id, "");
  166. } // End of the function
  167. function blockNimUserCB(stat)
  168. {
  169.     switch (stat)
  170.     {
  171.         case 1:
  172.         {
  173.             break;
  174.         }
  175.         case 0:
  176.         {
  177.             break;
  178.         }
  179.         case -1:
  180.         {
  181.             break;
  182.         }
  183.     } // End of switch
  184. } // End of the function
  185. function unblockNimUser(id)
  186. {
  187.     _global.unblockUserID = id;
  188.     getURL("lingo: UNBLOCKNIMUSER " + id, "");
  189. } // End of the function
  190. function unblockNimUserCB(stat)
  191. {
  192.     switch (stat)
  193.     {
  194.         case 0:
  195.         {
  196.             classes.Control.dialogAlert("Failed to Block User", "Sorry, there was an error when trying to block this user.  Please try again.");
  197.             break;
  198.         }
  199.         case -1:
  200.         case 1:
  201.         {
  202.             for (var _loc2 = 0; _loc2 < _global.buddylist_xml.firstChild.childNodes.length; ++_loc2)
  203.             {
  204.                 if (_global.buddylist_xml.firstChild.childNodes[_loc2].attributes.id == _global.unblockUserID)
  205.                 {
  206.                     _global.buddylist_xml.firstChild.childNodes[_loc2].attributes.b = 0;
  207.                     delete _global.unblockUserID;
  208.                     break;
  209.                 } // end if
  210.             } // end of for
  211.             classes.Console._BASE.panel.refreshMe();
  212.             break;
  213.         }
  214.     } // End of switch
  215. } // End of the function
  216. function inquiryNimUser(uname, uid)
  217. {
  218.     var _loc2 = _global.outgoingRequestsXML.createElement("u");
  219.     _loc2.attributes.s = 2;
  220.     _loc2.attributes.n = uname;
  221.     _loc2.attributes.i = uid;
  222.     _global.outgoingRequestsXML.firstChild.appendChild(_loc2);
  223.     getURL("lingo: INQUIRYNIMUSER \"" + uname + "\"", "");
  224. } // End of the function
  225. function inquiryNimUserCB(stat)
  226. {
  227.     switch (stat)
  228.     {
  229.         case 1:
  230.         {
  231.             getNimIncomingRequests();
  232.             classes.Control.focusNim();
  233.             break;
  234.         }
  235.         case 0:
  236.         {
  237.             _root.displayAlert("warning", "Buddy Request Failed", "Sorry, this username could not be found in our system.");
  238.             break;
  239.         }
  240.         case -1:
  241.         {
  242.             getNimIncomingRequests();
  243.             classes.Control.focusNim();
  244.             break;
  245.         }
  246.         case -2:
  247.         {
  248.             break;
  249.         }
  250.         case -3:
  251.         {
  252.             getNimIncomingRequests();
  253.             classes.Control.focusNim();
  254.             break;
  255.         }
  256.         case -4:
  257.         {
  258.             getNimIncomingRequests();
  259.             classes.Control.focusNim();
  260.             break;
  261.         }
  262.         case -5:
  263.         {
  264.             _root.displayAlert("warning", "Buddy Request Failed", "Sorry, this user is not accepting requests.");
  265.             break;
  266.         }
  267.         case -6:
  268.         {
  269.             _root.displayAlert("warning", "Buddy Request Failed", "Sorry, you must wait a while before you try to add this user as a buddy again.");
  270.             break;
  271.         }
  272.         case -7:
  273.         {
  274.             _root.displayAlert("warning", "Buddy List Full", "Sorry, you already have the maximum number of buddies.");
  275.             break;
  276.         }
  277.         case -8:
  278.         {
  279.             _root.displayAlert("warning", "Buddy Request Failed", "Sorry, you can\'t have yourself as your buddy.");
  280.             break;
  281.         }
  282.         case -9:
  283.         {
  284.             _root.displayAlert("warning", "Buddy Request Failed", "Sorry, this user already has the maximum number of buddies.");
  285.             break;
  286.         }
  287.         case -60:
  288.         {
  289.             _root.displayAlert("warning", "Account Verification Required", "I\'m sorry, but you need to verify your account to add someone as a buddy.");
  290.             break;
  291.         }
  292.     } // End of switch
  293. } // End of the function
  294. function receiveNimInquiryCB(reqID, reqName)
  295. {
  296.     var _loc2 = _global.incomingRequestsXML.createElement("u");
  297.     _loc2.attributes.n = reqName;
  298.     _loc2.attributes.i = reqID;
  299.     _global.incomingRequestsXML.firstChild.appendChild(_loc2);
  300.     if (classes.Console._BASE.panel.tbB.scrollerReq._visible)
  301.     {
  302.         classes.Console._BASE.panel.refreshMe();
  303.     } // end if
  304. } // End of the function
  305. function allowNimUser(reqID, answer)
  306. {
  307.     getURL("lingo: ALLOWNIMUSER " + reqID + ", " + answer, "");
  308. } // End of the function
  309. function allowNimUserCB(s)
  310. {
  311.     switch (s)
  312.     {
  313.         case 1:
  314.         {
  315.             break;
  316.         }
  317.         case -1:
  318.         {
  319.             _root.displayAlert("warning", "Buddy Request Failed", "Sorry, you already have the maximum number of buddies.");
  320.             break;
  321.         }
  322.         case -2:
  323.         {
  324.             _root.displayAlert("warning", "Buddy Request Failed", "Sorry, this user already has the maximum number of buddies.");
  325.             break;
  326.         }
  327.     } // End of switch
  328. } // End of the function
  329. function inquiryNimAnswerCB(recID, recName, answer)
  330. {
  331.     if (answer == 1)
  332.     {
  333.         classes.Console.changeOutgoingItemStatus(recID, 1);
  334.         inquiryNimOK(recID);
  335.     }
  336.     else
  337.     {
  338.         classes.Console.changeOutgoingItemStatus(recID, 0);
  339.     } // end else if
  340. } // End of the function
  341. function inquiryNimOK(recID)
  342. {
  343.     getURL("lingo: NIMOKRESPONSE " + recID, "");
  344. } // End of the function
  345. function deleteNimInquiredUser(aid)
  346. {
  347.     getURL("lingo: DELETENIMINQUIREDUSER " + aid, "");
  348. } // End of the function
  349. function deleteNimInquiredUserCB(s)
  350. {
  351.     if (s)
  352.     {
  353.        
  354.     } // end if
  355. } // End of the function
  356. function deleteNimInquireeUserCB(aid)
  357. {
  358.     for (var _loc2 = 0; _loc2 < _global.incomingRequestsXML.firstChild.childNodes.length; ++_loc2)
  359.     {
  360.         if (_global.incomingRequestsXML.firstChild.childNodes[_loc2].attributes.i == aid)
  361.         {
  362.             _global.incomingRequestsXML.firstChild.childNodes[_loc2].removeNode();
  363.             if (classes.Console._BASE.panel.tbB.scrollerReq._visible)
  364.             {
  365.                 classes.Console._BASE.panel.refreshMe();
  366.             } // end if
  367.             break;
  368.         } // end if
  369.     } // end of for
  370. } // End of the function
  371. function getNimIncomingRequests()
  372. {
  373.     getURL("lingo: GETNIMINREQUESTS");
  374. } // End of the function
  375. function getNimIncomingRequestsCB(xmlStr)
  376. {
  377.     _global.incomingRequestsXML = new XML();
  378.     _global.incomingRequestsXML.ignoreWhite = true;
  379.     _global.incomingRequestsXML.parseXML(xmlStr);
  380.     getNimOutgoingRequests();
  381. } // End of the function
  382. function getNimOutgoingRequests()
  383. {
  384.     getURL("lingo: GETNIMOUTREQUESTS");
  385. } // End of the function
  386. function getNimOutgoingRequestsCB(xmlStr)
  387. {
  388.     _global.outgoingRequestsXML = new XML();
  389.     _global.outgoingRequestsXML.ignoreWhite = true;
  390.     _global.outgoingRequestsXML.parseXML(xmlStr);
  391.     classes.Console._BASE.panel.tbB.showRequests = true;
  392.     if (classes.Console.panelNum == 2)
  393.     {
  394.         classes.Console._BASE.panel.refreshMe();
  395.     }
  396.     else
  397.     {
  398.         classes.Console.changePanel(2);
  399.     } // end else if
  400. } // End of the function
  401. function chatListRoom2(raceTrackID, typeID)
  402. {
  403.     getURL("lingo: LISTRACECHATROOMS2 " + raceTrackID + ", " + typeID, "");
  404. } // End of the function
  405. function chatListRoom2CB(d)
  406. {
  407.     _global.chatRoomListXML = new XML();
  408.     _global.chatRoomListXML.ignoreWhite = true;
  409.     _global.chatRoomListXML.parseXML(d);
  410.     if (classes.GlobalData.prefsObj.didViewRace)
  411.     {
  412.         _global.chatRoomListMC.gotoAndPlay("showList");
  413.     }
  414.     else
  415.     {
  416.         _global.roomJoinTrys = 0;
  417.         _global.roomCreateTrys = 0;
  418.         joinNewbieRivalsChat();
  419.     } // end else if
  420. } // End of the function
  421. function joinNewbieRivalsChat()
  422. {
  423.     var _loc4 = _global.chatRoomListXML;
  424.     var _loc10 = false;
  425.     var _loc9 = 0;
  426.     var _loc7 = 0;
  427.     var _loc8 = 0;
  428.     for (var _loc2 = 0; _loc2 < _loc4.firstChild.childNodes.length; ++_loc2)
  429.     {
  430.         var _loc3 = _loc4.firstChild.childNodes[_loc2].attributes.rc;
  431.         var _loc6 = _loc4.firstChild.childNodes[_loc2].attributes.cy;
  432.         var _loc5 = _loc4.firstChild.childNodes[_loc2].attributes.sm;
  433.         if (_loc5 == 1)
  434.         {
  435.             if (_loc3 >= _loc7 && _loc3 < _loc6)
  436.             {
  437.                 _loc10 = true;
  438.                 _loc7 = _loc3;
  439.                 _loc8 = _loc2;
  440.             } // end if
  441.             ++_loc9;
  442.         } // end if
  443.     } // end of for
  444.     _global.newbieRoom = true;
  445.     if (_loc10 == true)
  446.     {
  447.         _global.tempPCID = _loc4.firstChild.childNodes[_loc8].attributes.cid;
  448.         _global.tempPCY = _loc4.firstChild.childNodes[_loc8].attributes.cy;
  449.         _global.newRoomName = _loc4.firstChild.childNodes[_loc8].attributes.rn;
  450.         chatJoin(5, _loc4.firstChild.childNodes[_loc8].attributes.cid, "", 0);
  451.     }
  452.     else
  453.     {
  454.         ++_loc9;
  455.         var _loc11 = "Newbie Rivals Strip " + _loc9;
  456.         _global.newRoomName = _loc11;
  457.         chatCreateRoom(5, 20, _loc11, 0, "", 0);
  458.     } // end else if
  459. } // End of the function
  460. function chatCreateRoom(raceTrackID, typeID, roomName, isPrivate, pw, memberOnly)
  461. {
  462.     _global.chatRoomIDTracker = typeID;
  463.     getURL("lingo: CREATECHATROOM " + raceTrackID + ", " + typeID + ", \"" + escape(roomName) + "\", " + isPrivate + ", \"" + escape(pw) + "\", " + memberOnly, "");
  464. } // End of the function
  465. function chatCreateRoomCB(s, d)
  466. {
  467.     if (!classes.GlobalData.prefsObj.didViewRace)
  468.     {
  469.         if (s != 1)
  470.         {
  471.             classes.GlobalData.prefsObj.didViewRace = 1;
  472.             classes.GlobalData.savePrefsObj();
  473.             _root.play();
  474.         } // end if
  475.     }
  476.     else
  477.     {
  478.         switch (s)
  479.         {
  480.             case 1:
  481.             {
  482.                 var _loc4 = new XML(d);
  483.                 break;
  484.             }
  485.             case 0:
  486.             {
  487.                 classes.Control.dialogAlert("Server Error", "Sorry, for some reason the room could not be created.");
  488.                 break;
  489.             }
  490.             case -1:
  491.             {
  492.                 classes.Control.dialogAlert("Banned", "You can not create a room because you have been banned from chatrooms.");
  493.                 break;
  494.             }
  495.             case -2:
  496.             {
  497.                 classes.Control.dialogAlert("Not a Member", "You can not create a Members Room because you are not a member.");
  498.                 break;
  499.             }
  500.             case -3:
  501.             {
  502.                 classes.Control.dialogAlert("Illegal Values", "Illegal values were received. Field lengths are too long.");
  503.                 break;
  504.             }
  505.             case -4:
  506.             {
  507.                 classes.Control.dialogAlert("Room Name Not Allowed", "Sorry, the Room Name you entered is not allowed.");
  508.                 break;
  509.             }
  510.             case -5:
  511.             {
  512.                 classes.Control.dialogAlert("Room Type Not Allowed", "Sorry, the Room Type you entered is not allowed.");
  513.                 break;
  514.             }
  515.             case -6:
  516.             {
  517.                 classes.Control.dialogAlert("Room Type Not Allowed", "Sorry, specator room creation is not allowed when there\'s no tournament running.");
  518.                 break;
  519.             }
  520.             case -7:
  521.             {
  522.                 classes.Control.dialogAlert("Must be in a Team", "Sorry, you must be a team member to create this room.");
  523.                 _global.sectionTrackMC.clearWait();
  524.                 break;
  525.             }
  526.             case -8:
  527.             {
  528.                 classes.Control.dialogAlert("No Interview", "Sorry, the interview is over.");
  529.                 classes.SectionModElection.MC.clearWait();
  530.                 break;
  531.             }
  532.         } // End of switch
  533.     } // end else if
  534. } // End of the function
  535. function chatJoin(raceTrackID, chatRoomID, pw, asInvisible)
  536. {
  537.     if (!asInvisible)
  538.     {
  539.         asInvisible = 0;
  540.     } // end if
  541.     getURL("lingo: JOINRACECHAT " + raceTrackID + ", " + chatRoomID + ", \"" + escape(pw) + "\", " + asInvisible, "");
  542. } // End of the function
  543. function chatJoinCB(s)
  544. {
  545.     if (!classes.GlobalData.prefsObj.didViewRace)
  546.     {
  547.         if (s == 1)
  548.         {
  549.             _root.play();
  550.         }
  551.         else
  552.         {
  553.             ++_global.roomJoinTrys;
  554.             if (_global.roomJoinTrys == 4)
  555.             {
  556.                 classes.GlobalData.prefsObj.didViewRace = 1;
  557.                 classes.GlobalData.savePrefsObj();
  558.                 _root.play();
  559.             }
  560.             else
  561.             {
  562.                 joinNewbieRivalsChat();
  563.             } // end else if
  564.         } // end else if
  565.     }
  566.     else
  567.     {
  568.         chatRoomJoined(s);
  569.     } // end else if
  570. } // End of the function
  571. function joinRivalsRoom()
  572. {
  573.     isInAChat = true;
  574.     _root.abc.closeMe();
  575.     _global.sectionTrackMC.showRaceRoom(5);
  576. } // End of the function
  577. function chatRoomJoined(s)
  578. {
  579.     if (_global.electionChatRoom == true)
  580.     {
  581.         _global.sectionTrackMC = classes.SectionModElection.MC;
  582.     } // end if
  583.     switch (s)
  584.     {
  585.         case 1:
  586.         {
  587.             isInAChat = true;
  588.             _root.abc.closeMe();
  589.             if (_global.electionChatRoom == true)
  590.             {
  591.                 classes.SectionModElection.MC.showRaceRoom(false);
  592.             }
  593.             else
  594.             {
  595.                 _global.sectionTrackMC.showRaceRoom();
  596.             } // end else if
  597.             break;
  598.         }
  599.         case 0:
  600.         {
  601.             classes.Control.dialogAlert("Room Does Not Exist", "Sorry, the room you are trying to enter no longer exists. Everyone in the room must have left before you entered.");
  602.             _global.sectionTrackMC.clearWait();
  603.             break;
  604.         }
  605.         case -1:
  606.         {
  607.             classes.Control.dialogAlert("Room Is Full", "Sorry, this room is full. You can try again later, or find another room to join.");
  608.             _global.sectionTrackMC.clearWait();
  609.             break;
  610.         }
  611.         case -2:
  612.         {
  613.             classes.Control.dialogAlert("Banned User", "Sorry, you can not enter because you have been banned from this room.");
  614.             _global.sectionTrackMC.clearWait();
  615.             break;
  616.         }
  617.         case -3:
  618.         {
  619.             _root.abc.contentMC.showWrongPW();
  620.             _global.sectionTrackMC.clearWait();
  621.             break;
  622.         }
  623.         case -4:
  624.         {
  625.             classes.Control.dialogAlert("Access Denied", "Sorry, this room is restricted to members only.\rYou must have a valid game membership in order to enter this room.");
  626.             _global.sectionTrackMC.clearWait();
  627.             break;
  628.         }
  629.         case -5:
  630.         {
  631.             classes.Control.dialogAlert("Too Many Moderators", "Sorry, this room already has the maximum number of moderators allowed.");
  632.             _global.sectionTrackMC.clearWait();
  633.             break;
  634.         }
  635.         case -6:
  636.         {
  637.             classes.Control.dialogAlert("Access Denied", "Sorry, this room is restricted.");
  638.             _global.sectionTrackMC.clearWait();
  639.             break;
  640.         }
  641.         case -7:
  642.         {
  643.             classes.Control.dialogAlert("No Tournament", "Sorry, there is no tournament currently running.");
  644.             _global.sectionTrackMC.clearWait();
  645.             break;
  646.         }
  647.         case -8:
  648.         {
  649.             classes.Control.dialogAlert("Must be in a Team", "Sorry, you must be a team member to join this room.");
  650.             _global.sectionTrackMC.clearWait();
  651.             break;
  652.         }
  653.         case -9:
  654.         {
  655.             classes.Control.dialogAlert("No Interview", "Sorry, the interview is over.");
  656.             classes.SectionModElection.MC.clearWait();
  657.             break;
  658.         }
  659.     } // End of switch
  660. } // End of the function
  661. function chatLeave()
  662. {
  663.     if (isInAChat)
  664.     {
  665.         getURL("lingo: LEAVERACECHAT");
  666.         isInAChat = false;
  667.     } // end if
  668. } // End of the function
  669. function chatListUsers()
  670. {
  671.     getURL("lingo: LISTRACECHATUSERS");
  672. } // End of the function
  673. function chatListUsersCB(d)
  674. {
  675.     _global.chatObj.userListXML = new XML(d);
  676.     var _loc3;
  677.     for (var _loc2 = 0; _loc2 < _global.chatObj.userListXML.firstChild.childNodes.length; ++_loc2)
  678.     {
  679.         _loc3 = Number(_global.chatObj.userListXML.firstChild.childNodes[_loc2].attributes.i);
  680.         classes.Lookup.addUserName(_loc3, _global.chatObj.userListXML.firstChild.childNodes[_loc2].attributes.un);
  681.         classes.Lookup.removeFromRaceCarsXMLByUser(_loc3);
  682.     } // end of for
  683.     _global.chatObj.raceRoomMC.CB_listUsers();
  684. } // End of the function
  685. function chatUpdateUserCB(d)
  686. {
  687.     var _loc4 = new XML(d);
  688.     var _loc5 = false;
  689.     var _loc6 = false;
  690.     var _loc2;
  691.     for (var _loc3 = 0; _loc3 < _loc4.firstChild.childNodes.length; ++_loc3)
  692.     {
  693.         _loc2 = _loc4.firstChild.childNodes[_loc3];
  694.         if (_loc2.attributes.ul == "0")
  695.         {
  696.             _global.chatObj.userListXML.firstChild.appendChild(_loc2);
  697.             classes.Lookup.addUserName(Number(_loc2.attributes.i), _loc2.attributes.un);
  698.             classes.Lookup.removeFromRaceCarsXMLByUser(Number(_loc2.attributes.i));
  699.             _loc5 = true;
  700.             continue;
  701.         } // end if
  702.         if (_loc2.attributes.ul == "1")
  703.         {
  704.             _global.chatObj.raceRoomMC.userLeaves(Number(_loc2.attributes.i));
  705.             _loc6 = true;
  706.         } // end if
  707.     } // end of for
  708.     if (classes.RacePlay._MC.myLane)
  709.     {
  710.         return;
  711.     } // end if
  712.     if (_loc5)
  713.     {
  714.         delete _global.CB_getTwoRacersCars;
  715.         _global.chatObj.raceRoomMC.CB_listUsers();
  716.     }
  717.     else if (_loc6)
  718.     {
  719.         _global.chatObj.raceRoomMC.drawUserList();
  720.         _global.chatObj.raceRoomMC.drawQueue();
  721.         classes.RivalsChallengePanel._MC.drawIncomingList();
  722.     } // end else if
  723. } // End of the function
  724. function chatSend(msg)
  725. {
  726.     msg = msg.split("\r").join(" ");
  727.     msg = msg.split("\n").join(" ");
  728.     msg = classes.data.Validate.cleanMessage(msg);
  729.     msg = classes.SpecialText.convertFromSmilies(msg);
  730.     msg = classes.data.Profanity.filterString(msg);
  731.     getURL("lingo: SENDRACECHAT \"" + escape(msg) + "\"", "");
  732. } // End of the function
  733. function chatGetCB(classNum, username, msg)
  734. {
  735.     if (_global.electionChatRoom == true)
  736.     {
  737.         var _loc4 = false;
  738.         if (classes.SectionModElection.MC.isJudge(username) || classes.SectionModElection.MC.isInterviewee(username))
  739.         {
  740.             _loc4 = true;
  741.         } // end if
  742.         if (classes.SectionModElection.MC._isInterviewRoom == true || _loc4 == false)
  743.         {
  744.             classes.Chat.addToHistory(classNum, username, classes.data.Profanity.filterString(msg));
  745.         } // end if
  746.         if (_loc4 == true)
  747.         {
  748.             classes.SectionModElection.MC.displayElectionInterviewMessage(username, classes.data.Profanity.filterString(msg));
  749.         } // end if
  750.     }
  751.     else if (username == "System" && msg == "****** You must verify your account to send a message here. ******")
  752.     {
  753.         _root.displayAlert("warning", "Verification Required", "Sorry, you must verify your account to send a message here.");
  754.     }
  755.     else
  756.     {
  757.         classes.Chat.addToHistory(classNum, username, classes.data.Profanity.filterString(msg));
  758.     } // end else if
  759. } // End of the function
  760. function chatKickCB(d)
  761. {
  762.     var _loc3 = new XML(d);
  763.     if (_global.electionChatRoom == true)
  764.     {
  765.         classes.SectionModElection.MC.cleanUp();
  766.         classes.Lookup.addCallback("setElectionPhase", classes.SectionModElection.MC, classes.SectionModElection.MC.setElectionPhase, "1");
  767.         _root.getElectionPhase(1);
  768.     }
  769.     else
  770.     {
  771.         _global.sectionTrackMC.gotoAndPlay("map");
  772.     } // end else if
  773.     _root.displayAlert("warningtriangle", "Removed From Room", _loc3.firstChild.attributes.r + "\r\r- " + _loc3.firstChild.attributes.u);
  774. } // End of the function
  775. function raceEngineInit(raceControlMC, raceTreeMC)
  776. {
  777.     raceMovie = raceControlMC;
  778.     raceTreeMovie = raceTreeMC;
  779.     raceSound = new classes.RaceSound();
  780.     getURL("lingo: runEngineGaugeInit");
  781. } // End of the function
  782. function runEngineGaugeInitCB(redLine, nosSize, nosRemain, boostType)
  783. {
  784.     raceMovie.RpmRedLine = redLine;
  785.     raceMovie.initNos(nosSize, nosRemain);
  786.     raceMovie.initBoost(boostType);
  787.     raceSound.__set__RpmRedLine(redLine);
  788. } // End of the function
  789. function runEngine(throttlePercent)
  790. {
  791.     this.now = new Date();
  792.     this.t = getTimer();
  793.     this.frameRate = Math.round(1000 / (this.t - this.o));
  794.     this.systemFrameRate = Math.round(1000 / (this.now.getMilliseconds() - this.onow.getMilliseconds()));
  795.     this.o = this.t;
  796.     this.onow = this.now;
  797.     getURL("lingo: runEngine " + throttlePercent, "");
  798. } // End of the function
  799. function runEngineCB(rpm, mph, d, boostPSI, timeIndex)
  800. {
  801.     raceSound.playEngineSound(rpm, boostPSI);
  802.     if (d > -2 && d < 1)
  803.     {
  804.         classes.RacePlay._MC.isStaged = true;
  805.     }
  806.     else if (!classes.RacePlay._MC.raceStarted)
  807.     {
  808.         classes.RacePlay._MC.isStaged = false;
  809.     } // end else if
  810.     raceMovie.s.text = d;
  811.     raceMovie.gaugeCluster.mphMovie.mph.text = Math.floor(mph);
  812.     raceMovie.rpm.text = rpm;
  813.     raceMovie.updateRPM(rpm);
  814.     raceMovie.updateBoost(boostPSI);
  815.     var _loc3 = mph * 1.466667;
  816.     classes.RacePlay._MC.updateDistance(classes.RacePlay._MC.myLane, d, classes.RacePlay._MC.raceStarted, _loc3, 0, timeIndex);
  817.     classes.RacePlay._MC.amComp.renderBothCars();
  818.     classes.RacePlay._MC.amLive.renderBothCars();
  819. } // End of the function
  820. function runEngineGearUp()
  821. {
  822.     getURL("lingo: runEngineGearUp");
  823. } // End of the function
  824. function runEngineGearDown()
  825. {
  826.     getURL("lingo: runEngineGearDown");
  827. } // End of the function
  828. function runEngineGearUpdateCB(gearNum)
  829. {
  830.     raceSound.playGearSound();
  831.     if (gearNum == -1)
  832.     {
  833.         raceMovie.gearCluster.gear.text = "R";
  834.     }
  835.     else if (gearNum == 0)
  836.     {
  837.         raceMovie.gearCluster.gear.text = "N";
  838.     }
  839.     else
  840.     {
  841.         raceMovie.gearCluster.gear.text = gearNum;
  842.         classes.RacePlay._MC.playEffect("gear" + gearNum);
  843.     } // end else if
  844. } // End of the function
  845. function runEngineSetBrake(brake)
  846. {
  847.     getURL("lingo: runEngineSetBrake " + brake, "");
  848. } // End of the function
  849. function runEngineSetClutch(clutchFeather)
  850. {
  851.     getURL("lingo: runEngineSetClutch " + clutchFeather, "");
  852. } // End of the function
  853. function runEngineSetNOS(nosState)
  854. {
  855.     getURL("lingo: runEngineSetNOS " + nosState, "");
  856.     if (nosState == 0)
  857.     {
  858.         raceSound.stopNitrousSound();
  859.     } // end if
  860. } // End of the function
  861. function runEngineNOSCB(nosPercent)
  862. {
  863.     if (nosPercent <= 0)
  864.     {
  865.         raceSound.stopNitrousSound();
  866.     }
  867.     else
  868.     {
  869.         raceSound.playNitrousSound();
  870.     } // end else if
  871.     raceMovie.updateNos(nosPercent);
  872. } // End of the function
  873. function runEngineTractionLightCB(isOn)
  874. {
  875.     if (isOn)
  876.     {
  877.         raceMovie.tractionIcon.gotoAndStop("on");
  878.     }
  879.     else
  880.     {
  881.         raceMovie.tractionIcon.gotoAndStop("off");
  882.     } // end else if
  883.     raceSound.updateScreech(isOn);
  884. } // End of the function
  885. function runEngineStageLightCB(isMyCar, staged, preStaged)
  886. {
  887.     raceTreeMovie.setLight(isMyCar ? (_global.chatObj.raceRoomMC.container.myLane) : (_global.chatObj.raceRoomMC.container.oppLane), "staged", staged);
  888.     raceTreeMovie.setLight(isMyCar ? (_global.chatObj.raceRoomMC.container.myLane) : (_global.chatObj.raceRoomMC.container.oppLane), "pre", preStaged);
  889. } // End of the function
  890. function runEngineSetLightOnCB(position, lightName)
  891. {
  892.     if (position == "1T" || positiong == "2T")
  893.     {
  894.         _global.setTimeout(this, "do_runEngineSetLightOnCB", 2000, position, lightName);
  895.     }
  896.     else
  897.     {
  898.         do_runEngineSetLightOnCB(position, lightName);
  899.     } // end else if
  900. } // End of the function
  901. function do_runEngineSetLightOnCB(position, lightName)
  902. {
  903.     var _loc2;
  904.     var _loc5;
  905.     switch (position)
  906.     {
  907.         case "p":
  908.         {
  909.             _loc2 = _global.chatObj.raceRoomMC.container.myLane;
  910.             _loc5 = true;
  911.             break;
  912.         }
  913.         case "o":
  914.         {
  915.             _loc2 = _global.chatObj.raceRoomMC.container.oppLane;
  916.             _loc5 = true;
  917.             break;
  918.         }
  919.         case "1":
  920.         case "1T":
  921.         {
  922.             _loc2 = 1;
  923.             break;
  924.         }
  925.         case "2":
  926.         case "2T":
  927.         {
  928.             _loc2 = 2;
  929.             break;
  930.         }
  931.         case "b":
  932.         case "s":
  933.         case "sT":
  934.         {
  935.             _loc2 = 0;
  936.             break;
  937.         }
  938.     } // End of switch
  939.     var _loc3;
  940.     if (_loc5)
  941.     {
  942.         _loc3 = classes.RacePlay._MC.tree;
  943.     }
  944.     else
  945.     {
  946.         _loc3 = classes.Race._MC.tree;
  947.     } // end else if
  948.     if (lightName == "red")
  949.     {
  950.         _loc3.setLight(_loc2, "green", false);
  951.         _loc3.setLight(_loc2, lightName, true);
  952.     }
  953.     else
  954.     {
  955.         if ((_loc2 == 0 || _loc2 == 1) && !_loc3.red1._visible)
  956.         {
  957.             _loc3.setLight(1, lightName, true);
  958.         } // end if
  959.         if ((_loc2 == 0 || _loc2 == 2) && !_loc3.red2._visible)
  960.         {
  961.             _loc3.setLight(2, lightName, true);
  962.         } // end if
  963.     } // end else if
  964. } // End of the function
  965. function runEngineSetMyRTCB(rt)
  966. {
  967.     classes.RacePlay._MC.tripWire(classes.GlobalData.id, rt);
  968.     if (rt < 0)
  969.     {
  970.         classes.Control.ctourneyMC.finishCompRace(-1, -1);
  971.     } // end if
  972. } // End of the function
  973. function raceStartTimeCB()
  974. {
  975.     classes.RacePlay._MC.onRaceStartTime();
  976. } // End of the function
  977. function raceEngineRaceInProgressCB(d)
  978. {
  979.     function CB_getTwoRacersCars(txml)
  980.     {
  981.         _global.chatObj.twoRacersCarsXML = txml;
  982.     } // End of the function
  983.     var _loc4 = new XML(d);
  984.     _global.chatObj.raceObj = new Object();
  985.     _global.chatObj.raceObj.inp = true;
  986.     _global.chatObj.raceObj.inp2 = true;
  987.     _global.chatObj.raceObj.r1Obj = new Object();
  988.     _global.chatObj.raceObj.r2Obj = new Object();
  989.     _global.chatObj.raceObj.r1Obj.id = _loc4.firstChild.attributes.r1id;
  990.     _global.chatObj.raceObj.r1Obj.cid = _loc4.firstChild.attributes.r1acid;
  991.     _global.chatObj.raceObj.r2Obj.id = _loc4.firstChild.attributes.r2id;
  992.     _global.chatObj.raceObj.r2Obj.cid = _loc4.firstChild.attributes.r2acid;
  993.     _global.chatObj.raceObj.r1Obj.ti = _loc4.firstChild.attributes.r1tid;
  994.     _global.chatObj.raceObj.r2Obj.ti = _loc4.firstChild.attributes.r2tid;
  995.     _global.chatObj.raceObj.r1Obj.sc = _loc4.firstChild.attributes.sc1;
  996.     _global.chatObj.raceObj.r2Obj.sc = _loc4.firstChild.attributes.sc2;
  997.     classes.Lookup.addCallback("raceGetTwoRacersCars", this, CB_getTwoRacersCars, _global.chatObj.raceObj.r1Obj.cid + "," + _global.chatObj.raceObj.r2Obj.cid);
  998.     _root.raceGetTwoRacersCars(_global.chatObj.raceObj.r1Obj.cid, _global.chatObj.raceObj.r2Obj.cid);
  999. } // End of the function
  1000. function runEngineDamageLightCB()
  1001. {
  1002.     raceMovie.damageLight.gotoAndStop(2);
  1003. } // End of the function
  1004. function raceSpectateCB(d)
  1005. {
  1006.     var _loc8 = new XML(d);
  1007.     var _loc3 = Number(_loc8.firstChild.attributes.r);
  1008.     var _loc9 = Number(_loc8.firstChild.attributes.t.split(",")[0]);
  1009.     var _loc4 = Math.ceil(_loc9 / 200);
  1010.     var _loc13 = 200;
  1011.     var _loc10 = Math.floor(_loc9 / _loc13);
  1012.     if (!_loc10)
  1013.     {
  1014.         _loc10 = 0;
  1015.     } // end if
  1016.     if ((_loc4 || _loc4 === 0) && !_global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr)
  1017.     {
  1018.         _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr = new Array();
  1019.         _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr[0] = -1;
  1020.         _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr[Math.max(0, _loc10 - 1)] = Number(_loc8.firstChild.attributes.d.split(",")[0]);
  1021.         classes.Race._MC.startSpectatorController(_loc9);
  1022.     }
  1023.     else if (!_loc4 && !_global.chatObj.raceObj["r" + _loc3 + "Obj"].sArr)
  1024.     {
  1025.         _global.chatObj.raceObj["r" + _loc3 + "Obj"].sArr = new Array();
  1026.         classes.Race._MC.startStagingController();
  1027.     } // end else if
  1028.     var _loc11 = _loc8.firstChild.attributes.d.split(",");
  1029.     if (_loc4 || _loc4 === 0)
  1030.     {
  1031.         if (_global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr.length - 1 < _loc4)
  1032.         {
  1033.             var _loc5 = _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr.length - _loc4;
  1034.             if (_loc5 > 1)
  1035.             {
  1036.                 var _loc6 = _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr[_global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr.length - 1];
  1037.                 var _loc12 = Number(_loc11[0]);
  1038.                 var _loc7 = (_loc12 - _loc6) / _loc5;
  1039.                 for (var _loc2 = 1; _loc2 < _loc5; ++_loc2)
  1040.                 {
  1041.                     _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr.push(_loc6 + _loc2 * _loc7);
  1042.                 } // end of for
  1043.             } // end if
  1044.         } // end if
  1045.         if (_global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr.length > _loc4)
  1046.         {
  1047.             _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr.splice(_loc4);
  1048.         } // end if
  1049.         _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr = _global.chatObj.raceObj["r" + _loc3 + "Obj"].dArr.concat(_loc11);
  1050.     }
  1051.     else if (!_loc4)
  1052.     {
  1053.         _global.chatObj.raceObj["r" + _loc3 + "Obj"].sArr = _global.chatObj.raceObj["r" + _loc3 + "Obj"].sArr.concat(_loc11);
  1054.     } // end else if
  1055. } // End of the function
  1056. function runEngineStart()
  1057. {
  1058.     getURL("lingo: runEngineStart");
  1059. } // End of the function
  1060. function runEngineStop()
  1061. {
  1062.     getURL("lingo: runEngineStop");
  1063. } // End of the function
  1064. function chatKOTHGet()
  1065. {
  1066.     getURL("lingo: GETKOTH");
  1067. } // End of the function
  1068. function chatKOTHJoin(acid, bt)
  1069. {
  1070.     classes.GlobalData.setMyRaceCarNode(acid);
  1071.     if (!bt)
  1072.     {
  1073.         bt = -1;
  1074.     } // end if
  1075.     getURL("lingo: JOINKOTH " + acid + ", " + bt, "");
  1076. } // End of the function
  1077. function chatKOTHJoinCB(s)
  1078. {
  1079.     _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp.gotoAndStop(1);
  1080.     _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp._visible = true;
  1081.     switch (s)
  1082.     {
  1083.         case -1:
  1084.         {
  1085.             break;
  1086.         }
  1087.         case -2:
  1088.         {
  1089.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  1090.             break;
  1091.         }
  1092.         case -3:
  1093.         {
  1094.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected doesn\'t belong to you.");
  1095.             break;
  1096.         }
  1097.         case -4:
  1098.         {
  1099.             _root.displayAlert("warning", "Invalid Dial In Time", "I\'m sorry, but the dial-in time you entered is not valid.");
  1100.             break;
  1101.         }
  1102.         case -5:
  1103.         {
  1104.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is locked.");
  1105.             break;
  1106.         }
  1107.         case -6:
  1108.         {
  1109.             _root.markTestDriveExpiredAndDisplayWarning();
  1110.             break;
  1111.         }
  1112.         case -50:
  1113.         {
  1114.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  1115.             break;
  1116.         }
  1117.         case -60:
  1118.         {
  1119.             _root.displayAlert("warning", "Account Verification Required", "I\'m sorry, but you need to verify your account to perform this action.");
  1120.             break;
  1121.         }
  1122.     } // End of switch
  1123. } // End of the function
  1124. function chatKOTHNewRacerCB(aid, acid)
  1125. {
  1126.     var _loc2 = new XMLNode(1, "k");
  1127.     _loc2.attributes.i = aid;
  1128.     _loc2.attributes.ci = acid;
  1129.     _global.chatObj.queueXML.firstChild.appendChild(_loc2);
  1130.     if (classes.GlobalData.id == aid)
  1131.     {
  1132.         _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp.gotoAndStop("inLine");
  1133.         _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp._visible = true;
  1134.     } // end if
  1135.     _global.chatObj.raceRoomMC.drawQueue();
  1136. } // End of the function
  1137. function chatKOTHUsersCB(d)
  1138. {
  1139.     _global.chatObj.queueXML = new XML(d);
  1140.     if (Number(_global.chatObj.queueXML.firstChild.firstChild.attributes.ks) > 0)
  1141.     {
  1142.         var _loc2 = _global.chatObj.raceRoomMC.kingObj;
  1143.         _loc2.id = Number(_global.chatObj.queueXML.firstChild.firstChild.attributes.i);
  1144.         _loc2.ks = Number(_global.chatObj.queueXML.firstChild.firstChild.attributes.ks);
  1145.         _loc2.cid = Number(_global.chatObj.queueXML.firstChild.firstChild.attributes.ci);
  1146.         _loc2.username = _global.chatObj.raceRoomMC.lookupUsername(_loc2.id);
  1147.     } // end if
  1148.     _global.chatObj.raceRoomMC.checkForData();
  1149. } // End of the function
  1150. function chatKOTHNRaceCB(d)
  1151. {
  1152.     function CB_getTwoRacersCars(pxml)
  1153.     {
  1154.         var _loc3 = 10000;
  1155.         var _loc2;
  1156.         if (_global.chatObj.lastResultsTS)
  1157.         {
  1158.             _loc2 = new Date() - _global.chatObj.lastResultsTS;
  1159.         }
  1160.         else
  1161.         {
  1162.             _loc2 = _loc3;
  1163.         } // end else if
  1164.         if (_loc2 < _loc3)
  1165.         {
  1166.             _global.setTimeout(nextRace, _loc3 - _loc2, pxml);
  1167.         }
  1168.         else
  1169.         {
  1170.             nextRace(pxml);
  1171.         } // end else if
  1172.     } // End of the function
  1173.     function nextRace(pxml)
  1174.     {
  1175.         _global.chatObj.twoRacersCarsXML = pxml;
  1176.         if (classes.GlobalData.id == _global.chatObj.raceObj.r1Obj.id)
  1177.         {
  1178.             _global.chatObj.raceObj.isRacer = true;
  1179.             _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp._visible = false;
  1180.             classes.GlobalData.setMyRaceCarNode(_global.chatObj.raceObj.r1Obj.cid);
  1181.             if (Number(_global.chatObj.queueXML.firstChild.firstChild.attributes.ks) <= 0)
  1182.             {
  1183.                 _global.setTimeout(showChal2, 2000);
  1184.             }
  1185.             else
  1186.             {
  1187.                 _global.setTimeout(showKingChal, 2000);
  1188.             } // end else if
  1189.         }
  1190.         else if (classes.GlobalData.id == _global.chatObj.raceObj.r2Obj.id)
  1191.         {
  1192.             _global.chatObj.raceObj.isRacer = true;
  1193.             _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp._visible = false;
  1194.             classes.GlobalData.setMyRaceCarNode(_global.chatObj.raceObj.r2Obj.cid);
  1195.             _global.setTimeout(showChal2, 2000);
  1196.         }
  1197.         else
  1198.         {
  1199.             _global.chatObj.raceObj.isRacer = false;
  1200.         } // end else if
  1201.     } // End of the function
  1202.     function showChal2()
  1203.     {
  1204.         _global.chatObj.raceRoomMC.showChallengerNew2();
  1205.     } // End of the function
  1206.     function showKingChal()
  1207.     {
  1208.         _global.chatObj.raceRoomMC.showKingChallenge();
  1209.     } // End of the function
  1210.     var _loc4 = new XML(d);
  1211.     _global.chatObj.newRaceTS = new Date();
  1212.     _global.chatObj.queueXML.firstChild.childNodes[0].attributes.sc = _loc4.firstChild.attributes.sc1;
  1213.     _global.chatObj.queueXML.firstChild.childNodes[1].attributes.sc = _loc4.firstChild.attributes.sc2;
  1214.     _global.chatObj.raceObj = new Object();
  1215.     _global.chatObj.raceObj.r1Obj = new Object();
  1216.     _global.chatObj.raceObj.r2Obj = new Object();
  1217.     _global.chatObj.raceObj.r1Obj.id = _loc4.firstChild.attributes.r1id;
  1218.     _global.chatObj.raceObj.r1Obj.cid = _loc4.firstChild.attributes.r1cid;
  1219.     _global.chatObj.raceObj.r2Obj.id = _loc4.firstChild.attributes.r2id;
  1220.     _global.chatObj.raceObj.r2Obj.cid = _loc4.firstChild.attributes.r2cid;
  1221.     _global.chatObj.raceObj.r1Obj.bt = _loc4.firstChild.attributes.b1;
  1222.     _global.chatObj.raceObj.r2Obj.bt = _loc4.firstChild.attributes.b2;
  1223.     _global.chatObj.raceObj.r1Obj.un = _global.chatObj.raceRoomMC.lookupUserName(_global.chatObj.raceObj.r1Obj.id);
  1224.     _global.chatObj.raceObj.r2Obj.un = _global.chatObj.raceRoomMC.lookupUserName(_global.chatObj.raceObj.r2Obj.id);
  1225.     _global.chatObj.raceObj.r1Obj.ti = _global.chatObj.raceRoomMC.lookupTeamID(_global.chatObj.raceObj.r1Obj.id);
  1226.     _global.chatObj.raceObj.r2Obj.ti = _global.chatObj.raceRoomMC.lookupTeamID(_global.chatObj.raceObj.r2Obj.id);
  1227.     _global.chatObj.raceObj.r1Obj.tn = _global.chatObj.raceRoomMC.lookupTeamName(_global.chatObj.raceObj.r1Obj.ti);
  1228.     _global.chatObj.raceObj.r2Obj.tn = _global.chatObj.raceRoomMC.lookupTeamName(_global.chatObj.raceObj.r2Obj.ti);
  1229.     _global.chatObj.raceObj.r1Obj.sc = _loc4.firstChild.attributes.sc1;
  1230.     _global.chatObj.raceObj.r2Obj.sc = _loc4.firstChild.attributes.sc2;
  1231.     _global.chatObj.raceObj.timeToRespond = Number(_loc4.firstChild.attributes.t);
  1232.     _global.chatObj.raceObj.mb = _loc4.firstChild.attributes.mb;
  1233.     classes.Lookup.addCallback("raceGetTwoRacersCars", this, CB_getTwoRacersCars, _global.chatObj.raceObj.r1Obj.cid + "," + _global.chatObj.raceObj.r2Obj.cid);
  1234.     _root.raceGetTwoRacersCars(_global.chatObj.raceObj.r1Obj.cid, _global.chatObj.raceObj.r2Obj.cid);
  1235.     false;
  1236. } // End of the function
  1237. function chatKOTHLeave()
  1238. {
  1239.     getURL("lingo: LEAVEKOTH");
  1240. } // End of the function
  1241. function chatKOTHLeaveCB(aid, isKing)
  1242. {
  1243.     var _loc5 = aid == _global.chatObj.raceObj.r1Obj.id || aid == _global.chatObj.raceObj.r2Obj.id;
  1244.     var _loc6 = !_global.chatObj.raceObj.inp2 && (classes.GlobalData.id == _global.chatObj.raceObj.r1Obj.id || classes.GlobalData.id == _global.chatObj.raceObj.r2Obj.id);
  1245.     if (aid == classes.GlobalData.id)
  1246.     {
  1247.         _global.chatObj.raceObj.myTimedOut = true;
  1248.         _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp.gotoAndStop(1);
  1249.         _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp._visible = true;
  1250.         classes.Control.setMapButton("race");
  1251.     }
  1252.     else if (_loc6)
  1253.     {
  1254.         if (_loc5)
  1255.         {
  1256.             if (!_global.chatObj.raceObj.stageTS && !_global.chatObj.raceObj.myTimedOut)
  1257.             {
  1258.                 _global.chatObj.raceObj.r1Obj.id = 0;
  1259.                 _global.chatObj.raceObj.r2Obj.id = 0;
  1260.                 _root.abc.closeMe();
  1261.                 var _loc4 = (classes.AlertBox)(_root.attachMovie("alertBox", "abc", _root.getNextHighestDepth()));
  1262.                 _loc4.setValue("Opponent Chickened Out", "Your opponent chickened out!  You retain your position and await the next challenger.", "warningtriangle");
  1263.                 _loc4.addButton("OK");
  1264.                 _global.chatObj.raceRoomMC.joinPanel.panel.togLineUp._visible = true;
  1265.             } // end if
  1266.         } // end if
  1267.     } // end else if
  1268.     if (isKing)
  1269.     {
  1270.         _root.abc.closeMe();
  1271.         if (!_global.chatObj.raceObj.stageTS || _global.chatObj.raceObj.stageTS && _global.chatObj.raceObj.lastResultsXML)
  1272.         {
  1273.             _global.chatObj.raceRoomMC.showContainer("raceKingStepsDown");
  1274.         } // end if
  1275.     }
  1276.     else
  1277.     {
  1278.         _global.chatObj.raceRoomMC.updateQueue(aid, "", true);
  1279.     } // end else if
  1280. } // End of the function
  1281. function chatCheerVote(isBoo, aid)
  1282. {
  1283.     if (!aid)
  1284.     {
  1285.         aid = 0;
  1286.     } // end if
  1287.     getURL("lingo: SENDVOTE " + isBoo + ", " + aid, "");
  1288. } // End of the function
  1289. function chatCheerVoteCB(s)
  1290. {
  1291.     switch (s)
  1292.     {
  1293.         case 1:
  1294.         {
  1295.             break;
  1296.         }
  1297.         case 0:
  1298.         {
  1299.             break;
  1300.         }
  1301.         case -1:
  1302.         {
  1303.             break;
  1304.         }
  1305.     } // End of switch
  1306. } // End of the function
  1307. function chatCheerGetVoteCB(aid, isBoo, iid)
  1308. {
  1309.     if (_global.chatObj.raceRoomMC.container.linkName == "racePlay")
  1310.     {
  1311.         _global.chatObj.raceRoomMC.container.addVote(aid, isBoo, iid);
  1312.     } // end if
  1313. } // End of the function
  1314. function chatKOTHKingContinue(bet, bt)
  1315. {
  1316.     if (!bet)
  1317.     {
  1318.         bet = 0;
  1319.     } // end if
  1320.     if (!bt)
  1321.     {
  1322.         bt = -1;
  1323.     } // end if
  1324.     getURL("lingo: KCNT " + bet + ", " + bt, "");
  1325. } // End of the function
  1326. function raceKOTHFinishCB(d)
  1327. {
  1328.     if (_global.chatObj.raceObj.isRacer)
  1329.     {
  1330.         do_raceKOTHFinishCB(d);
  1331.     }
  1332.     else
  1333.     {
  1334.         _global.setTimeout(this, "do_raceKOTHFinishCB", 6000, d);
  1335.     } // end else if
  1336. } // End of the function
  1337. function do_raceKOTHFinishCB(d)
  1338. {
  1339.     var _loc2 = new XML(d);
  1340.     _global.chatObj.raceRoomMC.container.crossWire(_loc2.firstChild.attributes.i, _loc2.firstChild.attributes.et, _loc2.firstChild.attributes.ts);
  1341. } // End of the function
  1342. function raceKOTHRTOpponentCB(rt)
  1343. {
  1344.     var _loc3 = _global.chatObj.raceRoomMC.container;
  1345.     var _loc4;
  1346.     if (_loc3.racer1Obj.id == classes.GlobalData.id)
  1347.     {
  1348.         _loc4 = _loc3.racer2Obj.id;
  1349.     }
  1350.     else
  1351.     {
  1352.         _loc4 = _loc3.racer1Obj.id;
  1353.     } // end else if
  1354.     if (rt == -1)
  1355.     {
  1356.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "green", false);
  1357.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "red", true);
  1358.     } // end if
  1359.     _loc3.tripWire(_loc4, rt);
  1360. } // End of the function
  1361. function raceKOTHRTCB(r, rt, i)
  1362. {
  1363.     if (_global.chatObj.raceObj.isRacer)
  1364.     {
  1365.         do_raceKOTHRTCB(r, rt, i);
  1366.     }
  1367.     else
  1368.     {
  1369.         _global.setTimeout(this, "do_raceKOTHRTCB", 6000, r, rt, i);
  1370.     } // end else if
  1371. } // End of the function
  1372. function do_raceKOTHRTCB(r, rt)
  1373. {
  1374.     _global.chatObj.raceRoomMC.container.tripWire(_global.chatObj.raceRoomMC.container["racer" + r + "Obj"].id, rt);
  1375.     if (rt == -1)
  1376.     {
  1377.         _root.raceTreeMovie.setLight(r, "green", false);
  1378.         _root.raceTreeMovie.setLight(r, "red", true);
  1379.     } // end if
  1380. } // End of the function
  1381. function raceKOTHIntOpponentCB(d, v, a, t)
  1382. {
  1383.     if (!_global.chatObj.raceRoomMC.container.raceStarted)
  1384.     {
  1385.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "pre", d > -3 && d < 0);
  1386.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "staged", d > -2 && d < 1);
  1387.     } // end if
  1388.     classes.RacePlay._MC.updateDistance(classes.RacePlay._MC.oppLane, d, classes.RacePlay._MC.raceStarted, v, a, t);
  1389. } // End of the function
  1390. function raceKOTHFoulOpponentCB()
  1391. {
  1392.     _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "green", false);
  1393.     _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "red", true);
  1394. } // End of the function
  1395. function raceKOTHFoulCB(r)
  1396. {
  1397.     _root.raceTreeMovie.setLight(r, "green", false);
  1398.     _root.raceTreeMovie.setLight(r, "red", true);
  1399. } // End of the function
  1400. function raceKOTHOK(bet)
  1401. {
  1402.     if (!bet)
  1403.     {
  1404.         bet = 0;
  1405.     } // end if
  1406.     getURL("lingo: KOK " + bet, "");
  1407. } // End of the function
  1408. function raceKOTHOKCB(bet, t)
  1409. {
  1410.     if (classes.GlobalData.id == _global.chatObj.raceObj.r1Obj.id || classes.GlobalData.id == _global.chatObj.raceObj.r2Obj.id)
  1411.     {
  1412.         classes.Control.setMapButton("racing");
  1413.         _global.chatObj.raceObj.imRacer = true;
  1414.     } // end if
  1415.     _global.chatObj.raceObj.bt = Number(bet);
  1416.     _global.chatObj.raceObj.stageTS = new Date();
  1417.     _global.chatObj.raceObj.timeToStage = t;
  1418.     _global.chatObj.raceRoomMC.showContainer();
  1419. } // End of the function
  1420. function raceKOTHReady(s)
  1421. {
  1422.     getURL("lingo: KREADY " + s, "");
  1423. } // End of the function
  1424. function raceKOTHReadyOpponentCB()
  1425. {
  1426. } // End of the function
  1427. function raceKOTHReadyCB(s, t, t2)
  1428. {
  1429.     if (s == 1)
  1430.     {
  1431.         classes.RacePlay._MC.onRaceStart();
  1432.        
  1433.     } // end if
  1434. } // End of the function
  1435. function raceKOTHNotReadyOpponentCB()
  1436. {
  1437. } // End of the function
  1438. function raceKOTHNotReadyCB(r)
  1439. {
  1440. } // End of the function
  1441. function raceKOTHResultCB(d)
  1442. {
  1443.     _global.chatObj.lastResultsTS = new Date();
  1444.     _global.chatObj.raceRoomMC.onRaceResults(d);
  1445. } // End of the function
  1446. function raceKOTHTimeoutCB(s)
  1447. {
  1448.     switch (s)
  1449.     {
  1450.         case 1:
  1451.         {
  1452.             _global.chatObj.raceObj.myTimedOut = true;
  1453.             _global.chatObj.raceRoomMC.showTimedOut("You failed to continue in time. You have lost your turn to race. If you wish to race you will have to get back in line.");
  1454.             break;
  1455.         }
  1456.         case 2:
  1457.         {
  1458.             _global.chatObj.raceRoomMC.showTimedOut("You failed to stage in time. You automatically foul this race.");
  1459.             break;
  1460.         }
  1461.         case 3:
  1462.         {
  1463.             break;
  1464.         }
  1465.         case 4:
  1466.         {
  1467.             _global.chatObj.raceRoomMC.showTimedOut("You failed to continue in time. You automatically lose your position as King.");
  1468.             break;
  1469.         }
  1470.     } // End of switch
  1471. } // End of the function
  1472. function chatQMHJoin(acid)
  1473. {
  1474.     getURL("lingo: JOINQMH " + acid, "");
  1475. } // End of the function
  1476. function chatQMHJoinCB(s)
  1477. {
  1478.     switch (s)
  1479.     {
  1480.         case 0:
  1481.         {
  1482.             break;
  1483.         }
  1484.         case -1:
  1485.         {
  1486.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  1487.             break;
  1488.         }
  1489.         case -2:
  1490.         {
  1491.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected doesn\'t belong to you.");
  1492.             break;
  1493.         }
  1494.         case -50:
  1495.         {
  1496.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  1497.             break;
  1498.         }
  1499.     } // End of switch
  1500. } // End of the function
  1501. function chatQMHRaceCB(d)
  1502. {
  1503.     classes.Control.quickmatchMC.matchFound(d);
  1504. } // End of the function
  1505. function chatQMHLeave()
  1506. {
  1507.     getURL("lingo: LEAVEQMH");
  1508. } // End of the function
  1509. function chatQMHLeaveCB(s)
  1510. {
  1511.     switch (s)
  1512.     {
  1513.         case 1:
  1514.         {
  1515.             break;
  1516.         }
  1517.         case 0:
  1518.         {
  1519.             break;
  1520.         }
  1521.     } // End of switch
  1522. } // End of the function
  1523. function chatPRChallengeRequest(aid, eacid, racid, bt, bet)
  1524. {
  1525.     getURL("lingo: CHALLENGEREQUEST " + aid + ", " + eacid + ", " + racid + ", " + bt + ", " + bet, "");
  1526. } // End of the function
  1527. function chatPRChallengeRequestCB(s, rid)
  1528. {
  1529.     switch (s)
  1530.     {
  1531.         case 1:
  1532.         {
  1533.             break;
  1534.         }
  1535.         case 0:
  1536.         {
  1537.             break;
  1538.         }
  1539.         case -1:
  1540.         {
  1541.             break;
  1542.         }
  1543.         case -2:
  1544.         {
  1545.             break;
  1546.         }
  1547.     } // End of switch
  1548. } // End of the function
  1549. function chatPRCancelRequest(raceID)
  1550. {
  1551.     getURL("lingo: CANCELREQUEST " + raceID, "");
  1552. } // End of the function
  1553. function chatPRCancelRequestCB(s, raceID)
  1554. {
  1555.     switch (s)
  1556.     {
  1557.         case 1:
  1558.         {
  1559.             break;
  1560.         }
  1561.         case 0:
  1562.         {
  1563.             break;
  1564.         }
  1565.     } // End of switch
  1566. } // End of the function
  1567. function chatPRChallengeResponse(a)
  1568. {
  1569.     getURL("lingo: CHALLENGERESPONSE " + a, "");
  1570. } // End of the function
  1571. function chatPRChallengeResponseCB()
  1572. {
  1573. } // End of the function
  1574. function raceQMHFinishCB(d)
  1575. {
  1576.     var _loc1 = new XML(d);
  1577.     classes.RacePlay._MC.crossWire(_loc1.firstChild.attributes.i, _loc1.firstChild.attributes.et, _loc1.firstChild.attributes.ts);
  1578.     classes.Chat.enableWindow();
  1579. } // End of the function
  1580. function raceQMHRTOpponentCB(rt)
  1581. {
  1582.     var _loc3 = _global.chatObj.raceRoomMC.container;
  1583.     var _loc4;
  1584.     if (_loc3.racer1Obj.id == classes.GlobalData.id)
  1585.     {
  1586.         _loc4 = _loc3.racer2Obj.id;
  1587.     }
  1588.     else
  1589.     {
  1590.         _loc4 = _loc3.racer1Obj.id;
  1591.     } // end else if
  1592.     if (rt == -1)
  1593.     {
  1594.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "green", false);
  1595.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "red", true);
  1596.     } // end if
  1597.     _loc3.tripWire(_loc4, rt);
  1598. } // End of the function
  1599. function raceQMHIntOpponentCB(d, v, a, rpm, g, t)
  1600. {
  1601.     if (!_global.chatObj.raceRoomMC.container.raceStarted)
  1602.     {
  1603.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "pre", d > -3 && d < 0);
  1604.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "staged", d > -2 && d < 1);
  1605.     } // end if
  1606.     _global.chatObj.raceRoomMC.container.updateDistance(_global.chatObj.raceRoomMC.container.oppLane, d, _global.chatObj.raceRoomMC.container.raceStarted, v, a);
  1607. } // End of the function
  1608. function raceQMHReadyCB(s, t, t2)
  1609. {
  1610.     if (s == 1)
  1611.     {
  1612.         classes.RacePlay._MC.onRaceStart();
  1613.        
  1614.     } // end if
  1615. } // End of the function
  1616. function raceQMHResultCB(d)
  1617. {
  1618.     classes.Control.quickmatchMC.onRaceResults(d);
  1619. } // End of the function
  1620. function raceQMHTimeoutCB(s)
  1621. {
  1622.     switch (s)
  1623.     {
  1624.         case 1:
  1625.         {
  1626.             break;
  1627.         }
  1628.         case 2:
  1629.         {
  1630.             break;
  1631.         }
  1632.         case 3:
  1633.         {
  1634.             break;
  1635.         }
  1636.         case 4:
  1637.         {
  1638.             break;
  1639.         }
  1640.     } // End of switch
  1641. } // End of the function
  1642. function chatQMBJoin(acid, bt)
  1643. {
  1644.     getURL("lingo: JOINQMB " + acid + ", " + bt, "");
  1645. } // End of the function
  1646. function chatQMBJoinCB(s)
  1647. {
  1648.     switch (s)
  1649.     {
  1650.         case 0:
  1651.         {
  1652.             break;
  1653.         }
  1654.         case -1:
  1655.         {
  1656.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  1657.             break;
  1658.         }
  1659.         case -2:
  1660.         {
  1661.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected doesn\'t belong to you.");
  1662.             break;
  1663.         }
  1664.         case -50:
  1665.         {
  1666.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  1667.             break;
  1668.         }
  1669.     } // End of switch
  1670. } // End of the function
  1671. function chatQMBRaceCB(d)
  1672. {
  1673.     classes.Control.quickmatchMC.matchFound(d);
  1674. } // End of the function
  1675. function chatQMBLeave()
  1676. {
  1677.     getURL("lingo: LEAVEQMB");
  1678. } // End of the function
  1679. function chatQMBLeaveCB(s)
  1680. {
  1681.     switch (s)
  1682.     {
  1683.         case 1:
  1684.         {
  1685.             break;
  1686.         }
  1687.         case 0:
  1688.         {
  1689.             break;
  1690.         }
  1691.     } // End of switch
  1692. } // End of the function
  1693. function chatQMSend(m)
  1694. {
  1695.     getURL("lingo: QMSM \"" + escape(m) + "\"", "");
  1696. } // End of the function
  1697. function chatQMSendCB(s)
  1698. {
  1699.     switch (s)
  1700.     {
  1701.         case 0:
  1702.         {
  1703.             break;
  1704.         }
  1705.         case -1:
  1706.         {
  1707.             break;
  1708.         }
  1709.     } // End of switch
  1710. } // End of the function
  1711. function chatQMReceiveCB(i, u, m)
  1712. {
  1713.     classes.Chat.addToHistory(5, u, m);
  1714. } // End of the function
  1715. function chatQMLeave()
  1716. {
  1717.     getURL("lingo: QMLR");
  1718. } // End of the function
  1719. function chatQMLeaveCB(s)
  1720. {
  1721.     if (s == 1)
  1722.     {
  1723.        
  1724.     } // end if
  1725. } // End of the function
  1726. function chatQMLeaveOpponentCB(s, i, u)
  1727. {
  1728.     if (s == 0)
  1729.     {
  1730.     } // end if
  1731. } // End of the function
  1732. function chatRIVGet()
  1733. {
  1734.     getURL("lingo: GETRIVALS");
  1735. } // End of the function
  1736. function chatRIVListCB(d)
  1737. {
  1738.     _global.chatObj.queueXML = new XML(d);
  1739.     _global.chatObj.raceRoomMC.checkForData();
  1740. } // End of the function
  1741. function chatRIVRequest(acid, baid, bacid, bt, brt)
  1742. {
  1743.     getURL("lingo: RREQ " + acid + ", " + baid + ", " + bacid + ", " + bt + ", " + brt, "");
  1744. } // End of the function
  1745. function chatRIVRequestCB(s, guid)
  1746. {
  1747.     switch (s)
  1748.     {
  1749.         case 1:
  1750.         {
  1751.             break;
  1752.         }
  1753.         case -1:
  1754.         {
  1755.             _root.displayAlert("warning", "Cannot Create New Race", "Sorry, you cannot create a race when you are already in line to race.");
  1756.             break;
  1757.         }
  1758.         case -2:
  1759.         {
  1760.             _root.displayAlert("warning", "Opponent Not Available", "Sorry, the person you are trying to challenge is already in line to race.  You can try again later.");
  1761.             break;
  1762.         }
  1763.         case -3:
  1764.         {
  1765.             _root.displayAlert("warning", "Opponent Not In Room", "Sorry, the person you are trying to challenge is not currently in the room.");
  1766.             break;
  1767.         }
  1768.         case -4:
  1769.         {
  1770.             _root.displayAlert("warning", "Opponent Does Not Qualify", "Sorry, the person you are trying to challenge cannot race their only car for pink slips.");
  1771.             break;
  1772.         }
  1773.         case -5:
  1774.         {
  1775.             _root.displayAlert("warning", "Opponent Does Not Qualify", "Sorry, either you or the person you are challenging cannot race for pink slips because of insufficient garage space.");
  1776.             break;
  1777.         }
  1778.         case -6:
  1779.         {
  1780.             _root.displayAlert("warning", "Not Enough Funds", "Sorry, either you or the person you are trying to challenge does not have enough funds for the bet.");
  1781.             break;
  1782.         }
  1783.         case -7:
  1784.         {
  1785.             _root.displayAlert("warning", "Opponent Not In Room", "Sorry, the person you are trying to challenge is not currently in the room.");
  1786.             break;
  1787.         }
  1788.         case -8:
  1789.         {
  1790.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challengee\'s car is impounded.");
  1791.             break;
  1792.         }
  1793.         case -9:
  1794.         {
  1795.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challenger\'s car is impounded.");
  1796.             break;
  1797.         }
  1798.         case -10:
  1799.         {
  1800.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected doesn\'t belong to you.");
  1801.             break;
  1802.         }
  1803.         case -11:
  1804.         {
  1805.             _root.displayAlert("warning", "Invalid Dial In Time", "I\'m sorry, but the dial-in time you entered is not valid.");
  1806.             break;
  1807.         }
  1808.         case -12:
  1809.         {
  1810.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challengee\'s car is locked.");
  1811.             break;
  1812.         }
  1813.         case -13:
  1814.         {
  1815.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challenger\'s car is locked.");
  1816.             break;
  1817.         }
  1818.         case -14:
  1819.         {
  1820.             _root.displayAlert("warning", "Test Drive Car", "I\'m sorry, you cannot race a pink slip race with a test drive car");
  1821.             break;
  1822.         }
  1823.         case -15:
  1824.         {
  1825.             _root.displayAlert("warning", "Test Drive Car", "I\'m sorry, your opponent\'s car is a test drive car and cannot do a pink slip race with that car.");
  1826.             break;
  1827.         }
  1828.         case -16:
  1829.         {
  1830.             _root.markTestDriveExpiredAndDisplayWarning();
  1831.             break;
  1832.         }
  1833.         case -17:
  1834.         {
  1835.             _root.displayAlert("warning", "Test Drive Expired", "I\'m sorry, your opponent\'s car is a test drive car and their test drive has expired.");
  1836.             break;
  1837.         }
  1838.         case -50:
  1839.         {
  1840.             _root.displayAlert("triangle", "Account\'s Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  1841.             break;
  1842.         }
  1843.         case -51:
  1844.         {
  1845.             _root.displayAlert("triangle", "Opponent\'s Locked", "Sorry, your opponent left a race that is still in progress. His/her account is temporarily locked until the race is finished.  This may take moment.");
  1846.             break;
  1847.         }
  1848.         case -60:
  1849.         {
  1850.             _root.displayAlert("warning", "Account Verification Required", "I\'m sorry, but you need to verify your account to perform this action.");
  1851.             break;
  1852.         }
  1853.     } // End of switch
  1854. } // End of the function
  1855. function chatRIVChallengeCB(d)
  1856. {
  1857.     classes.RivalsChallengePanel.addChallenge(d);
  1858. } // End of the function
  1859. function chatRIVResponse(isAccepted, cebt, guid)
  1860. {
  1861.     if (!brt1)
  1862.     {
  1863.         brt1 = -1;
  1864.     } // end if
  1865.     if (!brt2)
  1866.     {
  1867.         brt2 = -1;
  1868.     } // end if
  1869.     getURL("lingo: RRSP " + isAccepted + ", " + cebt + ", \"" + guid + "\"", "");
  1870. } // End of the function
  1871. function chatRIVResponseCB(s, id)
  1872. {
  1873.     if (s != -1 && s != -2)
  1874.     {
  1875.         classes.RivalsChallengePanel.removeChallenge(id);
  1876.     } // end if
  1877.     switch (s)
  1878.     {
  1879.         case 1:
  1880.         {
  1881.             break;
  1882.         }
  1883.         case -1:
  1884.         {
  1885.             _root.displayAlert("warning", "Cannot Accept New Race", "Sorry, you cannot accept a new challenge when you are already in line to race.");
  1886.             break;
  1887.         }
  1888.         case -2:
  1889.         {
  1890.             _root.displayAlert("warning", "Opponent Not Available", "Sorry, the challenger is already in line to race.  You can try again later.");
  1891.             break;
  1892.         }
  1893.         case -3:
  1894.         {
  1895.             _root.displayAlert("warning", "Opponent Not In Room", "Sorry, the challenger is no longer in the room.");
  1896.             break;
  1897.         }
  1898.         case -4:
  1899.         {
  1900.             _root.displayAlert("warning", "Does Not Qualify", "Sorry, either you or the challenger only has one car so cannot race for pink slips.");
  1901.             break;
  1902.         }
  1903.         case -5:
  1904.         {
  1905.             _root.displayAlert("warning", "Does Not Qualify", "Sorry, either you or the challenger cannot race for pink slips because of insufficient garage space.  When racing for pinks, both racers need at least one open garage space so that there is rooom for a won car.");
  1906.             break;
  1907.         }
  1908.         case -6:
  1909.         {
  1910.             _root.displayAlert("warning", "Not Enough Funds", "Sorry, either you or the challenger does not have enough funds for this bet.");
  1911.             break;
  1912.         }
  1913.         case -7:
  1914.         {
  1915.             _root.displayAlert("warning", "Opponent Not In Room", "Sorry, the person you are trying to challenge is not currently in the room.");
  1916.             break;
  1917.         }
  1918.         case -8:
  1919.         {
  1920.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challengee\'s car is impounded.");
  1921.             break;
  1922.         }
  1923.         case -9:
  1924.         {
  1925.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challenger\'s car is impounded.");
  1926.             break;
  1927.         }
  1928.         case -10:
  1929.         {
  1930.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected doesn\'t belong to you.");
  1931.             break;
  1932.         }
  1933.         case -11:
  1934.         {
  1935.             _root.displayAlert("warning", "Invalid Dial In Time", "I\'m sorry, but the dial-in time you entered is not valid.");
  1936.             break;
  1937.         }
  1938.         case -12:
  1939.         {
  1940.             _root.displayAlert("warning", "Error", "Sorry, some error occured which made this challenge impossible.");
  1941.             break;
  1942.         }
  1943.         case -13:
  1944.         {
  1945.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challengee\'s car is locked.");
  1946.             break;
  1947.         }
  1948.         case -14:
  1949.         {
  1950.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the challenger\'s car is locked.");
  1951.             break;
  1952.         }
  1953.         case -50:
  1954.         {
  1955.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  1956.             break;
  1957.         }
  1958.         case -51:
  1959.         {
  1960.             _root.displayAlert("triangle", "Opponent\'s Locked", "Sorry, your opponent left a race that is still in progress. His/her account is temporarily locked until the race is finished.  This may take moment.");
  1961.             break;
  1962.         }
  1963.         case -60:
  1964.         {
  1965.             _root.displayAlert("warning", "Account Verification Required", "I\'m sorry, but you need to verify your account to perform this action.");
  1966.             break;
  1967.         }
  1968.         default:
  1969.         {
  1970.             _root.displayAlert("warning", "Error", "Sorry, some error occured which made this challenge impossible.");
  1971.         }
  1972.     } // End of switch
  1973. } // End of the function
  1974. function chatRIVDeniedCB(guid)
  1975. {
  1976. } // End of the function
  1977. function chatRIVJoinCB(d)
  1978. {
  1979.     var _loc3 = new XML(d);
  1980.     var _loc4 = false;
  1981.     for (var _loc2 = 0; _loc2 < _global.chatObj.queueXML.firstChild.childNodes.length; ++_loc2)
  1982.     {
  1983.         if (_global.chatObj.queueXML.firstChild.childNodes[_loc2].attributes.icid == _loc3.firstChild.firstChild.attributes.icid && _global.chatObj.queueXML.firstChild.childNodes[_loc2].attributes.cicid == _loc3.firstChild.firstChild.attributes.cicid)
  1984.         {
  1985.             _loc4 = true;
  1986.         } // end if
  1987.     } // end of for
  1988.     if (!_loc4)
  1989.     {
  1990.         _global.chatObj.queueXML.firstChild.appendChild(_loc3.firstChild.firstChild);
  1991.         _global.chatObj.raceRoomMC.drawQueue();
  1992.     } // end if
  1993.     false;
  1994. } // End of the function
  1995. function chatRIVNRaceCB(d)
  1996. {
  1997.     function CB_getTwoRacersCars(pxml)
  1998.     {
  1999.         var _loc3 = 10000;
  2000.         var _loc2;
  2001.         if (_global.chatObj.lastResultsTS)
  2002.         {
  2003.             _loc2 = new Date() - _global.chatObj.lastResultsTS;
  2004.         }
  2005.         else
  2006.         {
  2007.             _loc2 = _loc3;
  2008.         } // end else if
  2009.         if (_loc2 < _loc3)
  2010.         {
  2011.             _global.setTimeout(nextRace, _loc3 - _loc2, pxml);
  2012.         }
  2013.         else
  2014.         {
  2015.             nextRace(pxml);
  2016.         } // end else if
  2017.     } // End of the function
  2018.     function nextRace(pxml)
  2019.     {
  2020.         _global.chatObj.twoRacersCarsXML = pxml;
  2021.         _global.chatObj.raceObj = _global.chatObj.newRaceObj;
  2022.         if (classes.GlobalData.id == _global.chatObj.raceObj.r1Obj.id)
  2023.         {
  2024.             classes.GlobalData.setMyRaceCarNode(_global.chatObj.raceObj.r1Obj.cid);
  2025.             _global.setTimeout(showChal2, 2000);
  2026.         }
  2027.         else if (classes.GlobalData.id == _global.chatObj.raceObj.r2Obj.id)
  2028.         {
  2029.             classes.GlobalData.setMyRaceCarNode(_global.chatObj.raceObj.r2Obj.cid);
  2030.             _global.setTimeout(showChal2, 2000);
  2031.            
  2032.         } // end else if
  2033.     } // End of the function
  2034.     function showChal2()
  2035.     {
  2036.         _global.chatObj.raceRoomMC.showChallengerNew2();
  2037.     } // End of the function
  2038.     var _loc4 = new XML(d);
  2039.     var _loc5 = _loc4.firstChild.attributes;
  2040.     _global.chatObj.newRaceTS = new Date();
  2041.     var _loc6 = 0;
  2042.     var _loc7 = false;
  2043.     if (classes.GlobalData.id == _loc5.r1id)
  2044.     {
  2045.         _loc6 = _loc5.r1cid;
  2046.         _loc7 = true;
  2047.     }
  2048.     else if (classes.GlobalData.id == _loc5.r2id)
  2049.     {
  2050.         _loc6 = _loc5.r2cid;
  2051.         _loc7 = true;
  2052.     } // end else if
  2053.     _global.chatObj.raceRoomMC.removeQueueNode(_loc5.r1cid, _loc5.r2cid);
  2054.     _global.chatObj.raceRoomMC.drawQueue();
  2055.     classes.RivalsChallengePanel.removeChallenge(_loc5.r1cid + "_" + _loc5.r2cid);
  2056.     if (_loc6)
  2057.     {
  2058.         getURL("lingo: executeCall \"getonecarengine\", \"acid=" + _loc6 + "\"", "");
  2059.     } // end if
  2060.     _global.chatObj.newRaceObj = new Object();
  2061.     _global.chatObj.newRaceObj.isRacer = _loc7;
  2062.     _global.chatObj.newRaceObj.timeToRespond = Number(_loc5.t);
  2063.     _global.chatObj.newRaceObj.r1Obj = new Object();
  2064.     _global.chatObj.newRaceObj.r2Obj = new Object();
  2065.     _global.chatObj.newRaceObj.r1Obj.id = _loc4.firstChild.attributes.r1id;
  2066.     _global.chatObj.newRaceObj.r1Obj.cid = _loc4.firstChild.attributes.r1cid;
  2067.     _global.chatObj.newRaceObj.r2Obj.id = _loc4.firstChild.attributes.r2id;
  2068.     _global.chatObj.newRaceObj.r2Obj.cid = _loc4.firstChild.attributes.r2cid;
  2069.     _global.chatObj.newRaceObj.r1Obj.bt = _loc4.firstChild.attributes.b1;
  2070.     _global.chatObj.newRaceObj.r2Obj.bt = _loc4.firstChild.attributes.b2;
  2071.     _global.chatObj.newRaceObj.r1Obj.un = _global.chatObj.raceRoomMC.lookupUserName(_global.chatObj.newRaceObj.r1Obj.id);
  2072.     _global.chatObj.newRaceObj.r2Obj.un = _global.chatObj.raceRoomMC.lookupUserName(_global.chatObj.newRaceObj.r2Obj.id);
  2073.     _global.chatObj.newRaceObj.r1Obj.ti = _global.chatObj.raceRoomMC.lookupTeamID(_global.chatObj.newRaceObj.r1Obj.id);
  2074.     _global.chatObj.newRaceObj.r2Obj.ti = _global.chatObj.raceRoomMC.lookupTeamID(_global.chatObj.newRaceObj.r2Obj.id);
  2075.     _global.chatObj.newRaceObj.r1Obj.tn = _global.chatObj.raceRoomMC.lookupTeamName(_global.chatObj.newRaceObj.r1Obj.ti);
  2076.     _global.chatObj.newRaceObj.r2Obj.tn = _global.chatObj.raceRoomMC.lookupTeamName(_global.chatObj.newRaceObj.r2Obj.ti);
  2077.     _global.chatObj.newRaceObj.r1Obj.sc = _loc4.firstChild.attributes.sc1;
  2078.     _global.chatObj.newRaceObj.r2Obj.sc = _loc4.firstChild.attributes.sc2;
  2079.     _global.chatObj.newRaceObj.bt = _loc4.firstChild.attributes.bt;
  2080.     _global.chatObj.newRaceObj.t = _loc4.firstChild.attributes.t;
  2081.     classes.Lookup.addCallback("raceGetTwoRacersCars", this, CB_getTwoRacersCars, _global.chatObj.newRaceObj.r1Obj.cid + "," + _global.chatObj.newRaceObj.r2Obj.cid);
  2082.     _root.raceGetTwoRacersCars(_global.chatObj.newRaceObj.r1Obj.cid, _global.chatObj.newRaceObj.r2Obj.cid);
  2083.     false;
  2084. } // End of the function
  2085. function chatRIVLeave()
  2086. {
  2087.     getURL("lingo: RLVE");
  2088. } // End of the function
  2089. function chatRIVLeaveCB(s)
  2090. {
  2091. } // End of the function
  2092. function chatRIVLeftCB(d)
  2093. {
  2094.     var _loc3 = new XML(d);
  2095.     if (classes.GlobalData.attr.dc == _loc3.firstChild.attributes.icid || classes.GlobalData.attr.dc == _loc3.firstChild.attributes.cicid)
  2096.     {
  2097.         if (!_global.chatObj.raceObj.stageTS)
  2098.         {
  2099.             _root.abc.closeMe();
  2100.             var _loc4 = (classes.AlertBox)(_root.attachMovie("alertBox", "abc", _root.getNextHighestDepth()));
  2101.             _loc4.setValue("Race Canceled", "Your race was canceled because you or your opponent chickened out.", "warningtriangle");
  2102.             _loc4.addButton("OK");
  2103.         } // end if
  2104.     } // end if
  2105.     _global.chatObj.raceRoomMC.updateQueue(d, true);
  2106. } // End of the function
  2107. function raceRIVFinishCB(d)
  2108. {
  2109.     if (_global.chatObj.raceObj.isRacer)
  2110.     {
  2111.         do_raceRIVFinishCB(d);
  2112.     }
  2113.     else
  2114.     {
  2115.         _global.setTimeout(this, "do_raceRIVFinishCB", 6000, d);
  2116.     } // end else if
  2117. } // End of the function
  2118. function do_raceRIVFinishCB(d)
  2119. {
  2120.     var _loc2 = new XML(d);
  2121.     classes.Race._MC.crossWire(Number(_loc2.firstChild.attributes.i), Number(_loc2.firstChild.attributes.et), Number(_loc2.firstChild.attributes.ts));
  2122.     classes.Chat.enableWindow();
  2123.     _global.chatObj.raceRoomMC.optimizeBottom(true);
  2124. } // End of the function
  2125. function raceRIVRTOpponentCB(rt)
  2126. {
  2127.     var _loc1 = classes.RacePlay._MC;
  2128.     var _loc2;
  2129.     if (_loc1.racer1Obj.id == classes.GlobalData.id)
  2130.     {
  2131.         _loc2 = _loc1.racer2Obj.id;
  2132.     }
  2133.     else
  2134.     {
  2135.         _loc2 = _loc1.racer1Obj.id;
  2136.     } // end else if
  2137.     if (rt == -1)
  2138.     {
  2139.         _loc1.setLight(_loc1.oppLane, "green", false);
  2140.         _loc1.setLight(_loc1.oppLane, "red", true);
  2141.     } // end if
  2142.     _loc1.tripWire(_loc2, rt);
  2143. } // End of the function
  2144. function raceRIVRTCB(r, rt, i)
  2145. {
  2146.     if (_global.chatObj.challengeXML.firstChild.attributes.isRacer == 1 || _global.chatObj.raceObj.isRacer)
  2147.     {
  2148.         do_raceRIVRTCB(r, rt, i);
  2149.     }
  2150.     else
  2151.     {
  2152.         _global.setTimeout(this, "do_raceRIVRTCB", 6000, r, rt, i);
  2153.     } // end else if
  2154. } // End of the function
  2155. function do_raceRIVRTCB(r, rt, i)
  2156. {
  2157.     if (classes.Race._MC["racer" + r + "Obj"].id == i)
  2158.     {
  2159.         classes.Race._MC.tripWire(classes.Race._MC["racer" + r + "Obj"].id, rt);
  2160.         if (rt == -1)
  2161.         {
  2162.             classes.Race._MC.tree.setLight(r, "green", false);
  2163.             classes.Race._MC.tree.setLight(r, "red", true);
  2164.             classes.Race._MC.tree.syncAllForLane(r);
  2165.         } // end if
  2166.     } // end if
  2167. } // End of the function
  2168. function raceRIVIntOpponentCB(d, v, a, t)
  2169. {
  2170.     if (!classes.RacePlay._MC.raceStarted)
  2171.     {
  2172.         classes.RacePlay._MC.tree.setLight(classes.RacePlay._MC.oppLane, "pre", d > -3 && d < 0);
  2173.         classes.RacePlay._MC.tree.setLight(classes.RacePlay._MC.oppLane, "staged", d > -2 && d < 1);
  2174.     } // end if
  2175.     classes.RacePlay._MC.updateDistance(classes.RacePlay._MC.oppLane, d, classes.RacePlay._MC.raceStarted, v, a, t);
  2176. } // End of the function
  2177. function raceRIVIntCB(r, d, v, a, rpm, g)
  2178. {
  2179.     if (!classes.Race._MC.raceStarted)
  2180.     {
  2181.         classes.Race._MC.tree.setLight(r, "pre", d > -3 && d < 0);
  2182.         classes.Race._MC.tree.setLight(r, "staged", d > -2 && d < 1);
  2183.     } // end if
  2184.     classes.Race._MC.spectatorRender(r, d, classes.Race._MC.raceStarted, v, a);
  2185. } // End of the function
  2186. function raceRIVOK()
  2187. {
  2188.     getURL("lingo: RIVOK");
  2189. } // End of the function
  2190. function raceRIVOKCB(t)
  2191. {
  2192.     _global.chatObj.raceObj.stageTS = new Date();
  2193.     _global.chatObj.raceObj.timeToStage = t;
  2194.     _global.chatObj.raceRoomMC.showContainer();
  2195. } // End of the function
  2196. function raceRIVReadyOpponentCB()
  2197. {
  2198. } // End of the function
  2199. function raceRIVReadyCB(s, t, t2)
  2200. {
  2201.     if (s == 1)
  2202.     {
  2203.         classes.RacePlay._MC.onRaceStart();
  2204.        
  2205.     } // end if
  2206. } // End of the function
  2207. function raceRIVResultCB(d)
  2208. {
  2209.     _global.chatObj.lastResultsTS = new Date();
  2210.     _global.chatObj.raceRoomMC.onRaceResults(d);
  2211. } // End of the function
  2212. function raceRIVTimeoutCB(s)
  2213. {
  2214.     switch (s)
  2215.     {
  2216.         case 1:
  2217.         {
  2218.             break;
  2219.         }
  2220.         case 2:
  2221.         {
  2222.             break;
  2223.         }
  2224.         case 3:
  2225.         {
  2226.             break;
  2227.         }
  2228.     } // End of switch
  2229. } // End of the function
  2230. function teamRoleCB(d, mbp)
  2231. {
  2232.     classes.GlobalData.attr.tr = d;
  2233.     if (d == 0)
  2234.     {
  2235.         delete _global.teamXML;
  2236.         classes.GlobalData.attr.ti = 0;
  2237.         if (classes.Frame._MC.sectionHolder.sectionClip.objectName == "sectionTeamHQ")
  2238.         {
  2239.             classes.Frame._MC.createMap();
  2240.             classes.Control.setMapButton();
  2241.         } // end if
  2242.         _root.displayAlert("success", "Off the Team", "You have been removed from the team.  You will no longer be able to view this team\'s details in the Team HQ.");
  2243.     }
  2244.     else if (d > 0)
  2245.     {
  2246.         if (classes.Frame.__MC.sectionHolder.sectionClip.objectName == "sectionTeamHQ")
  2247.         {
  2248.             classes.Control.dialogTextBrief("Team Role Updated", "Note, your team role has just been changed by a team leader.", "warningtriangle");
  2249.             classes.Frame._MC.goMainSection("teamhq");
  2250.         } // end if
  2251.     } // end else if
  2252. } // End of the function
  2253. function teamKick(aidtk)
  2254. {
  2255.     _global.teamKickID = aidtk;
  2256.     getURL("lingo: TEAMKICK " + aidtk, "");
  2257. } // End of the function
  2258. function teamKickCB(s)
  2259. {
  2260.     switch (s)
  2261.     {
  2262.         case 1:
  2263.         {
  2264.             break;
  2265.         }
  2266.         case 0:
  2267.         {
  2268.             _root.displayAlert("warning", "You can\'t Kick Yourself Out", "You can\'t kick yourself out of the team. You can leave the team by clicking on Quit Team.");
  2269.             break;
  2270.         }
  2271.         case -1:
  2272.         {
  2273.             _root.displayAlert("warning", "Not a Leader", "I\'m sorry, only team leader can kick this member out the team.");
  2274.             break;
  2275.         }
  2276.         case -2:
  2277.         {
  2278.             _root.displayAlert("warning", "Member Not Found", "The member you tried to kick out is no longer on your team.");
  2279.             break;
  2280.         }
  2281.         case -3:
  2282.         {
  2283.             _root.displayAlert("warning", "Not a Leader/Co-leader", "I\'m sorry, only team leader/co-leader can kick someone out the team.");
  2284.             break;
  2285.         }
  2286.         case -60:
  2287.         {
  2288.             _root.displayAlert("warning", "Team is Locked", "The team is locked because it\'s currently in a team race. Please try again later.");
  2289.             break;
  2290.         }
  2291.     } // End of switch
  2292.     classes.Lookup.runCallback("teamKick", "", s);
  2293. } // End of the function
  2294. function teamChangeRole(aidta, roleID, maxBet)
  2295. {
  2296.     _global.teamAppointID = aidta;
  2297.     _global.teamAppointRoleID = roleID;
  2298.     if (!maxBet)
  2299.     {
  2300.         maxBet = 0;
  2301.     } // end if
  2302.     _global.teamAppointMaxBet = maxBet;
  2303.     getURL("lingo: TEAMCHANGEROLE " + aidta + "," + roleID + "," + maxBet, "");
  2304. } // End of the function
  2305. function teamChangeRoleCB(s)
  2306. {
  2307.     switch (s)
  2308.     {
  2309.         case 1:
  2310.         {
  2311.             break;
  2312.         }
  2313.         case 0:
  2314.         {
  2315.             _root.displayAlert("warning", "Access Denied", "You can\'t change someone\'s role if you\'re not a leader or a co-leader of the team.");
  2316.             break;
  2317.         }
  2318.         case -1:
  2319.         {
  2320.             _root.displayAlert("warning", "Member Not Found", "The member you tried to appoint is no longer on your team.");
  2321.             break;
  2322.         }
  2323.         case -2:
  2324.         {
  2325.             _root.displayAlert("warning", "Access Denied", "You can\'t appoint a leader of the team.");
  2326.             break;
  2327.         }
  2328.         case -3:
  2329.         {
  2330.             _root.displayAlert("warning", "Access Denied", "You can\'t appoint a co-leader of the team.");
  2331.             break;
  2332.         }
  2333.         case -4:
  2334.         {
  2335.             _root.displayAlert("warning", "Wrong Bet Amount", "You must enter a value between 0 and 100 for maximum bet percentage.");
  2336.             break;
  2337.         }
  2338.     } // End of switch
  2339.     if (s == 1)
  2340.     {
  2341.         var _loc4 = _global.teamXML.firstChild.firstChild;
  2342.         for (var _loc3 = 0; _loc3 < _loc4.childNodes.length; ++_loc3)
  2343.         {
  2344.             if (_loc4.childNodes[_loc3].attributes.i == _global.teamAppointID)
  2345.             {
  2346.                 _loc4.childNodes[_loc3].attributes.tr = _global.teamAppointRoleID;
  2347.                 _loc4.childNodes[_loc3].attributes.mbp = _global.teamAppointMaxBet;
  2348.                 classes.SectionTeamHQ._MC.goPage(2);
  2349.                 delete _global.teamAppointID;
  2350.                 delete _global.teamAppointRoleID;
  2351.                 delete _global.teamAppointMaxBet;
  2352.                 break;
  2353.             } // end if
  2354.         } // end of for
  2355.     } // end if
  2356. } // End of the function
  2357. function teamUpdateDealerMaxBet(aidta, maxBet)
  2358. {
  2359.     getURL("lingo: TEAMUPDATEMAXBET " + aidta + "," + maxBet, "");
  2360. } // End of the function
  2361. function teamUpdateDealerMaxBetCB(s)
  2362. {
  2363.     switch (s)
  2364.     {
  2365.         case 1:
  2366.         {
  2367.             break;
  2368.         }
  2369.         case 0:
  2370.         {
  2371.             _root.displayAlert("warning", "Access Denied", "You can\'t change someone\'s maximum bet if you\'re not a leader or a co-leader of the team.");
  2372.             break;
  2373.         }
  2374.         case -1:
  2375.         {
  2376.             _root.displayAlert("warning", "Member Not Found", "The member is no longer on your team.");
  2377.             break;
  2378.         }
  2379.         case -2:
  2380.         {
  2381.             _root.displayAlert("warning", "Access Denied", "You can only set the maximum bet to a dealer of the team.");
  2382.             break;
  2383.         }
  2384.         case -3:
  2385.         {
  2386.             _root.displayAlert("warning", "Wrong Bet Amount", "You must enter a value between 0 and 100 for maximum bet percentage.");
  2387.             break;
  2388.         }
  2389.     } // End of switch
  2390.     classes.Lookup.runCallback("teamAppointDealer", "", s);
  2391. } // End of the function
  2392. function teamDeposit(amount)
  2393. {
  2394.     classes.SectionTeamHQ.depositObj.amount = amount;
  2395.     getURL("lingo: TEAMDEPOSIT " + amount, "");
  2396. } // End of the function
  2397. function teamDepositCB(s)
  2398. {
  2399.     switch (s)
  2400.     {
  2401.         case 1:
  2402.         {
  2403.             classes.Lookup.runCallback("teamDeposit", "", 1);
  2404.             break;
  2405.         }
  2406.         case 0:
  2407.         {
  2408.             _root.displayAlert("warning", "Not on the Team", "You are no longer on the team you tried to deposit the money to.");
  2409.             classes.Lookup.clearCallback("teamDeposit", "");
  2410.             break;
  2411.         }
  2412.         case -1:
  2413.         {
  2414.             _root.displayAlert("warning", "Insufficient Funds", "I\'m sorry, you can\'t deposit more than what you have.");
  2415.             classes.Lookup.clearCallback("teamDeposit", "");
  2416.             break;
  2417.         }
  2418.         case -2:
  2419.         {
  2420.             _root.displayAlert("warning", "Amount too Large", "I\'m sorry, you can\'t deposit that much money at once.");
  2421.             classes.Lookup.clearCallback("teamDeposit", "");
  2422.             break;
  2423.         }
  2424.         case -50:
  2425.         {
  2426.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  2427.             classes.Lookup.clearCallback("teamDeposit", "");
  2428.             break;
  2429.         }
  2430.         case -60:
  2431.         {
  2432.             _root.displayAlert("warning", "Team is Locked", "The team is locked because it\'s currently in a team race. Please try again later.");
  2433.             classes.Lookup.clearCallback("teamDeposit", "");
  2434.             break;
  2435.         }
  2436.         case -70:
  2437.         {
  2438.             _root.displayAlert("warning", "Account Verification Required", "I\'m sorry, but you need to verify your account to perform this action.");
  2439.             classes.Lookup.clearCallback("teamDeposit", "");
  2440.             break;
  2441.         }
  2442.     } // End of switch
  2443. } // End of the function
  2444. function teamWithdrawal(amount)
  2445. {
  2446.     classes.SectionTeamHQ.withdrawalObj.amount = amount;
  2447.     getURL("lingo: TEAMWITHDRAW " + amount, "");
  2448. } // End of the function
  2449. function teamWithdrawalCB(s)
  2450. {
  2451.     switch (s)
  2452.     {
  2453.         case 1:
  2454.         {
  2455.             if (s == 1)
  2456.             {
  2457.                 var _loc4 = classes.SectionTeamHQ.withdrawalObj.amount + Number(_global.loginXML.firstChild.firstChild.attributes.m);
  2458.                 classes.GlobalData.updateInfo("m", _loc4);
  2459.                 _global.teamXML.firstChild.firstChild.attributes.tf = Number(_global.teamXML.firstChild.firstChild.attributes.tf) - classes.SectionTeamHQ.withdrawalObj.amount;
  2460.                 classes.SectionTeamHQ._MC.setFundsField(_global.teamXML.firstChild.firstChild.attributes.tf);
  2461.                 classes.SectionTeamHQ._MC.selfNode.attributes.fu = Number(classes.SectionTeamHQ._MC.selfNode.attributes.fu) - classes.SectionTeamHQ.withdrawalObj.amount;
  2462.                 var _loc3 = Math.round(10000 * classes.SectionTeamHQ._MC.selfNode.attributes.fu / _global.teamXML.firstChild.firstChild.attributes.tf) / 100;
  2463.                 if (!_loc3 || _loc3 < 0 || _loc3 == Infinity)
  2464.                 {
  2465.                     _loc3 = 0;
  2466.                 } // end if
  2467.                 classes.SectionTeamHQ._MC.selfNode.attributes.po = _loc3;
  2468.                 classes.SectionTeamHQ._MC.goPage(4);
  2469.                 _root.displayAlert("funds", "Withdrawal Succeeded", "You have successfully withdrawn $" + classes.SectionTeamHQ.withdrawalObj.amount + " from the team.\r\rYour personal funds balance is now $" + _loc4 + ".");
  2470.             }
  2471.             else
  2472.             {
  2473.                 _root.displayAlert("warning", "Withdrawal Failed", "Sorry, for some reason your withdrawal did not go through. Please try again later.");
  2474.             } // end else if
  2475.             classes.SectionTeamHQ.withdrawalObj.amount = 0;
  2476.             break;
  2477.         }
  2478.         case 0:
  2479.         {
  2480.             _root.displayAlert("warning", "Not in the Team", "You are no longer on the team you tried to withdraw the money from.");
  2481.             break;
  2482.         }
  2483.         case -1:
  2484.         {
  2485.             _root.displayAlert("warning", "Excessive Amount", "I\'m sorry, but you tried to take more than you can withdraw.");
  2486.             break;
  2487.         }
  2488.         case -3:
  2489.         {
  2490.             _root.displayAlert("warning", "Amount too Large", "I\'m sorry, you can\'t withdrawal that much money at once.");
  2491.             break;
  2492.         }
  2493.         case -50:
  2494.         {
  2495.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  2496.             break;
  2497.         }
  2498.         case -60:
  2499.         {
  2500.             _root.displayAlert("warning", "Team is Locked", "The team is locked because it\'s currently in a team race. Please try again later.");
  2501.             break;
  2502.         }
  2503.     } // End of switch
  2504. } // End of the function
  2505. function teamQuit()
  2506. {
  2507.     getURL("lingo: TEAMQUIT");
  2508. } // End of the function
  2509. function teamQuitCB(s)
  2510. {
  2511.     switch (s)
  2512.     {
  2513.         case 0:
  2514.         {
  2515.             break;
  2516.         }
  2517.         case -50:
  2518.         {
  2519.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  2520.             break;
  2521.         }
  2522.         case -60:
  2523.         {
  2524.             _root.displayAlert("warning", "Team is Locked", "The team is locked because it\'s currently in a team race.  You can quit once that race is completed.");
  2525.             break;
  2526.         }
  2527.     } // End of switch
  2528. } // End of the function
  2529. function teamAccept(tid)
  2530. {
  2531.     _global.teamToJoin = tid;
  2532.     getURL("lingo: TEAMACCEPT " + tid, "");
  2533. } // End of the function
  2534. function teamAcceptCB(s)
  2535. {
  2536.     switch (s)
  2537.     {
  2538.         case 1:
  2539.         {
  2540.             _global.loginXML.firstChild.firstChild.attributes.ti = _global.teamToJoin;
  2541.             _global.loginXML.firstChild.firstChild.attributes.tr = 3;
  2542.             delete _global.teamToJoin;
  2543.             classes.Control.goSection("teamhq");
  2544.             break;
  2545.         }
  2546.         case 0:
  2547.         {
  2548.             _root.displayAlert("warning", "Invalid Applicant", "I\'m sorry, but the applicant is no longer available.");
  2549.             break;
  2550.         }
  2551.         case -1:
  2552.         {
  2553.             _root.displayAlert("warning", "Invalid Command", "I\'m sorry, but you can\'t accept a denied / pending application.");
  2554.             break;
  2555.         }
  2556.         case -2:
  2557.         {
  2558.             _root.displayAlert("warning", "Problem with Application", "I\'m sorry, there\'s a problem with the application. Please try again later.");
  2559.             break;
  2560.         }
  2561.     } // End of switch
  2562. } // End of the function
  2563. function teamDisperse(amount, aidTo)
  2564. {
  2565.     classes.SectionTeamHQ.disburseObj.amount = amount;
  2566.     classes.SectionTeamHQ.disburseObj.toid = aidTo;
  2567.     getURL("lingo: TEAMDISPERSE " + amount + ", " + aidTo, "");
  2568. } // End of the function
  2569. function teamDisperseCB(s)
  2570. {
  2571.     switch (s)
  2572.     {
  2573.         case 1:
  2574.         {
  2575.             if (s == 1)
  2576.             {
  2577.                 var _loc5 = Number(_global.teamXML.firstChild.firstChild.attributes.tf) - classes.SectionTeamHQ.disburseObj.amount;
  2578.                 _global.teamXML.firstChild.firstChild.attributes.tf = _loc5;
  2579.                 classes.SectionTeamHQ._MC.setFundsField(_global.teamXML.firstChild.firstChild.attributes.tf);
  2580.                 for (var _loc3 = 0; _loc3 < _global.teamXML.firstChild.firstChild.childNodes.length; ++_loc3)
  2581.                 {
  2582.                     if (_global.teamXML.firstChild.firstChild.childNodes[_loc3].attributes.i == classes.SectionTeamHQ.disburseObj.toid)
  2583.                     {
  2584.                         _global.teamXML.firstChild.firstChild.childNodes[_loc3].attributes.fu = Number(_global.teamXML.firstChild.firstChild.childNodes[_loc3].attributes.fu) - classes.SectionTeamHQ.disburseObj.amount;
  2585.                         var _loc4 = Math.round(10000 * _global.teamXML.firstChild.firstChild.childNodes[_loc3].attributes.fu / _global.teamXML.firstChild.firstChild.attributes.tf) / 100;
  2586.                         if (!_loc4 || _loc4 < 0 || _loc4 == Infinity)
  2587.                         {
  2588.                             _loc4 = 0;
  2589.                         } // end if
  2590.                         _global.teamXML.firstChild.firstChild.childNodes[_loc3].attributes.po = _loc4;
  2591.                         break;
  2592.                     } // end if
  2593.                 } // end of for
  2594.                 classes.SectionTeamHQ._MC.goPage(4);
  2595.                 _root.displayAlert("funds", "Disbursement Succeeded", "The disbursement was successfully processed.  The team funds balance is now $" + _loc5 + ".");
  2596.             }
  2597.             else
  2598.             {
  2599.                 _root.displayAlert("warning", "Disbursement Failed", "Sorry, for some reason the disbursement failed. Please try again later.");
  2600.             } // end else if
  2601.             classes.SectionTeamHQ.disburseObj.amount = 0;
  2602.             break;
  2603.         }
  2604.         case 0:
  2605.         {
  2606.             _root.displayAlert("warning", "Access Denied", "I\'m sorry, but only a team leader can disperse funds.");
  2607.             break;
  2608.         }
  2609.         case -1:
  2610.         {
  2611.             _root.displayAlert("warning", "Insufficient Fund", "I\'m sorry, but the team doesn\'t have that much money.");
  2612.             break;
  2613.         }
  2614.         case -3:
  2615.         {
  2616.             _root.displayAlert("warning", "Amount too Large", "I\'m sorry, you can\'t disperse that much money at once.");
  2617.             break;
  2618.         }
  2619.         case -50:
  2620.         {
  2621.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  2622.             break;
  2623.         }
  2624.         case -51:
  2625.         {
  2626.             _root.displayAlert("triangle", "Account Locked", "Sorry, the account you\'re disbursing the money to is temporarily locked until the race is finished.  This may take moment.");
  2627.             break;
  2628.         }
  2629.         case -60:
  2630.         {
  2631.             _root.displayAlert("warning", "Team is Locked", "The team is locked because it\'s currently in a team race. Please try again later.");
  2632.             break;
  2633.         }
  2634.     } // End of switch
  2635. } // End of the function
  2636. function teamCreate(n)
  2637. {
  2638.     getURL("lingo: TEAMCREATE \"" + escape(n) + "\"", "");
  2639. } // End of the function
  2640. function teamCreateCB(s, tid)
  2641. {
  2642.     switch (s)
  2643.     {
  2644.         case 1:
  2645.         {
  2646.             classes.GlobalData.updateInfo("ti", tid);
  2647.             classes.GlobalData.updateInfo("tr", 1);
  2648.             break;
  2649.         }
  2650.         case 0:
  2651.         {
  2652.             _root.displayAlert("warning", "Invalid Name", "I\'m sorry, but the team name you tried to create contained invalid words.");
  2653.             break;
  2654.         }
  2655.         case -1:
  2656.         {
  2657.             _root.displayAlert("warning", "Already on the Team", "You\'re already on the team you wanted to create.");
  2658.             break;
  2659.         }
  2660.         case -2:
  2661.         {
  2662.             _root.displayAlert("warning", "Team Name Taken", "I\'m sorry, but the team name already exists.");
  2663.             break;
  2664.         }
  2665.         case -60:
  2666.         {
  2667.             _root.displayAlert("warning", "Account Verification Required", "I\'m sorry, but you need to verify your account to perform this action.");
  2668.             break;
  2669.         }
  2670.     } // End of switch
  2671.     classes.Lookup.runCallback("teamCreate", "", s);
  2672. } // End of the function
  2673. function teamStepDown()
  2674. {
  2675.     getURL("lingo: TEAMSTEPDOWN");
  2676. } // End of the function
  2677. function teamStepDownCB(s)
  2678. {
  2679.     switch (s)
  2680.     {
  2681.         case 1:
  2682.         {
  2683.             break;
  2684.         }
  2685.         case 0:
  2686.         {
  2687.             _root.displayAlert("warning", "Access Denied", "I\'m sorry, but only a team leader can step down.");
  2688.             break;
  2689.         }
  2690.         case -1:
  2691.         {
  2692.             _root.displayAlert("warning", "Access Denied", "I\'m sorry, but there\'s no one who can replace you if you step down.");
  2693.             break;
  2694.         }
  2695.         case -50:
  2696.         {
  2697.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  2698.             break;
  2699.         }
  2700.     } // End of switch
  2701.     classes.Lookup.runCallback("teamStepDown", "", s);
  2702. } // End of the function
  2703. function addMoneyCB(c)
  2704. {
  2705.     classes.GlobalData.updateInfo("m", c + Number(classes.GlobalData.attr.m));
  2706. } // End of the function
  2707. function teamRivalsGetRacers()
  2708. {
  2709.     getURL("lingo: TRGETRACERS");
  2710. } // End of the function
  2711. function teamRivalsGetRacersCB(d)
  2712. {
  2713.     _global.chatObj.queueXML = new XML(d);
  2714.     _global.chatObj.raceRoomMC.checkForData();
  2715. } // End of the function
  2716. function teamRivalsGetTeams()
  2717. {
  2718.     getURL("lingo: TRGETTEAMS");
  2719. } // End of the function
  2720. function teamRivalsGetTeamsCB(d)
  2721. {
  2722.     if (_root.createTeamChallengePanel._currentframe != 1)
  2723.     {
  2724.         _root.createTeamChallengePanel.teamListXML = new XML(d);
  2725.         _root.createTeamChallengePanel.gotoAndPlay("team");
  2726.     } // end if
  2727. } // End of the function
  2728. function teamRivalsPreRequest(challengeeTeamID)
  2729. {
  2730.     getURL("lingo: TRPREREQUEST " + challengeeTeamID, "");
  2731. } // End of the function
  2732. function teamRivalsPreRequestCB(s, d)
  2733. {
  2734.     if (s == 0)
  2735.     {
  2736.     }
  2737.     else if (s == 1)
  2738.     {
  2739.     } // end else if
  2740. } // End of the function
  2741. function teamRivalsRequest(challengeeTeamID, challengerAccountIDs, challengeeAccountIDs, challengerAccountCarIDs, challengeeAccountCarIDs, betAmount, isHeadsUp, isRanked)
  2742. {
  2743.     getURL("lingo: TRREQUEST " + challengeeTeamID + ", \"" + challengerAccountIDs + "\", \"" + challengeeAccountIDs + "\", \"" + challengerAccountCarIDs + "\", \"" + challengeeAccountCarIDs + "\", " + betAmount + ", " + isHeadsUp + ", " + isRanked, "");
  2744. } // End of the function
  2745. function teamRivalsRequestCB(s, d)
  2746. {
  2747.     if (s == 0)
  2748.     {
  2749.         if (!_root.createTeamChallengePanel.hidden)
  2750.         {
  2751.             _root.createTeamChallengePanel.gotoAndPlay("matches");
  2752.         } // end if
  2753.         var _loc4 = new XML(d);
  2754.         var _loc3 = _loc4.firstChild.attributes.e;
  2755.         _root.displayAlert("warning", "Team Challenge Error", _loc3);
  2756.     }
  2757.     else if (s == 1)
  2758.     {
  2759.         if (!_root.createTeamChallengePanel.hidden)
  2760.         {
  2761.             _root.createTeamChallengePanel.gotoAndPlay("hide");
  2762.         } // end if
  2763.     } // end else if
  2764. } // End of the function
  2765. function teamRivalsIncomingChallengeCB(sx)
  2766. {
  2767.     classes.TeamRivalsChallengePanel.addChallenge(sx);
  2768. } // End of the function
  2769. function teamRivalsResponse(raceGUID, accept)
  2770. {
  2771.     getURL("lingo: TRRESPONSE \"" + raceGUID + "\", " + accept, "");
  2772. } // End of the function
  2773. function teamRivalsResponseCB(s, raceGUID, msg)
  2774. {
  2775.     if (s == 0)
  2776.     {
  2777.         _root.displayAlert("warning", "Team Challenge Failed", msg);
  2778.     }
  2779.     else if (s == -1)
  2780.     {
  2781.         classes.TeamRivalsChallengePanel.removeChallenge(raceGUID);
  2782.         _root.displayAlert("warning", "Team Challenge Failed", msg);
  2783.     }
  2784.     else if (s == 1)
  2785.     {
  2786.         classes.TeamRivalsChallengePanel.removeChallenge(raceGUID);
  2787.     } // end else if
  2788. } // End of the function
  2789. function teamRivalsDenyCB(raceGUID)
  2790. {
  2791. } // End of the function
  2792. function teamRivalsNewQueueCB(sx)
  2793. {
  2794.     _global.chatObj.raceRoomMC.updateQueue(sx);
  2795. } // End of the function
  2796. function teamRivalsNewRaceCB(sx, t)
  2797. {
  2798.     _global.chatObj.newRaceTS = new Date();
  2799.     _global.chatObj.newRaceObj = new Object();
  2800.     _global.chatObj.newRaceObj.isRacer = false;
  2801.     _global.chatObj.challengeXML = new XML(sx);
  2802.     _global.chatObj.challengeXML.firstChild.attributes.isRacer = 0;
  2803.     _global.chatObj.raceRoomMC.updateQueue(sx, 1);
  2804.     var _loc3 = _global.chatObj.challengeXML.firstChild.attributes.h == 0 ? (true) : (false);
  2805.     _global.chatObj.raceRoomMC.showContainer("teamRivAnnounce", {isRacer: false, isBracket: _loc3});
  2806. } // End of the function
  2807. function teamRivalsYourRaceCB(sx, t)
  2808. {
  2809.     _global.chatObj.newRaceTS = new Date();
  2810.     _global.chatObj.newRaceObj = new Object();
  2811.     _global.chatObj.newRaceObj.isRacer = true;
  2812.     _global.chatObj.newRaceObj.timeToRespond = t;
  2813.     _global.chatObj.challengeXML = new XML(sx);
  2814.     _global.chatObj.challengeXML.firstChild.attributes.isRacer = 1;
  2815.     _global.chatObj.raceRoomMC.updateQueue(sx, 1);
  2816.     var _loc3 = _global.chatObj.challengeXML.firstChild.attributes.h == 0 ? (true) : (false);
  2817.     _global.chatObj.raceRoomMC.showContainer("teamRivAnnounce", {isRacer: true, isBracket: _loc3});
  2818. } // End of the function
  2819. function teamRivalsOK(bracketTime)
  2820. {
  2821.     _root.abc.contentMC.txtDialError = "";
  2822.     if (!bracketTime)
  2823.     {
  2824.         bracketTime = 0;
  2825.     } // end if
  2826.     getURL("lingo: TROK " + bracketTime, "");
  2827. } // End of the function
  2828. function teamRivalsWrongBracketCB()
  2829. {
  2830.     if (_root.abc.contentName == "dialogRivalNewContent")
  2831.     {
  2832.         _root.abc.contentMC.txtDialError = "Dial-in not valid.";
  2833.         _root.abc.contentMC.btnStage.enabled = true;
  2834.         _root.abc.contentMC.btnChicken.enabled = true;
  2835.     } // end if
  2836. } // End of the function
  2837. function teamRivalsOKCB(d)
  2838. {
  2839.     var _loc4 = new XML(d);
  2840.     if (classes.GlobalData.id == _loc4.firstChild.attributes.i && _root.abc.contentName == "dialogRivalNewContent")
  2841.     {
  2842.         _root.abc.closeMe();
  2843.     } // end if
  2844.     _global.chatObj.raceRoomMC.setRacerOK(d);
  2845. } // End of the function
  2846. function teamRivalsTimeoutCB()
  2847. {
  2848.     if (_global.chatObj.raceRoomMC.container.isRacer)
  2849.     {
  2850.         _global.chatObj.raceRoomMC.showTimedOut();
  2851.     } // end if
  2852.     _global.chatObj.raceRoomMC.showWaiting();
  2853. } // End of the function
  2854. function teamRivalsNRaceCB(d)
  2855. {
  2856.     var _loc3 = new Date();
  2857.     if (_global.chatObj.raceRoomMC.container.isTeamRivAnnounce)
  2858.     {
  2859.         _global.chatObj.raceRoomMC.container.gotoAndPlay("announce");
  2860.     } // end if
  2861.     _global.setTimeout(this, "go_teamRivalsNRaceCB", 9000, d, _loc3);
  2862. } // End of the function
  2863. function go_teamRivalsNRaceCB(d, stageTS)
  2864. {
  2865.     classes.RacePlay._MC.tree.clearTimer();
  2866.     var _loc6 = new XML(d);
  2867.     var _loc5 = _loc6.firstChild.attributes;
  2868.     var _loc2 = new Object();
  2869.     _loc2.racer1Obj = new Object();
  2870.     _loc2.racer1Obj.id = Number(_loc5.r1id);
  2871.     _loc2.racer1Obj.bt = Number(_loc5.b1) ? (Number(_loc5.b1)) : (0);
  2872.     _loc2.racer1Obj.uName = classes.Lookup.buddyName(Number(_loc2.racer1Obj.id));
  2873.     _loc2.racer1Obj.un = _loc2.racer1Obj.uName;
  2874.     _loc2.racer1Obj.sc = Number(_loc5.sc1);
  2875.     _loc2.racer1Obj.ti = _global.chatObj.raceRoomMC.lookupTeamID(_loc2.racer1Obj.id);
  2876.     _loc2.racer1Obj.tn = _global.chatObj.raceRoomMC.lookupTeamName(_loc2.racer1Obj.ti);
  2877.     _loc2.racer2Obj = new Object();
  2878.     _loc2.racer2Obj.id = Number(_loc5.r2id);
  2879.     _loc2.racer2Obj.bt = Number(_loc5.b2) ? (Number(_loc5.b2)) : (0);
  2880.     _loc2.racer2Obj.uName = classes.Lookup.buddyName(Number(_loc2.racer2Obj.id));
  2881.     _loc2.racer2Obj.un = _loc2.racer2Obj.uName;
  2882.     _loc2.racer2Obj.sc = Number(_loc5.sc2);
  2883.     _loc2.racer2Obj.ti = _global.chatObj.raceRoomMC.lookupTeamID(_loc2.racer2Obj.id);
  2884.     _loc2.racer2Obj.tn = _global.chatObj.raceRoomMC.lookupTeamName(_loc2.racer2Obj.ti);
  2885.     _global.chatObj.raceObj = new Object();
  2886.     _global.chatObj.raceObj.stageTS = stageTS;
  2887.     _global.chatObj.raceObj.timeToStage = Number(_loc5.t);
  2888.     _global.chatObj.raceObj.r1Obj = new Object();
  2889.     _global.chatObj.raceObj.r2Obj = new Object();
  2890.     _global.chatObj.raceObj.r1Obj.id = _loc2.racer1Obj.id;
  2891.     _global.chatObj.raceObj.r1Obj.cid = Number(_loc5.r1cid);
  2892.     _global.chatObj.raceObj.r2Obj.id = _loc2.racer2Obj.id;
  2893.     _global.chatObj.raceObj.r2Obj.cid = Number(_loc5.r2cid);
  2894.     _global.chatObj.raceObj.r1Obj.bt = _loc2.racer1Obj.bt;
  2895.     _global.chatObj.raceObj.r2Obj.bt = _loc2.racer2Obj.bt;
  2896.     _global.chatObj.raceObj.r1Obj.un = _loc2.racer1Obj.uName;
  2897.     _global.chatObj.raceObj.r2Obj.un = _loc2.racer2Obj.uName;
  2898.     _global.chatObj.raceObj.r1Obj.ti = _loc2.racer1Obj.ti;
  2899.     _global.chatObj.raceObj.r2Obj.ti = _loc2.racer2Obj.ti;
  2900.     _global.chatObj.raceObj.r1Obj.tn = _loc2.racer1Obj.tn;
  2901.     _global.chatObj.raceObj.r2Obj.tn = _loc2.racer2Obj.tn;
  2902.     _global.chatObj.raceObj.r1Obj.sc = _loc2.racer1Obj.sc;
  2903.     _global.chatObj.raceObj.r2Obj.sc = _loc2.racer2Obj.sc;
  2904.     _global.chatObj.raceObj.r1Obj.scc = 0;
  2905.     _global.chatObj.raceObj.r2Obj.scc = 0;
  2906.     if (_loc5.r1id == classes.GlobalData.id || _loc5.r2id == classes.GlobalData.id)
  2907.     {
  2908.         _global.chatObj.raceObj.isRacer = 1;
  2909.     } // end if
  2910.     _global.chatObj.challengeXML.firstChild.attributes.td = _loc6.firstChild.attributes.td;
  2911.     var _loc3;
  2912.     var _loc4;
  2913.     for (var _loc4 = 0; _loc4 < _global.chatObj.challengeXML.firstChild.childNodes.length; ++_loc4)
  2914.     {
  2915.         _loc3 = _global.chatObj.challengeXML.firstChild.childNodes[_loc4].attributes;
  2916.         if (_loc2.racer1Obj.id == _loc3.ai1 && _loc2.racer2Obj.id == _loc3.ai2)
  2917.         {
  2918.             break;
  2919.         } // end if
  2920.         _loc3 = undefined;
  2921.     } // end of for
  2922.     if (_loc3.ai1 == undefined)
  2923.     {
  2924.         return;
  2925.     } // end if
  2926.     _global.chatObj.raceRoomMC.showContainer("teamRivMatchAnnounce");
  2927. } // End of the function
  2928. function teamRivalsRaceInProgressCB(sx)
  2929. {
  2930.     _global.chatObj.newRaceTS = new Date();
  2931.     _global.chatObj.newRaceObj = new Object();
  2932.     _global.chatObj.newRaceObj.isRacer = false;
  2933.     _global.chatObj.newRaceObj.raceInProgress = true;
  2934.     _global.chatObj.challengeXML = new XML(sx);
  2935.     _global.chatObj.challengeXML.firstChild.attributes.isRacer = 0;
  2936.     var _loc2 = _global.chatObj.challengeXML.firstChild.attributes.h == 0 ? (true) : (false);
  2937.     _global.chatObj.raceRoomMC.showContainer("teamRivAnnounce", {isRacer: false, isBracket: _loc2});
  2938. } // End of the function
  2939. function teamRivalsFinishCB(d)
  2940. {
  2941.     function cont(type)
  2942.     {
  2943.         if (type == 1)
  2944.         {
  2945.             _global.chatObj.raceRoomMC.showContainer("teamRivWin");
  2946.         }
  2947.         else if (type == 2)
  2948.         {
  2949.             _global.chatObj.raceRoomMC.showContainer("raceNoWinner");
  2950.         } // end else if
  2951.         _root.raceSound.stopSound();
  2952.         _global.chatObj.raceRoomMC.userListXML = _global.chatObj.userListXML;
  2953.         _global.chatObj.raceRoomMC.drawUserList();
  2954.         _global.chatObj.raceRoomMC.drawQueue();
  2955.     } // End of the function
  2956.     var _loc3 = new XML(d);
  2957.     _global.chatObj.raceObj.teamResultsXML = _loc3;
  2958.     _global.chatObj.raceRoomMC.updateQueue(d, 1);
  2959.     classes.Chat.enableWindow();
  2960.     _global.chatObj.raceRoomMC.optimizeBottom(true);
  2961.     classes.Control.setMapButton("race");
  2962.     if (Number(_loc3.firstChild.attributes.wid) > 0)
  2963.     {
  2964.         _global.setTimeout(cont, 9000, 1);
  2965.     }
  2966.     else
  2967.     {
  2968.         _global.setTimeout(cont, 9000, 2);
  2969.     } // end else if
  2970. } // End of the function
  2971. function htConnect(tid)
  2972. {
  2973.     getURL("lingo: HTJOIN " + tid, "");
  2974. } // End of the function
  2975. function htConnectCB(s, d)
  2976. {
  2977.     if (s == 1)
  2978.     {
  2979.     }
  2980.     else
  2981.     {
  2982.         classes.Control.dialogAlert("Tournament Error", d);
  2983.     } // end else if
  2984. } // End of the function
  2985. function htQualifyOK(tid)
  2986. {
  2987.     getURL("lingo: HQOK " + tid, "");
  2988. } // End of the function
  2989. function htQualifyOKCB(s, d, t)
  2990. {
  2991.     if (s == 1)
  2992.     {
  2993.         _global.chatObj.raceObj.stageTS = new Date();
  2994.         _global.chatObj.raceObj.timeToStage = Math.ceil(t / 2);
  2995.         classes.Control.htourneyMC.gotoAndPlay("qualifyTrack");
  2996.     }
  2997.     else
  2998.     {
  2999.         classes.Control.dialogAlert("Tournament Error", d);
  3000.     } // end else if
  3001. } // End of the function
  3002. function htQualifyReadyCB(s)
  3003. {
  3004.     if (s == 1)
  3005.     {
  3006.         classes.Control.htourneyMC.countdownGroup._visible = false;
  3007.         classes.RacePlay._MC.onRaceStart();
  3008.     }
  3009.     else
  3010.     {
  3011.         classes.Control.htourneyMC.qualStatus = -1;
  3012.         classes.Control.htourneyMC.gotoAndPlay("restart");
  3013.     } // end else if
  3014. } // End of the function
  3015. function htGetTop32()
  3016. {
  3017.     getURL("lingo: HTGET32");
  3018. } // End of the function
  3019. function htGetTop32CB(d)
  3020. {
  3021.     classes.Control.htourneyMC.processTop32(d);
  3022. } // End of the function
  3023. function htTop32AddCB(d)
  3024. {
  3025.     classes.Control.htourneyMC.addLeader(d);
  3026. } // End of the function
  3027. function htTop32RemoveCB(aid)
  3028. {
  3029.     classes.Control.htourneyMC.removeLeader(aid);
  3030. } // End of the function
  3031. function htQualifyingResultCB(s, d)
  3032. {
  3033.     var _loc1 = new XML(d);
  3034.     classes.Control.htourneyMC.finishQual(Number(s), Number(_loc1.firstChild.attributes.et), Number(_loc1.firstChild.attributes.ts), Number(_loc1.firstChild.attributes.carChanged));
  3035. } // End of the function
  3036. function htQualifyingTimeoutCB()
  3037. {
  3038.     classes.Control.htourneyMC.showTimedOut();
  3039. } // End of the function
  3040. function htQuit()
  3041. {
  3042.     getURL("lingo: HTQUIT");
  3043. } // End of the function
  3044. function htEndQualifyingCB(d)
  3045. {
  3046.     classes.Control.htourneyMC.startRaceRoom(d);
  3047. } // End of the function
  3048. function htStartRaceCB(d)
  3049. {
  3050.     function CB_getTwoRacersCars(pxml)
  3051.     {
  3052.         var _loc3 = 10000;
  3053.         var _loc2;
  3054.         if (_global.chatObj.lastResultsTS)
  3055.         {
  3056.             _loc2 = new Date() - _global.chatObj.lastResultsTS;
  3057.         }
  3058.         else
  3059.         {
  3060.             _loc2 = _loc3;
  3061.         } // end else if
  3062.         if (_loc2 < _loc3)
  3063.         {
  3064.             _global.setTimeout(nextRace, _loc3 - _loc2, pxml);
  3065.         }
  3066.         else
  3067.         {
  3068.             nextRace(pxml);
  3069.         } // end else if
  3070.     } // End of the function
  3071.     function nextRace(pxml)
  3072.     {
  3073.         _global.chatObj.twoRacersCarsXML = pxml;
  3074.         _global.chatObj.raceObj = _global.chatObj.newRaceObj;
  3075.         if (classes.GlobalData.id == _global.chatObj.raceObj.r1Obj.id)
  3076.         {
  3077.             _global.chatObj.raceObj.isRacer = true;
  3078.             classes.GlobalData.setMyRaceCarNode(_global.chatObj.raceObj.r1Obj.cid);
  3079.         }
  3080.         else if (classes.GlobalData.id == _global.chatObj.raceObj.r2Obj.id)
  3081.         {
  3082.             _global.chatObj.raceObj.isRacer = true;
  3083.             classes.GlobalData.setMyRaceCarNode(_global.chatObj.raceObj.r2Obj.cid);
  3084.         } // end else if
  3085.         _global.setTimeout(goNext, 2000);
  3086.     } // End of the function
  3087.     function goNext()
  3088.     {
  3089.         classes.Control.htourneyMC.goNextRace(Number(tAttr.r), Number(tAttr.m));
  3090.     } // End of the function
  3091.     var _loc6 = new XML(d);
  3092.     var tAttr = _loc6.firstChild.attributes;
  3093.     _global.chatObj.newRaceTS = new Date();
  3094.     _global.chatObj.newRaceObj = new Object();
  3095.     _global.chatObj.newRaceObj.stageTS = new Date();
  3096.     _global.chatObj.newRaceObj.timeToStage = Number(tAttr.t);
  3097.     _global.chatObj.newRaceObj.timeToRespond = Number(tAttr.t);
  3098.     _global.chatObj.newRaceObj.r1Obj = new Object();
  3099.     _global.chatObj.newRaceObj.r2Obj = new Object();
  3100.     _global.chatObj.newRaceObj.r1Obj.id = tAttr.r1id;
  3101.     _global.chatObj.newRaceObj.r1Obj.cid = tAttr.r1cid;
  3102.     _global.chatObj.newRaceObj.r2Obj.id = tAttr.r2id;
  3103.     _global.chatObj.newRaceObj.r2Obj.cid = tAttr.r2cid;
  3104.     _global.chatObj.newRaceObj.r1Obj.bt = tAttr.b1;
  3105.     _global.chatObj.newRaceObj.r2Obj.bt = tAttr.b2;
  3106.     _global.chatObj.newRaceObj.r1Obj.un = classes.Control.htourneyMC.lookupUserName(_global.chatObj.newRaceObj.r1Obj.id);
  3107.     _global.chatObj.newRaceObj.r2Obj.un = classes.Control.htourneyMC.lookupUserName(_global.chatObj.newRaceObj.r2Obj.id);
  3108.     _global.chatObj.newRaceObj.r1Obj.sc = tAttr.sc1;
  3109.     _global.chatObj.newRaceObj.r2Obj.sc = tAttr.sc2;
  3110.     _global.chatObj.newRaceObj.r1Obj.racerNum = tAttr.k1;
  3111.     _global.chatObj.newRaceObj.r2Obj.racerNum = tAttr.k2;
  3112.     _global.chatObj.newRaceObj.bt = Number(tAttr.bt);
  3113.     _global.chatObj.newRaceObj.t = _loc6.firstChild.attributes.t;
  3114.     classes.Lookup.addCallback("raceGetTwoRacersCars", this, CB_getTwoRacersCars, _global.chatObj.newRaceObj.r1Obj.cid + "," + _global.chatObj.newRaceObj.r2Obj.cid);
  3115.     _root.raceGetTwoRacersCars(_global.chatObj.newRaceObj.r1Obj.cid, _global.chatObj.newRaceObj.r2Obj.cid);
  3116. } // End of the function
  3117. function htTreeResultCB(d)
  3118. {
  3119.     var _loc1 = new XML(d);
  3120.     classes.Control.htourneyMC.updateChartMatch(Number(_loc1.firstChild.attributes.r), Number(_loc1.firstChild.attributes.m), Number(_loc1.firstChild.attributes.w));
  3121. } // End of the function
  3122. function htReadyCB(s, t, t2)
  3123. {
  3124.     if (s == 1)
  3125.     {
  3126.         classes.RacePlay._MC.onRaceStart();
  3127.        
  3128.     } // end if
  3129. } // End of the function
  3130. function htRTOpponentCB(rt)
  3131. {
  3132.     var _loc3 = _global.chatObj.raceRoomMC.container;
  3133.     var _loc4;
  3134.     if (_loc3.racer1Obj.id == classes.GlobalData.id)
  3135.     {
  3136.         _loc4 = _loc3.racer2Obj.id;
  3137.     }
  3138.     else
  3139.     {
  3140.         _loc4 = _loc3.racer1Obj.id;
  3141.     } // end else if
  3142.     if (rt == -1)
  3143.     {
  3144.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "green", false);
  3145.         _root.raceTreeMovie.setLight(_global.chatObj.raceRoomMC.container.oppLane, "red", true);
  3146.     } // end if
  3147.     _loc3.tripWire(_loc4, rt);
  3148. } // End of the function
  3149. function htRTCB(r, rt)
  3150. {
  3151.     _global.chatObj.raceRoomMC.container.tripWire(_global.chatObj.raceRoomMC.container["racer" + r + "Obj"].id, rt);
  3152.     if (rt == -1)
  3153.     {
  3154.         _root.raceTreeMovie.setLight(r, "green", false);
  3155.         _root.raceTreeMovie.setLight(r, "red", true);
  3156.     } // end if
  3157. } // End of the function
  3158. function htFinishCB(d)
  3159. {
  3160.     if (_global.chatObj.raceObj.isRacer)
  3161.     {
  3162.         do_htFinishCB(d);
  3163.     }
  3164.     else
  3165.     {
  3166.         _global.setTimeout(this, "do_htFinishCB", 6000, d);
  3167.     } // end else if
  3168. } // End of the function
  3169. function do_htFinishCB(d)
  3170. {
  3171.     var _loc2 = new XML(d);
  3172.     _global.chatObj.raceRoomMC.container.crossWire(_loc2.firstChild.attributes.i, _loc2.firstChild.attributes.et, _loc2.firstChild.attributes.ts);
  3173.     classes.Chat.enableWindow();
  3174. } // End of the function
  3175. function htResultCB(d)
  3176. {
  3177.     _global.chatObj.lastResultsTS = new Date();
  3178.     _global.chatObj.raceRoomMC.onRaceResults(d);
  3179. } // End of the function
  3180. function htTimeoutCB(s)
  3181. {
  3182.     classes.Control.htourneyMC.showTimedOut();
  3183. } // End of the function
  3184. function htGetTournamentTree()
  3185. {
  3186.     getURL("lingo: HTGETTREE");
  3187. } // End of the function
  3188. function htGetTournamentTreeCB(d)
  3189. {
  3190.     var _loc1 = new XML(d);
  3191.     if (!_loc1.firstChild.firstChild.childNodes.length)
  3192.     {
  3193.         classes.Control.htourneyMC.loadRaceBG();
  3194.     }
  3195.     else
  3196.     {
  3197.         classes.Control.htourneyMC.startRaceRoom(d);
  3198.     } // end else if
  3199. } // End of the function
  3200. function htSpectate()
  3201. {
  3202.     getURL("lingo: HTSPECTATE");
  3203. } // End of the function
  3204. function htSpectateCB(d)
  3205. {
  3206.     isInAChat = true;
  3207.     var _loc2 = new XML(d);
  3208.     _global.newRoomName = _loc2.firstChild.attributes.n;
  3209.     _global.sectionTrackMC.showRaceRoom(7);
  3210. } // End of the function
  3211. function htInfo()
  3212. {
  3213.     getURL("lingo: HTINFO");
  3214. } // End of the function
  3215. function htInfoCB(d)
  3216. {
  3217.     _global.sectionTrackMC.processHtInfo(d);
  3218. } // End of the function
  3219. function htAwardPrizeCB(d)
  3220. {
  3221.     var _loc2 = new XML(d);
  3222.     classes.GlobalData.updateInfo("m", _loc2.firstChild.attributes.b);
  3223.     if (Number(_loc2.firstChild.attributes.acid))
  3224.     {
  3225.         _root.getCars();
  3226.     } // end if
  3227. } // End of the function
  3228. function updateCarListCB(d)
  3229. {
  3230.     var _loc1 = new XML();
  3231.     _loc1.ignoreWhite = true;
  3232.     _loc1.parseXML(d);
  3233.     classes.Frame._MC.overlay.carIcon.nextFrame();
  3234.     classes.Frame._MC.overlay.carIcon.onRelease = function ()
  3235.     {
  3236.         classes.GlobalData.onCarAlert();
  3237.     };
  3238.     if (_loc1.firstChild.attributes.e == 1)
  3239.     {
  3240.         classes.GlobalData.addToRemoveCars(Number(_loc1.firstChild.attributes.i));
  3241.         if (classes.GlobalData.onUpdateCars != classes.GlobalData.doGetAllCars)
  3242.         {
  3243.             classes.GlobalData.onUpdateCars = classes.GlobalData.doRemoveCars;
  3244.             classes.GlobalData.onCarAlert = classes.GlobalData.carWasSold;
  3245.         } // end if
  3246.     }
  3247.     else
  3248.     {
  3249.         classes.GlobalData.onUpdateCars = classes.GlobalData.doGetAllCars;
  3250.         classes.GlobalData.onCarAlert = classes.GlobalData.carWasTraded;
  3251.     } // end else if
  3252.     classes.Control.getEmailNow();
  3253. } // End of the function
  3254. function updateBalanceCB(d)
  3255. {
  3256.     var _loc1 = new XML();
  3257.     _loc1.ignoreWhite = true;
  3258.     _loc1.parseXML(d);
  3259.     if (_loc1.firstChild.attributes.t == 1)
  3260.     {
  3261.         classes.GlobalData.updateInfo("m", Number(_loc1.firstChild.attributes.b));
  3262.     }
  3263.     else if (_loc1.firstChild.attributes.t == 2)
  3264.     {
  3265.         classes.GlobalData.updateInfo("p", Number(_loc1.firstChild.attributes.b));
  3266.     } // end else if
  3267. } // End of the function
  3268. function JoinElection()
  3269. {
  3270.     getURL("lingo: JOINELECTION");
  3271.     classes.Frame.serverLights(true);
  3272. } // End of the function
  3273. function JoinElectionCB(s, d)
  3274. {
  3275.     classes.Frame.serverLights(false);
  3276.     if (s == 1)
  3277.     {
  3278.         isInAChat = true;
  3279.         classes.SectionModElection.MC.showRaceRoom(true);
  3280.     }
  3281.     else
  3282.     {
  3283.         classes.SectionModElection.MC.clearWait();
  3284.         classes.Control.dialogAlert("Error", d);
  3285.     } // end else if
  3286. } // End of the function
  3287. function GetElectionInterviewList()
  3288. {
  3289.     getURL("lingo: ELECTIONINTERVIEWLIST");
  3290.     classes.Frame.serverLights(true);
  3291. } // End of the function
  3292. function GetElectionInterviewListCB(s, d)
  3293. {
  3294.     classes.Frame.serverLights(false);
  3295.     if (s == 1)
  3296.     {
  3297.         classes.SectionModElection.MC.takeInterviewList(d);
  3298.     }
  3299.     else
  3300.     {
  3301.         classes.Control.dialogAlert("Error", d);
  3302.     } // end else if
  3303. } // End of the function
  3304. function ElectionNewIntervieweeCB(intervieweeAccountID, isUserAvail)
  3305. {
  3306.     if (isUserAvail == 1)
  3307.     {
  3308.         classes.SectionModElection.MC.takeNewInterviewee(intervieweeAccountID);
  3309.     } // end if
  3310. } // End of the function
  3311. function ElectionOverCB()
  3312. {
  3313.     classes.SectionModElection.MC.interviewOver();
  3314. } // End of the function
  3315. function ElectionStartInterviewCB(d)
  3316. {
  3317.     classes.SectionModElection.MC.takeIntervieweeList(new XML(d));
  3318. } // End of the function
  3319. function doPreLoginStuff()
  3320. {
  3321.     if (_root.supportCenterPreLogin)
  3322.     {
  3323.         _root.supportCenterPreLogin.closeSupportCenter();
  3324.     } // end if
  3325.     classes.Frame._MC.showSupportButton(false);
  3326. } // End of the function
  3327. function login(u, p, facebookLogin)
  3328. {
  3329.     _root.doPreLoginStuff();
  3330.     var _loc3 = 0;
  3331.     var _loc2 = new LoadVars();
  3332.     _loc2.u = u;
  3333.     _loc2.p = p;
  3334.     if (facebookLogin == true)
  3335.     {
  3336.         _loc3 = 1;
  3337.     } // end if
  3338.     _loc2.fbl = _loc3;
  3339.     _loc2.dt = classes.GlobalData.prefsXML.firstChild.attributes.dt;
  3340.     classes.Frame.serverLights(true);
  3341.     getURL("lingo: executeCall \"login\", \"" + _loc2.toString() + "\"", "");
  3342. } // End of the function
  3343. function loginCB(stat, d, at, am)
  3344. {
  3345.     classes.Frame.serverLights(false);
  3346.     if (stat == 1)
  3347.     {
  3348.         _global.iniXML = new XML();
  3349.         _global.iniXML.ignoreWhite = true;
  3350.         _global.iniXML.parseXML(d);
  3351.         _global.loginXML = new XML(_global.iniXML.idMap.login);
  3352.         _global.locationXML = new XML(_global.iniXML.idMap.locations);
  3353.         _global.scLevelsXML = new XML(_global.iniXML.idMap.sclevels);
  3354.         _global.platesXML = new XML(_global.iniXML.idMap.getlicenseplates);
  3355.         _global.paintCategoriesXML = new XML(_global.iniXML.idMap.getpaintcats);
  3356.         _global.paintsXML = new XML(_global.iniXML.idMap.getpaints);
  3357.         _global.bannersXML = new XML(_global.iniXML.idMap.banners);
  3358.         _global.garageXML = new XML(_global.iniXML.idMap.getallcars);
  3359.         _global.dynoXML = new XML(_global.iniXML.idMap.dyno);
  3360.         _global.badgesXML = new XML(_global.iniXML.idMap.badges);
  3361.         _global.gearsXML = new XML(_global.iniXML.idMap.gears);
  3362.         _global.broadcastXML = new XML(_global.iniXML.idMap.broadcast);
  3363.         _global.carsXML = new XML(_global.iniXML.idMap.cars);
  3364.         _global.impoundXML = new XML(_global.iniXML.idMap.impound);
  3365.         _global.usedCarXML = new XML(_global.iniXML.idMap.usedcar);
  3366.         _global.username = _global.loginXML.firstChild.firstChild.attributes.u;
  3367.         classes.GlobalData.uname = _global.loginXML.firstChild.firstChild.attributes.u;
  3368.         classes.GlobalData.id = _global.loginXML.firstChild.firstChild.attributes.i;
  3369.         classes.GlobalData.role = _global.loginXML.firstChild.firstChild.attributes.r;
  3370.         classes.GlobalData.dailyAwardType = at;
  3371.         classes.GlobalData.dailyAwardAmount = am;
  3372.         _global.specialEvent = new classes.SpecialEvent(_global.iniXML.idMap.specialEvent);
  3373.         var _loc6 = new XML(_global.iniXML.idMap.testdrivecar);
  3374.         classes.GlobalData.testDriveCarExpired = false;
  3375.         if (_loc6.firstChild.attributes.acid)
  3376.         {
  3377.             classes.GlobalData.testDriveCarAccountID = Number(_loc6.firstChild.attributes.acid);
  3378.             classes.GlobalData.testDriveInvitationID = Number(_loc6.firstChild.attributes.tid);
  3379.             classes.GlobalData.testDriveCarPrice = Number(_loc6.firstChild.attributes.m);
  3380.             classes.GlobalData.testDriveCarPointPrice = Number(_loc6.firstChild.attributes.p);
  3381.             classes.GlobalData.testDriveTimeRemaining = _loc6.firstChild.attributes.rh;
  3382.             if (Number(_loc6.firstChild.attributes.e) == 1)
  3383.             {
  3384.                 classes.GlobalData.testDriveCarExpired = true;
  3385.             } // end if
  3386.         }
  3387.         else
  3388.         {
  3389.             classes.GlobalData.testDriveCarExpired = false;
  3390.         } // end else if
  3391.         var _loc7 = false;
  3392.         if (_global.loginXML.firstChild.firstChild.attributes.vip == 1)
  3393.         {
  3394.             _loc7 = true;
  3395.         } // end if
  3396.         classes.GlobalData.isVIPUser = _loc7;
  3397.         var _loc8 = false;
  3398.         if (_global.loginXML.firstChild.firstChild.attributes.fbc == 1)
  3399.         {
  3400.             _loc8 = true;
  3401.         } // end if
  3402.         classes.GlobalData.facebookConnected = _loc8;
  3403.         classes.GlobalData.attr = _global.loginXML.firstChild.firstChild.attributes;
  3404.         classes.GlobalData.updateInfo("m", _global.loginXML.firstChild.firstChild.attributes.m);
  3405.         classes.GlobalData.updateInfo("p", _global.loginXML.firstChild.firstChild.attributes.p);
  3406.         classes.GlobalData.updateInfo("sc", _global.loginXML.firstChild.firstChild.attributes.sc);
  3407.         classes.GlobalData.updateInfo("im", _global.loginXML.firstChild.firstChild.attributes.im);
  3408.         classes.GlobalData.updateInfo("act", _global.loginXML.firstChild.firstChild.attributes.act);
  3409.         classes.Control.loginFinished("web");
  3410.         classes.Control.setPeriodicEmail();
  3411.         classes.GlobalData.priorStreetCredit = 0;
  3412.         classes.GlobalData.savePrefsXMLDT(_global.loginXML.firstChild.firstChild.attributes.dt);
  3413.         var _loc4 = new XML(_global.iniXML.idMap.userDecalBans);
  3414.         if (_loc4.firstChild.attributes.s == "2")
  3415.         {
  3416.             _root.fileClearAllDecals();
  3417.         }
  3418.         else if (_loc4.firstChild.attributes.s == "1")
  3419.         {
  3420.             for (var _loc3 = 0; _loc3 < _loc4.firstChild.childNodes.length; ++_loc3)
  3421.             {
  3422.                 _root.fileClearADecal(_loc4.firstChild.childNodes[_loc3].attributes.pcid, _loc4.firstChild.childNodes[_loc3].attributes.did);
  3423.             } // end of for
  3424.         } // end else if
  3425.         for (var _loc3 = 0; _loc3 < _global.garageXML.firstChild.childNodes.length; ++_loc3)
  3426.         {
  3427.             var _loc5 = new XML(_global.garageXML.firstChild.childNodes[_loc3].toString());
  3428.             classes.Lookup.addToRaceCarsXML(_loc5.firstChild);
  3429.         } // end of for
  3430.         _global.introData = new classes.IntroData();
  3431.         _global.specialEvent.currentEvent == true && _global.specialEvent.teamID;
  3432.         _global.introData.dailyAwardType = classes.GlobalData.dailyAwardType;
  3433.         _global.introData.dailyAwardAmount = classes.GlobalData.dailyAwardAmount;
  3434.         _global.introData.broadcastNum = Number(_global.broadcastXML.firstChild.firstChild.attributes.i);
  3435.         _global.introData.broadcastRead = classes.GlobalData.prefsObj.broadcastRead;
  3436.         _global.introData.broadcastMessage = _global.broadcastXML.firstChild.firstChild.attributes.m;
  3437.         _global.introData.currentEvent = _global.specialEvent.currentEvent;
  3438.         _global.introData.teamID = _global.specialEvent.teamID;
  3439.         _global.introData.specialEvent = _global.specialEvent;
  3440.         _global.introData.testDriveCarExpired = classes.GlobalData.testDriveCarExpired;
  3441.         _global.introData.introXML = new XML(_global.iniXML.idMap.intro);
  3442.     }
  3443.     else
  3444.     {
  3445.         _root.imp.loginCB(stat, d, at, am);
  3446.     } // end else if
  3447. } // End of the function
  3448. function loadUpdate()
  3449. {
  3450.     var _loc1 = classes.Frame.assetLoader;
  3451.     _loc1.downloadText2.text = "Fetching update list";
  3452.     getURL("lingo: fetchCacheXML");
  3453. } // End of the function
  3454. function loadInstaller()
  3455. {
  3456.     getURL("lingo: downloadNewInstaller");
  3457. } // End of the function
  3458. function loadUpdateCB(fileName, fileLoaded, fileSize, totalLoaded, totalSize)
  3459. {
  3460.     var _loc1 = classes.Frame.assetLoader;
  3461.     _loc1.downloadText1.text = "Downloading:";
  3462.     _loc1.downloadText2.text = fileName + " (" + fileLoaded + "/" + fileSize + ")";
  3463.     _loc1.totalDownloadText.text = totalLoaded + "/" + totalSize + " bytes";
  3464.     _loc1.progressBar.bar._width = totalLoaded / totalSize * 425;
  3465.     _loc1.progressBar.shade._x = _loc1.progressBar.bar._x + _loc1.progressBar.bar._width;
  3466. } // End of the function
  3467. function loadFinishCB()
  3468. {
  3469.     var _loc1 = classes.Frame.assetLoader;
  3470.     _loc1.downloadText1.text = "";
  3471.     _loc1.downloadText2.text = "Update is complete";
  3472.     _loc1.progressBar.bar._width = 425;
  3473.     _loc1.progressBar.shade._x = _loc1.progressBar.bar._x + _loc1.progressBar.bar._width;
  3474.     if (_loc1._parent.facebookLinkPage == false)
  3475.     {
  3476.         _loc1._parent.gotoAndPlay("updateDone");
  3477.     }
  3478.     else
  3479.     {
  3480.         _loc1._parent.gotoAndPlay("updateDoneFB");
  3481.     } // end else if
  3482. } // End of the function
  3483. function getPartCategories()
  3484. {
  3485.     if (!_global.partCatXML)
  3486.     {
  3487.         classes.Frame.serverLights(true);
  3488.         getURL("lingo: executeCall \"getallcats\"");
  3489.     }
  3490.     else
  3491.     {
  3492.         _global.shopPartsMC.gotoAndPlay("retrieve");
  3493.     } // end else if
  3494. } // End of the function
  3495. function getPartCategoriesCB(d)
  3496. {
  3497.     classes.Frame.serverLights(false);
  3498.     _global.partCatXML = new XML(d);
  3499.     _global.shopPartsMC.gotoAndPlay("retrieve");
  3500. } // End of the function
  3501. function getParts(acid)
  3502. {
  3503.     var _loc1 = Number(classes.GlobalData.attr.mb);
  3504.     classes.Frame.serverLights(true);
  3505.     getURL("lingo: executeCall \"getallparts\", \"acid=" + acid + "&m=" + _loc1 + "\"", "");
  3506. } // End of the function
  3507. function getPartsCB(d, d1)
  3508. {
  3509.     classes.Frame.serverLights(false);
  3510.     _global.partXML = new XML();
  3511.     _global.partXML.ignoreWhite = true;
  3512.     _global.partXML.parseXML(d);
  3513.     _global.shopPartsMC.gotoShowroom(d1);
  3514. } // End of the function
  3515. function getWheelsTires(acid)
  3516. {
  3517.     var _loc1 = Number(classes.GlobalData.attr.mb);
  3518.     classes.Frame.serverLights(true);
  3519.     getURL("lingo: executeCall \"getallwheelstires\", \"acid=" + acid + "&m=" + _loc1 + "\"", "");
  3520. } // End of the function
  3521. function getWheelsTiresCB(d, d1)
  3522. {
  3523.     classes.Frame.serverLights(false);
  3524.     _global.partXML = new XML();
  3525.     _global.partXML.ignoreWhite = true;
  3526.     _global.partXML.parseXML(d);
  3527.     _global.shopPartsMC.gotoShowroom(d1);
  3528. } // End of the function
  3529. function buyPart(acid, pid, pt, t, pvid, c)
  3530. {
  3531.     classes.Frame.serverLights(true);
  3532.     switch (t)
  3533.     {
  3534.         case "c":
  3535.         {
  3536.             classes.Lookup.removeFromRaceCarsXML(acid);
  3537.             getURL("lingo: executeCall \"buypart\", \"acid=" + acid + "&pid=" + pid + "&pt=" + pt + "&pvid=" + pvid + "&c=" + c + "\"", "");
  3538.             break;
  3539.         }
  3540.         case "e":
  3541.         {
  3542.             getURL("lingo: executeCall \"buyenginepart\", \"acid=" + acid + "&epid=" + pid + "&pt=" + pt + "\"", "");
  3543.             break;
  3544.         }
  3545.         case "m":
  3546.         {
  3547.             getURL("lingo: executeCall \"buyengine\", \"acid=" + acid + "&eid=" + pid + "&pt=" + pt + "\"", "");
  3548.             break;
  3549.         }
  3550.         default:
  3551.         {
  3552.             classes.Frame.serverLights(false);
  3553.             break;
  3554.         }
  3555.     } // End of switch
  3556. } // End of the function
  3557. function buyPartCB(t, d1, d2)
  3558. {
  3559.     classes.Frame.serverLights(false);
  3560.     var _loc2 = new XML();
  3561.     _loc2.ignoreWhite = true;
  3562.     _loc2.parseXML(d1);
  3563.     switch (Number(_loc2.firstChild.attributes.s))
  3564.     {
  3565.         case 2:
  3566.         case 1:
  3567.         {
  3568.             if (Number(_loc2.firstChild.attributes.s) == 2)
  3569.             {
  3570.                 classes.GlobalData.updateInfo("m", Number(_loc2.firstChild.attributes.b));
  3571.             }
  3572.             else
  3573.             {
  3574.                 classes.GlobalData.updateInfo("p", Number(_loc2.firstChild.attributes.b));
  3575.             } // end else if
  3576.             installPartCB(t, d2, true, Number(_loc2.firstChild.attributes.ai));
  3577.             break;
  3578.         }
  3579.         case 0:
  3580.         {
  3581.             _root.displayAlert("warning", "Purchase Error", "Sorry, the purchase attempt failed.  Please try again later.");
  3582.             break;
  3583.         }
  3584.         case -1:
  3585.         {
  3586.             _root.displayAlert("warning", "Purchase Error", "Sorry, this part is only available to users with paid memberships.  Please see www.NittoLegends.com for more information.");
  3587.             break;
  3588.         }
  3589.         case -2:
  3590.         {
  3591.             _root.displayAlert("warning", "Purchase Error", "This attempt failed because the part is not available for purchase with the chosen payment method.  Please use another form of payment.");
  3592.             break;
  3593.         }
  3594.         case -3:
  3595.         {
  3596.             _root.displayAlert("warning", "Insufficient Funds", "Sorry, you do not have enough in your balance to pay for this.  Try winning some races, or you could try buying a cheaper part.");
  3597.             break;
  3598.         }
  3599.         case -4:
  3600.         {
  3601.             _root.displayAlert("warning", "Purchase Error", "This part will not fit on the selected car.");
  3602.             break;
  3603.         }
  3604.         case -5:
  3605.         {
  3606.             _root.displayAlert("warning", "Purchase Error", "Sorry, but you can\'t shop in a city higher than the one you live in.");
  3607.             break;
  3608.         }
  3609.         case -6:
  3610.         {
  3611.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is impounded.");
  3612.             break;
  3613.         }
  3614.         case -7:
  3615.         {
  3616.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is locked.");
  3617.             break;
  3618.         }
  3619.         case -8:
  3620.         {
  3621.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is not yours.");
  3622.             break;
  3623.         }
  3624.         case -9:
  3625.         {
  3626.             _root.displayAlert("warning", "Purchase Error", "I\'m sorry, but the part you\'d like to purchase is for black card holders only.");
  3627.             break;
  3628.         }
  3629.         case -10:
  3630.         {
  3631.             _root.displayAlert("warning", "Purchase Error", "Error creating new engine.");
  3632.             break;
  3633.         }
  3634.         case -11:
  3635.         {
  3636.             _root.displayAlert("warning", "Purchase Error", "Error installing stock parts.");
  3637.             break;
  3638.         }
  3639.         case -12:
  3640.         {
  3641.             _root.displayAlert("warning", "Purchase Error", "Error getting AF Ratio.");
  3642.             break;
  3643.         }
  3644.         case -13:
  3645.         {
  3646.             _root.displayAlert("warning", "Purchase Error", "Error updating AF Ratio.");
  3647.             break;
  3648.         }
  3649.         case -14:
  3650.         {
  3651.             _root.displayAlert("warning", "Purchase Error", "Error updating money.");
  3652.             break;
  3653.         }
  3654.         case -15:
  3655.         {
  3656.             _root.displayAlert("warning", "Purchase Error", "Error updating spending.");
  3657.             break;
  3658.         }
  3659.         case -16:
  3660.         {
  3661.             _root.displayAlert("warning", "Purchase Error", "Transaction Error.");
  3662.             break;
  3663.         }
  3664.         case -17:
  3665.         {
  3666.             _root.displayAlert("warning", "Purchase Error", "Error adding transaction object.");
  3667.             break;
  3668.         }
  3669.         case -18:
  3670.         {
  3671.             _root.markTestDriveExpiredAndDisplayWarning();
  3672.             break;
  3673.         }
  3674.         case -19:
  3675.         {
  3676.             _root.displayAlert("warning", "Purchase Error", "I\'m sorry, but you don\'t meet a requirement for purchasing this part.");
  3677.             break;
  3678.         }
  3679.         case -50:
  3680.         {
  3681.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  3682.             break;
  3683.         }
  3684.     } // End of switch
  3685. } // End of the function
  3686. function getCarPartsBin(acid)
  3687. {
  3688.     if (classes.Control.serverAvail())
  3689.     {
  3690.         classes.Frame.serverLights(true);
  3691.         getURL("lingo: executeCall \"getcarpartsbin\", \"acid=" + acid + "\"", "");
  3692.     } // end if
  3693. } // End of the function
  3694. function getCarPartsBinCB(d)
  3695. {
  3696.     classes.Frame.serverLights(false);
  3697.     classes.Control.serverUnlock();
  3698.     _global.partsBinXML = new XML();
  3699.     _global.partsBinXML.ignoreWhite = true;
  3700.     _global.partsBinXML.parseXML(d);
  3701.     _global.shopPartsMC.gotoAndPlay("showroom");
  3702. } // End of the function
  3703. function getPartsBin()
  3704. {
  3705.     if (classes.Control.serverAvail())
  3706.     {
  3707.         classes.Frame.serverLights(true);
  3708.         getURL("lingo: executeCall \"getpartsbin\"");
  3709.     } // end if
  3710. } // End of the function
  3711. function getPartsBinCB(d)
  3712. {
  3713.     classes.Frame.serverLights(false);
  3714.     classes.Control.serverUnlock();
  3715.     _global.partsBinXML = new XML();
  3716.     _global.partsBinXML.ignoreWhite = true;
  3717.     _global.partsBinXML.parseXML(d);
  3718.     _global.shopPartsMC.gotoAndPlay("showroom");
  3719. } // End of the function
  3720. function sellPart(acpid, t)
  3721. {
  3722.     classes.Frame.serverLights(true);
  3723.     if (t == "c")
  3724.     {
  3725.         classes.Lookup.removeFromRaceCarsXML(acid);
  3726.         getURL("lingo: executeCall \"sellcarpart\", \"acpid=" + acpid + "\"", "");
  3727.     }
  3728.     else if (t == "e")
  3729.     {
  3730.         getURL("lingo: executeCall \"sellenginepart\", \"aepid=" + acpid + "\"", "");
  3731.     }
  3732.     else if (t == "m")
  3733.     {
  3734.         getURL("lingo: executeCall \"sellengine\", \"aeid=" + acpid + "\"", "");
  3735.     }
  3736.     else
  3737.     {
  3738.         classes.Frame.serverLights(false);
  3739.     } // end else if
  3740. } // End of the function
  3741. function sellPartCB(t, s, b)
  3742. {
  3743.     classes.Frame.serverLights(false);
  3744.     switch (s)
  3745.     {
  3746.         case 1:
  3747.         {
  3748.             classes.GlobalData.updateInfo("m", Number(b));
  3749.             _root.abc.contentMC.gotoAndStop("response");
  3750.             _root.abc.contentMC.alertIconMC.gotoAndStop("shopplus");
  3751.             if (t == "m")
  3752.             {
  3753.                 _root.abc.contentMC.txtTitle = "Engine is Traded In";
  3754.                 _root.abc.contentMC.txtMsg = "The engine is successfully traded in.";
  3755.             }
  3756.             else
  3757.             {
  3758.                 _root.abc.contentMC.txtTitle = "Part is Traded In";
  3759.                 _root.abc.contentMC.txtMsg = "The part is successfully traded in.";
  3760.             } // end else if
  3761.             _root.abc.removeButtons();
  3762.             _root.abc.addButton("OK");
  3763.             _global.shopPartsMC.tradeInCartPart();
  3764.             break;
  3765.         }
  3766.         case 0:
  3767.         {
  3768.             _root.abc.contentMC.gotoAndStop("response");
  3769.             _root.abc.contentMC.alertIconMC.gotoAndStop("warning");
  3770.             if (t == "m")
  3771.             {
  3772.                 _root.abc.contentMC.txtTitle = "Engine is Installed in a Car";
  3773.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but you must uninstall this engine from your car by swapping before you can trade it in.";
  3774.             }
  3775.             else
  3776.             {
  3777.                 _root.abc.contentMC.txtTitle = "Part is Installed in a Car";
  3778.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but you must uninstall this part before you can trade it in.";
  3779.             } // end else if
  3780.             _root.abc.removeButtons();
  3781.             _root.abc.addButton("Cancel");
  3782.             _global.shopPartsMC.clearCart();
  3783.             break;
  3784.         }
  3785.         case -1:
  3786.         {
  3787.             _root.abc.contentMC.gotoAndStop("response");
  3788.             _root.abc.contentMC.alertIconMC.gotoAndStop("warning");
  3789.             if (t == "m")
  3790.             {
  3791.                 _root.abc.contentMC.txtTitle = "Engine Not Found";
  3792.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this engine cannot be found in your account.";
  3793.             }
  3794.             else
  3795.             {
  3796.                 _root.abc.contentMC.txtTitle = "Part Not Found";
  3797.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this part cannot be found in your account.";
  3798.             } // end else if
  3799.             _root.abc.removeButtons();
  3800.             _root.abc.addButton("Cancel");
  3801.             _global.shopPartsMC.clearCart();
  3802.             break;
  3803.         }
  3804.         case -2:
  3805.         {
  3806.             _root.abc.contentMC.gotoAndStop("response");
  3807.             _root.abc.contentMC.alertIconMC.gotoAndStop("warning");
  3808.             _root.abc.contentMC.txtTitle = "Test Drive Car";
  3809.             _root.abc.contentMC.txtMsg = "I\'m sorry, but you cannot sell parts from a test drive car.";
  3810.             _root.abc.removeButtons();
  3811.             _root.abc.addButton("Cancel");
  3812.             _global.shopPartsMC.clearCart();
  3813.             break;
  3814.         }
  3815.         case -50:
  3816.         {
  3817.             _root.abc.contentMC.gotoAndStop("response");
  3818.             _root.abc.contentMC.alertIconMC.gotoAndStop("warning");
  3819.             _root.abc.contentMC.txtTitle = "Account Locked";
  3820.             _root.abc.contentMC.txtMsg = "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.";
  3821.             _root.abc.removeButtons();
  3822.             _root.abc.addButton("Cancel");
  3823.             _global.shopPartsMC.clearCart();
  3824.             break;
  3825.         }
  3826.     } // End of switch
  3827. } // End of the function
  3828. function installPart(acpid, pid, acid, aeid, t)
  3829. {
  3830.     classes.Frame.serverLights(true);
  3831.     if (t == "c")
  3832.     {
  3833.         classes.Lookup.removeFromRaceCarsXML(acid);
  3834.         getURL("lingo: executeCall \"installpart\", \"acpid=" + acpid + "&pid=" + pid + "&acid=" + acid + "\"", "");
  3835.     }
  3836.     else if (t == "e")
  3837.     {
  3838.         getURL("lingo: executeCall \"installenginepart\", \"aepid=" + acpid + "&epid=" + pid + "&acid=" + acid + "&aeid=" + aeid + "\"", "");
  3839.     }
  3840.     else if (t == "m")
  3841.     {
  3842.         getURL("lingo: executeCall \"swapengine\", \"aeid=" + acpid + "&acid=" + acid + "&pt=m\"", "");
  3843.     }
  3844.     else
  3845.     {
  3846.         classes.Frame.serverLights(false);
  3847.     } // end else if
  3848. } // End of the function
  3849. function installPartCB(t, c, callFromBuyPart, aiFromBuyPart)
  3850. {
  3851.     classes.Frame.serverLights(false);
  3852.     var _loc7 = new XML();
  3853.     _loc7.ignoreWhite = true;
  3854.     _loc7.parseXML(c);
  3855.     var _loc3 = _loc7.firstChild;
  3856.     if (Number(_loc3.attributes.s) < 1 && callFromBuyPart)
  3857.     {
  3858.         _global.shopPartsMC.partBoughtButNotInstalled();
  3859.     } // end if
  3860.     switch (Number(_loc3.attributes.s))
  3861.     {
  3862.         case 2:
  3863.         case 1:
  3864.         {
  3865.             if (Number(_loc3.attributes.b) > 0)
  3866.             {
  3867.                 if (Number(_loc3.attributes.s) == 2)
  3868.                 {
  3869.                     classes.GlobalData.updateInfo("m", Number(_loc3.attributes.b));
  3870.                 }
  3871.                 else
  3872.                 {
  3873.                     classes.GlobalData.updateInfo("p", Number(_loc3.attributes.b));
  3874.                 } // end if
  3875.             } // end else if
  3876.             _root.abc.contentMC.gotoAndStop("response");
  3877.             if (callFromBuyPart)
  3878.             {
  3879.                 _root.abc.contentMC.alertIconMC.gotoAndStop("shopplus");
  3880.                 if (t == "m")
  3881.                 {
  3882.                     _root.abc.contentMC.txtTitle = "Engine is Purchased and Installed";
  3883.                     _root.abc.contentMC.txtMsg = "Congratulations, the engine is successfully purchased and automatically installed in your car.";
  3884.                     _global.shopPartsMC.afterBuyEngine();
  3885.                 }
  3886.                 else
  3887.                 {
  3888.                     _root.abc.contentMC.txtTitle = "Part is Purchased and Installed";
  3889.                     _root.abc.contentMC.txtMsg = "Congratulations, the part is successfully purchased and automatically installed in your car.";
  3890.                     _global.shopPartsMC.installCartPart(aiFromBuyPart);
  3891.                 } // end else if
  3892.                 _root.abc.removeButtons();
  3893.                 _root.abc.addButton("OK");
  3894.             }
  3895.             else
  3896.             {
  3897.                 _root.abc.contentMC.alertIconMC.gotoAndStop("installplus");
  3898.                 if (t == "m")
  3899.                 {
  3900.                     _root.abc.contentMC.txtTitle = "Engine is Swapped";
  3901.                     _root.abc.contentMC.txtMsg = "The engine is successfully swapped in your car.";
  3902.                 }
  3903.                 else
  3904.                 {
  3905.                     _root.abc.contentMC.txtTitle = "Part is Installed";
  3906.                     _root.abc.contentMC.txtMsg = "The part is successfully installed in your car.";
  3907.                 } // end else if
  3908.                 _root.abc.removeButtons();
  3909.                 _root.abc.addButton("OK");
  3910.                 _global.shopPartsMC.installCartPart();
  3911.             } // end else if
  3912.             break;
  3913.         }
  3914.         case 0:
  3915.         {
  3916.             _root.abc.contentMC.gotoAndStop("response");
  3917.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  3918.             _root.abc.removeButtons();
  3919.             if (t == "m")
  3920.             {
  3921.                 _root.abc.contentMC.txtTitle = "Engine is not for the Car";
  3922.                 if (callFromBuyPart)
  3923.                 {
  3924.                     _root.abc.contentMC.txtMsg = "Congratulations, the part is successfully purchased. However, this engine doesn\'t fit in your car.";
  3925.                     _root.abc.addButton("OK");
  3926.                 }
  3927.                 else
  3928.                 {
  3929.                     _root.abc.contentMC.txtMsg = "I\'m sorry, but this engine does not fit in your car.";
  3930.                     _root.abc.addButton("Cancel");
  3931.                 } // end else if
  3932.             }
  3933.             else
  3934.             {
  3935.                 _root.abc.contentMC.txtTitle = "Part is already Installed";
  3936.                 if (callFromBuyPart)
  3937.                 {
  3938.                     _root.abc.contentMC.txtMsg = "Congratulations, the part is successfully purchased. However, you already have this part installed in your car.";
  3939.                     _root.abc.addButton("OK");
  3940.                 }
  3941.                 else
  3942.                 {
  3943.                     _root.abc.contentMC.txtMsg = "I\'m sorry, but this part is already installed in your car.";
  3944.                     _root.abc.addButton("Cancel");
  3945.                 } // end else if
  3946.             } // end else if
  3947.             _global.shopPartsMC.clearCart();
  3948.             break;
  3949.         }
  3950.         case -1:
  3951.         {
  3952.             var _loc6 = "";
  3953.             for (var _loc4 = 0; _loc4 < _loc3.childNodes.length; ++_loc4)
  3954.             {
  3955.                 _loc6 = _loc6 + ("\n" + _loc3.childNodes[_loc4].firstChild.nodeValue);
  3956.             } // end of for
  3957.             _root.abc.contentMC.gotoAndStop("response");
  3958.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  3959.             _root.abc.removeButtons();
  3960.             if (t == "m")
  3961.             {
  3962.                 _root.abc.contentMC.txtTitle = "Engine not Found";
  3963.                 if (callFromBuyPart)
  3964.                 {
  3965.                     _root.abc.contentMC.txtMsg = "The engine is successfully purchased, but this engine cannot be found in the system.";
  3966.                     _root.abc.addButton("OK");
  3967.                 }
  3968.                 else
  3969.                 {
  3970.                     _root.abc.contentMC.txtMsg = "I\'m sorry, but this engine cannot be found in the system.";
  3971.                     _root.abc.addButton("Cancel");
  3972.                 } // end else if
  3973.             }
  3974.             else
  3975.             {
  3976.                 _root.abc.contentMC.txtTitle = "Part has Conflicts";
  3977.                 if (callFromBuyPart)
  3978.                 {
  3979.                     _root.abc.contentMC.txtMsg = "The part is successfully purchased, but there are conflicting parts:" + _loc6;
  3980.                     _root.abc.addButton("OK");
  3981.                 }
  3982.                 else
  3983.                 {
  3984.                     _root.abc.contentMC.txtMsg = "I\'m sorry, but this part is conflicting with these parts:" + _loc6;
  3985.                     _root.abc.addButton("Cancel");
  3986.                 } // end else if
  3987.             } // end else if
  3988.             _global.shopPartsMC.clearCart();
  3989.             break;
  3990.         }
  3991.         case -2:
  3992.         {
  3993.             _loc6 = "";
  3994.             for (var _loc4 = 0; _loc4 < _loc3.childNodes.length; ++_loc4)
  3995.             {
  3996.                 _loc6 = _loc6 + ("\n" + _loc3.childNodes[_loc4].firstChild.nodeValue);
  3997.             } // end of for
  3998.             _root.abc.contentMC.gotoAndStop("response");
  3999.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4000.             _root.abc.contentMC.txtTitle = "Part has Requirements";
  4001.             _root.abc.removeButtons();
  4002.             if (callFromBuyPart)
  4003.             {
  4004.                 _root.abc.contentMC.txtMsg = "The part you have purchased is part of a SYSTEM that must be installed from your GARAGE once you own all the required parts.";
  4005.                 _root.abc.addButton("OK");
  4006.             }
  4007.             else
  4008.             {
  4009.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this part requires you to have these other parts:" + _loc6;
  4010.                 _root.abc.addButton("Cancel");
  4011.             } // end else if
  4012.             _global.shopPartsMC.clearCart();
  4013.             break;
  4014.         }
  4015.         case -3:
  4016.         {
  4017.             _root.abc.contentMC.gotoAndStop("response");
  4018.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4019.             _root.abc.contentMC.txtTitle = "Kit Conflict";
  4020.             _root.abc.removeButtons();
  4021.             if (callFromBuyPart)
  4022.             {
  4023.                 _root.abc.contentMC.txtMsg = "The kit is successfully purchased, but it\'s conflicting with your setup. Please go to your garage to install it manually.";
  4024.                 _root.abc.addButton("OK");
  4025.             }
  4026.             else
  4027.             {
  4028.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this kit can\'t be installed.";
  4029.                 _root.abc.addButton("Cancel");
  4030.             } // end else if
  4031.             _global.shopPartsMC.clearCart();
  4032.             break;
  4033.         }
  4034.         case -4:
  4035.         {
  4036.             _root.abc.contentMC.gotoAndStop("response");
  4037.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4038.             _root.abc.contentMC.txtTitle = "Car Impounded";
  4039.             _root.abc.removeButtons();
  4040.             if (callFromBuyPart)
  4041.             {
  4042.                 _root.abc.contentMC.txtMsg = "The part is successfully purchased, but it cannot be installed because your car is impounded.";
  4043.                 _root.abc.addButton("OK");
  4044.             }
  4045.             else
  4046.             {
  4047.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this part can\'t be installed because your car is impounded.";
  4048.                 _root.abc.addButton("Cancel");
  4049.             } // end else if
  4050.             _global.shopPartsMC.clearCart();
  4051.             break;
  4052.         }
  4053.         case -5:
  4054.         {
  4055.             _root.abc.contentMC.gotoAndStop("response");
  4056.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4057.             _root.abc.contentMC.txtTitle = "Car Locked";
  4058.             _root.abc.removeButtons();
  4059.             if (callFromBuyPart)
  4060.             {
  4061.                 _root.abc.contentMC.txtMsg = "The part is successfully purchased, but it cannot be installed because your car is locked.";
  4062.                 _root.abc.addButton("OK");
  4063.             }
  4064.             else
  4065.             {
  4066.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this part can\'t be installed because your car is locked.";
  4067.                 _root.abc.addButton("Cancel");
  4068.             } // end else if
  4069.             _global.shopPartsMC.clearCart();
  4070.             break;
  4071.         }
  4072.         case -6:
  4073.         {
  4074.             _root.abc.contentMC.gotoAndStop("response");
  4075.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4076.             _root.abc.contentMC.txtTitle = "Car not Yours";
  4077.             _root.abc.removeButtons();
  4078.             if (callFromBuyPart)
  4079.             {
  4080.                 _root.abc.contentMC.txtMsg = "The part is successfully purchased, but it cannot be installed because the car is not yours.";
  4081.                 _root.abc.addButton("OK");
  4082.             }
  4083.             else
  4084.             {
  4085.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this part can\'t be installed because the car is not yours.";
  4086.                 _root.abc.addButton("Cancel");
  4087.             } // end else if
  4088.             _global.shopPartsMC.clearCart();
  4089.             break;
  4090.         }
  4091.         case -7:
  4092.         {
  4093.             _root.abc.contentMC.gotoAndStop("response");
  4094.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4095.             _root.abc.contentMC.txtTitle = "Drive Expired";
  4096.             _root.abc.removeButtons();
  4097.             if (callFromBuyPart)
  4098.             {
  4099.                 _root.abc.contentMC.txtMsg = "The part is successfully purchased, but it cannot be installed because your test drive has expired.";
  4100.                 _root.abc.addButton("OK");
  4101.             }
  4102.             else
  4103.             {
  4104.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this part can\'t be installed because your test drive has expired.";
  4105.                 _root.abc.addButton("Cancel");
  4106.             } // end else if
  4107.             _global.shopPartsMC.clearCart();
  4108.             break;
  4109.         }
  4110.         case -8:
  4111.         {
  4112.             _root.abc.contentMC.gotoAndStop("response");
  4113.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4114.             _root.abc.contentMC.txtTitle = "Test Drive";
  4115.             _root.abc.removeButtons();
  4116.             if (callFromBuyPart)
  4117.             {
  4118.                 _root.abc.contentMC.txtMsg = "The part is successfully purchased, but it cannot be installed in a non test drive car.";
  4119.                 _root.abc.addButton("OK");
  4120.             }
  4121.             else
  4122.             {
  4123.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but this part can\'t be installed in a non test drive car.";
  4124.                 _root.abc.addButton("Cancel");
  4125.             } // end else if
  4126.             _global.shopPartsMC.clearCart();
  4127.             break;
  4128.         }
  4129.         case -50:
  4130.         {
  4131.             _root.abc.contentMC.gotoAndStop("response");
  4132.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4133.             _root.abc.contentMC.txtTitle = "Account Locked";
  4134.             _root.abc.removeButtons();
  4135.             _root.abc.contentMC.txtMsg = "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.";
  4136.             _root.abc.addButton("Cancel");
  4137.             _global.shopPartsMC.clearCart();
  4138.             break;
  4139.         }
  4140.     } // End of switch
  4141. } // End of the function
  4142. function uninstallPart(acpids, pids, acid, t)
  4143. {
  4144.     classes.Frame.serverLights(true);
  4145.     if (t == "c")
  4146.     {
  4147.         classes.Lookup.removeFromRaceCarsXML(acid);
  4148.         getURL("lingo: executeCall \"uninstallpart\", \"acpids=" + acpids + "&pids=" + pids + "&acid=" + acid + "\"", "");
  4149.     }
  4150.     else if (t == "e")
  4151.     {
  4152.         getURL("lingo: executeCall \"uninstallenginepart\", \"aepids=" + acpids + "&epids=" + pids + "&aeid=" + acid + "\"", "");
  4153.     }
  4154.     else
  4155.     {
  4156.         classes.Frame.serverLights(false);
  4157.     } // end else if
  4158. } // End of the function
  4159. function uninstallPartCB(t, c)
  4160. {
  4161.     classes.Frame.serverLights(false);
  4162.     var _loc6 = new XML();
  4163.     _loc6.ignoreWhite = true;
  4164.     _loc6.parseXML(c);
  4165.     var _loc4 = _loc6.firstChild;
  4166.     switch (Number(_loc4.attributes.s))
  4167.     {
  4168.         case 1:
  4169.         {
  4170.             _root.abc.contentMC.gotoAndStop("response");
  4171.             _root.abc.contentMC.alertIconMC.gotoAndStop("installplus");
  4172.             _root.abc.contentMC.txtTitle = "Part is Uninstalled";
  4173.             _root.abc.contentMC.txtMsg = "The part is successfully uninstalled from your car.";
  4174.             _root.abc.removeButtons();
  4175.             _root.abc.addButton("OK");
  4176.             _global.shopPartsMC.uninstallCartPart();
  4177.             break;
  4178.         }
  4179.         case 0:
  4180.         {
  4181.             _root.abc.contentMC.gotoAndStop("response");
  4182.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4183.             _root.abc.contentMC.txtTitle = "Part is Already Uninstalled";
  4184.             _root.abc.contentMC.txtMsg = "I\'m sorry, but this part is already uninstalled from your car.";
  4185.             _root.abc.removeButtons();
  4186.             _root.abc.addButton("Cancel");
  4187.             _global.shopPartsMC.clearCart();
  4188.             break;
  4189.         }
  4190.         case -1:
  4191.         {
  4192.             var _loc5 = "Error, dependent parts:";
  4193.             for (var _loc3 = 0; _loc3 < _loc4.childNodes.length; ++_loc3)
  4194.             {
  4195.                 _loc5 = _loc5 + ("\n" + _loc4.childNodes[_loc3].firstChild.nodeValue);
  4196.             } // end of for
  4197.             _root.abc.contentMC.gotoAndStop("response");
  4198.             _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4199.             _root.abc.contentMC.txtTitle = "Part is Required";
  4200.             _root.abc.contentMC.txtMsg = "I\'m sorry, but this part was required by these parts:" + _loc5;
  4201.             _root.abc.removeButtons();
  4202.             _root.abc.addButton("Cancel");
  4203.             _global.shopPartsMC.clearCart();
  4204.             break;
  4205.         }
  4206.         case -2:
  4207.         {
  4208.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is impounded.");
  4209.             break;
  4210.         }
  4211.         case -3:
  4212.         {
  4213.             _root.abc.contentMC.txtTitle = "Part is Required";
  4214.             _root.abc.contentMC.txtMsg = "I\'m sorry, but this part can\'t be uninstalled.";
  4215.             _root.abc.removeButtons();
  4216.             _root.abc.addButton("Cancel");
  4217.             _global.shopPartsMC.clearCart();
  4218.             break;
  4219.         }
  4220.         case -4:
  4221.         {
  4222.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is locked.");
  4223.             break;
  4224.         }
  4225.         case -5:
  4226.         {
  4227.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the part for is not yours.");
  4228.             break;
  4229.         }
  4230.         case -6:
  4231.         {
  4232.             _root.markTestDriveExpiredAndDisplayWarning();
  4233.             break;
  4234.         }
  4235.         case -50:
  4236.         {
  4237.             _root.abc.contentMC.txtTitle = "Account Locked";
  4238.             _root.abc.contentMC.txtMsg = "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.";
  4239.             _root.abc.removeButtons();
  4240.             _root.abc.addButton("Cancel");
  4241.             _global.shopPartsMC.clearCart();
  4242.             break;
  4243.         }
  4244.     } // End of switch
  4245. } // End of the function
  4246. function getPaintCategories()
  4247. {
  4248.     classes.Frame.serverLights(true);
  4249.     getURL("lingo: executeCall \"getpaintcats\"");
  4250. } // End of the function
  4251. function getPaintCategoriesCB(d)
  4252. {
  4253.     classes.Frame.serverLights(false);
  4254.     _global.paintCategoriesXML = new XML(d);
  4255.     getPaints();
  4256. } // End of the function
  4257. function getPaints()
  4258. {
  4259.     classes.Frame.serverLights(true);
  4260.     getURL("lingo: executeCall \"getpaints\"");
  4261. } // End of the function
  4262. function getPaintsCB(d)
  4263. {
  4264.     classes.Frame.serverLights(false);
  4265.     _global.paintsXML = new XML(d);
  4266.     _root.getCars();
  4267. } // End of the function
  4268. function buyPaint(acid, partArray, pt, cartArray)
  4269. {
  4270.     _global.paintJobArr = cartArray;
  4271.     classes.Frame.serverLights(true);
  4272.     getURL("lingo: executeCall \"buypaint\", \"acid=" + acid + "&p=" + partArray + "&pt=" + pt + "\"", "");
  4273. } // End of the function
  4274. function buyPaintCB(s, b)
  4275. {
  4276.     classes.Frame.serverLights(false);
  4277.     _root.abc.closeMe();
  4278.     switch (s)
  4279.     {
  4280.         case 2:
  4281.         case 1:
  4282.         {
  4283.             if (s == 1)
  4284.             {
  4285.                 classes.GlobalData.updateInfo("p", b);
  4286.             }
  4287.             else if (s == 2)
  4288.             {
  4289.                 classes.GlobalData.updateInfo("m", b);
  4290.             } // end else if
  4291.             var _loc3 = classes.GlobalData.getSelectedCarXML();
  4292.             for (var _loc5 = 0; _loc5 < _global.paintJobArr.length; ++_loc5)
  4293.             {
  4294.                 if (Number(_global.paintJobArr[_loc5].partCategoryID) == -2)
  4295.                 {
  4296.                     _loc3.attributes.cc = _global.paintJobArr[_loc5].paintColor;
  4297.                     for (var _loc4 = 0; _loc4 < _loc3.childNodes.length; ++_loc4)
  4298.                     {
  4299.                         if (_loc3.childNodes[_loc4].attributes.in == 1 && classes.CarSpecs.isPaintable(Number(_loc3.childNodes[_loc4].attributes.ci)))
  4300.                         {
  4301.                             _loc3.childNodes[_loc4].attributes.cc = _global.paintJobArr[_loc5].paintColor;
  4302.                         } // end if
  4303.                     } // end of for
  4304.                     continue;
  4305.                 } // end if
  4306.                 if (Number(_global.paintJobArr[_loc5].partCategoryID) == -1)
  4307.                 {
  4308.                     _loc3.attributes.cc = _global.paintJobArr[_loc5].paintColor;
  4309.                     continue;
  4310.                 } // end if
  4311.                 for (var _loc4 = 0; _loc4 < _loc3.childNodes.length; ++_loc4)
  4312.                 {
  4313.                     if (_loc3.childNodes[_loc4].attributes.in == 1)
  4314.                     {
  4315.                         if (Number(_loc3.childNodes[_loc4].attributes.ci) == Number(_global.paintJobArr[_loc5].partCategoryID))
  4316.                         {
  4317.                             _loc3.childNodes[_loc4].attributes.cc = _global.paintJobArr[_loc5].paintColor;
  4318.                             break;
  4319.                         } // end if
  4320.                     } // end if
  4321.                 } // end of for
  4322.             } // end of for
  4323.             delete _global.paintJobArr;
  4324.             _global.shopPaintMC.cloneSelectedCarXML();
  4325.             break;
  4326.         }
  4327.         case 0:
  4328.         {
  4329.             _root.displayAlert("warning", "Connection Problem", "The purchase did not go through because of a server error.  Please try again later.");
  4330.             break;
  4331.         }
  4332.         case -1:
  4333.         {
  4334.             _root.displayAlert("warning", "Illegal Action", "Sorry, one or more of the selected colors are not available.");
  4335.             break;
  4336.         }
  4337.         case -2:
  4338.         {
  4339.             _root.displayAlert("warning", "Unavailable Funds", "Sorry, you do not have enough in your account to pay for this.");
  4340.             break;
  4341.         }
  4342.         case -3:
  4343.         {
  4344.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the paint for is impounded.");
  4345.             break;
  4346.         }
  4347.         case -4:
  4348.         {
  4349.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the paint for is locked.");
  4350.             break;
  4351.         }
  4352.         case -5:
  4353.         {
  4354.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the paint for is not yours.");
  4355.             break;
  4356.         }
  4357.         case -6:
  4358.         {
  4359.             _root.markTestDriveExpiredAndDisplayWarning();
  4360.             break;
  4361.         }
  4362.         case -50:
  4363.         {
  4364.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  4365.             break;
  4366.         }
  4367.     } // End of switch
  4368. } // End of the function
  4369. function buyPlate(acid, pid, pt)
  4370. {
  4371.     classes.Frame.serverLights(true);
  4372.     getURL("lingo: executeCall \"buyplate\", \"acid=" + acid + "&pid=" + pid + "&pt=" + pt + "\"", "");
  4373. } // End of the function
  4374. function buyPlateCB(s, b, pl)
  4375. {
  4376.     classes.Frame.serverLights(false);
  4377.     switch (s)
  4378.     {
  4379.         case 2:
  4380.         case 1:
  4381.         {
  4382.             if (s == 1)
  4383.             {
  4384.                 classes.GlobalData.updateInfo("p", b);
  4385.             }
  4386.             else if (s == 2)
  4387.             {
  4388.                 classes.GlobalData.updateInfo("m", b);
  4389.             } // end else if
  4390.             _global.shopLicensesMC.installCartPlate(pl);
  4391.             break;
  4392.         }
  4393.         case 0:
  4394.         {
  4395.             _root.displayAlert("warning", "Connection Problem", "The purchase did not go through because of a server error.  Please try again later.");
  4396.             break;
  4397.         }
  4398.         case -1:
  4399.         {
  4400.             _root.displayAlert("warning", "Not Qualified", "Sorry, you must live at or above this location (" + classes.Lookup.homeName(_global.shopLicensesMC.locationID) + ") in order to purchase from this store.");
  4401.             break;
  4402.         }
  4403.         case -2:
  4404.         {
  4405.             _root.displayAlert("warning", "Not Enough Street Credit", "Sorry, you do not have enough Street Credit to qualify for this purchase.  You need to win races and build up your cred.");
  4406.             break;
  4407.         }
  4408.         case -3:
  4409.         {
  4410.             _root.displayAlert("warning", "Unavailable Funds", "Sorry, you do not have enough in your account to pay for this.");
  4411.             break;
  4412.         }
  4413.         case -4:
  4414.         {
  4415.             _root.displayAlert("warning", "Illegal Action", "Sorry, you can\'t buy a stock plate for your car.  Stock plates only come with new car purchases.");
  4416.             break;
  4417.         }
  4418.         case -5:
  4419.         {
  4420.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the plate for is impounded.");
  4421.             break;
  4422.         }
  4423.         case -6:
  4424.         {
  4425.             _root.displayAlert("warning", "Member Only", "I\'m sorry, but the plate you selected is only available for members only.");
  4426.             break;
  4427.         }
  4428.         case -7:
  4429.         {
  4430.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the plate for is locked.");
  4431.             break;
  4432.         }
  4433.         case -8:
  4434.         {
  4435.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the plate for is not yours.");
  4436.             break;
  4437.         }
  4438.         case -9:
  4439.         {
  4440.             _root.markTestDriveExpiredAndDisplayWarning();
  4441.             break;
  4442.         }
  4443.         case -50:
  4444.         {
  4445.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  4446.             break;
  4447.         }
  4448.     } // End of switch
  4449. } // End of the function
  4450. function getLicensePlates()
  4451. {
  4452.     classes.Frame.serverLights(true);
  4453.     getURL("lingo: executeCall \"getlicenseplates\"");
  4454. } // End of the function
  4455. function getLicensePlatesCB(d)
  4456. {
  4457.     classes.Frame.serverLights(false);
  4458.     _global.platesXML = new XML(d);
  4459. } // End of the function
  4460. function buyVanity(acid, pn, pt)
  4461. {
  4462.     classes.Frame.serverLights(true);
  4463.     getURL("lingo: executeCall \"buyvanity\", \"acid=" + acid + "&pn=" + escape(pn) + "&pt=" + pt + "\"", "");
  4464. } // End of the function
  4465. function buyVanityCB(s, b)
  4466. {
  4467.     classes.Frame.serverLights(false);
  4468.     switch (s)
  4469.     {
  4470.         case 2:
  4471.         case 1:
  4472.         {
  4473.             if (s == 1)
  4474.             {
  4475.                 classes.GlobalData.updateInfo("p", b);
  4476.             }
  4477.             else if (s == 2)
  4478.             {
  4479.                 classes.GlobalData.updateInfo("m", b);
  4480.             } // end else if
  4481.             _global.shopLicensesMC.installCartPlateNumber();
  4482.             break;
  4483.         }
  4484.         case 0:
  4485.         {
  4486.             _root.displayAlert("warning", "Plate not Available", "Sorry, the plate you selected is not available.");
  4487.             break;
  4488.         }
  4489.         case -1:
  4490.         {
  4491.             _root.displayAlert("warning", "Plate not Available", "Sorry, the plate you selected is not available.");
  4492.             break;
  4493.         }
  4494.         case -2:
  4495.         {
  4496.             _root.displayAlert("warning", "Too Many Characters", "Sorry, the plate number you selected is too long.");
  4497.             break;
  4498.         }
  4499.         case -3:
  4500.         {
  4501.             _root.displayAlert("warning", "Insufficient Funds", "Sorry, you do not have enough in your balance to pay for this.  Try winning some races.");
  4502.             break;
  4503.         }
  4504.         case -4:
  4505.         {
  4506.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the plate for is impounded.");
  4507.             break;
  4508.         }
  4509.         case -5:
  4510.         {
  4511.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the plate for is locked.");
  4512.             break;
  4513.         }
  4514.         case -6:
  4515.         {
  4516.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the plate for is not yours.");
  4517.             break;
  4518.         }
  4519.         case -7:
  4520.         {
  4521.             _root.markTestDriveExpiredAndDisplayWarning();
  4522.             break;
  4523.         }
  4524.         case -50:
  4525.         {
  4526.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  4527.             break;
  4528.         }
  4529.     } // End of switch
  4530. } // End of the function
  4531. function getSystemParts(acid, etid)
  4532. {
  4533.     classes.Frame.serverLights(true);
  4534.     getURL("lingo: executeCall \"getsystemparts\", \"acid=" + acid + "&etid=" + etid + "\"", "");
  4535. } // End of the function
  4536. function getSystemPartsCB(s, d)
  4537. {
  4538.     classes.Frame.serverLights(false);
  4539.     if (s == 1)
  4540.     {
  4541.         var _loc3 = new XML();
  4542.         _loc3.ignoreWhite = true;
  4543.         _loc3.parseXML(d);
  4544.         _global.shopPartsMC.gotoAndPlay("swap");
  4545.         _global.shopPartsMC.buildSwapMenu(_loc3);
  4546.     }
  4547.     else
  4548.     {
  4549.         _root.displayAlert("warning", "Engine not Found", "Sorry, the engine type you picked can\'t be loaded.");
  4550.     } // end else if
  4551. } // End of the function
  4552. function systemSwap(acid, etid, aepids)
  4553. {
  4554.     classes.Frame.serverLights(true);
  4555.     getURL("lingo: executeCall \"systemswap\", \"acid=" + acid + "&etid=" + etid + "&aepids=" + aepids + "\"", "");
  4556. } // End of the function
  4557. function systemSwapCB(s, d)
  4558. {
  4559.     classes.Frame.serverLights(false);
  4560.     switch (s)
  4561.     {
  4562.         case 1:
  4563.         {
  4564.             if (d.length)
  4565.             {
  4566.                 classes.GlobalData.replaceCarNode(d);
  4567.             } // end if
  4568.             _global.shopPartsMC.swapMenuSP.destroy();
  4569.             _global.shopPartsMC.swapItemSP.destroy();
  4570.             _global.shopPartsMC.partType = "Car Parts";
  4571.             _global.shopPartsMC.gotoAndPlay("retrieve");
  4572.             _root.displayAlert("success", "System Updated", "Congratulations, you have successfully swapped your system.");
  4573.             break;
  4574.         }
  4575.         case -1:
  4576.         {
  4577.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4578.             break;
  4579.         }
  4580.         case -2:
  4581.         {
  4582.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4583.             break;
  4584.         }
  4585.         case -3:
  4586.         {
  4587.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4588.             break;
  4589.         }
  4590.         case -4:
  4591.         {
  4592.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4593.             break;
  4594.         }
  4595.         case -5:
  4596.         {
  4597.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4598.             break;
  4599.         }
  4600.         case -6:
  4601.         {
  4602.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4603.             break;
  4604.         }
  4605.         case -7:
  4606.         {
  4607.             break;
  4608.         }
  4609.         case -8:
  4610.         {
  4611.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4612.             break;
  4613.         }
  4614.         case -9:
  4615.         {
  4616.             _root.displayAlert("warning", "Incomplete Parts", "I\'m sorry, but you\'re missing parts for the system swap.");
  4617.             break;
  4618.         }
  4619.         case -10:
  4620.         {
  4621.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  4622.             break;
  4623.         }
  4624.         case -11:
  4625.         {
  4626.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is locked.");
  4627.             break;
  4628.         }
  4629.         case -12:
  4630.         {
  4631.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is not yours.");
  4632.             break;
  4633.         }
  4634.         case -13:
  4635.         {
  4636.             _root.markTestDriveExpiredAndDisplayWarning();
  4637.             break;
  4638.         }
  4639.         case -50:
  4640.         {
  4641.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  4642.             break;
  4643.         }
  4644.     } // End of switch
  4645. } // End of the function
  4646. function engineList()
  4647. {
  4648.     getURL("lingo: executeCall \"egue\"");
  4649. } // End of the function
  4650. function engineListCB(s, d)
  4651. {
  4652.     if (s == 1)
  4653.     {
  4654.         _global.shopPartsMC.enginePartXML.parseXML(d);
  4655.         _root.abc.contentMC.CB_engineList();
  4656.     } // end if
  4657. } // End of the function
  4658. function engineGetAllParts(aeid)
  4659. {
  4660.     var _loc1 = Number(classes.GlobalData.attr.mb);
  4661.     getURL("lingo: executeCall \"egep\", \"aeid=" + aeid + "&m=" + _loc1 + "\"", "");
  4662.     classes.Frame.serverLights(true);
  4663. } // End of the function
  4664. function engineGetAllPartsCB(d, d1)
  4665. {
  4666.     classes.Frame.serverLights(false);
  4667.     _global.partXML = new XML();
  4668.     _global.partXML.ignoreWhite = true;
  4669.     _global.partXML.parseXML(d);
  4670.     _global.shopPartsMC.gotoShowroom(d1);
  4671. } // End of the function
  4672. function engineBuyPart(epid, pt)
  4673. {
  4674.     getURL("lingo: executeCall \"ebep\", \"epid=" + epid + "&pt=" + pt + "\"", "");
  4675. } // End of the function
  4676. function engineBuyPartCB(d)
  4677. {
  4678.     var _loc2 = new XML();
  4679.     _loc2.ignoreWhite = true;
  4680.     _loc2.parseXML(d);
  4681.     switch (Number(_loc2.firstChild.attributes.s))
  4682.     {
  4683.         case 2:
  4684.         case 1:
  4685.         {
  4686.             if (Number(_loc2.firstChild.attributes.s) == 1)
  4687.             {
  4688.                 classes.GlobalData.updateInfo("p", Number(_loc2.firstChild.attributes.b));
  4689.             }
  4690.             else
  4691.             {
  4692.                 classes.GlobalData.updateInfo("m", Number(_loc2.firstChild.attributes.b));
  4693.             } // end else if
  4694.             _root.abc.contentMC.txtTitle = "Part is Purchased";
  4695.             _root.abc.contentMC.txtMsg = "Congratulations, the part is successfully purchased and placed in your garage.";
  4696.             _root.abc.removeButtons();
  4697.             _root.abc.addButton("OK");
  4698.             break;
  4699.         }
  4700.         case 0:
  4701.         {
  4702.             _root.displayAlert("warning", "Purchase Error", "Sorry, the purchase attempt failed.  Please try again later.");
  4703.             break;
  4704.         }
  4705.         case -1:
  4706.         {
  4707.             _root.displayAlert("warning", "Purchase Error", "Sorry, this part is only available to users with paid memberships.  Please see www.NittoLegends.com for more information.");
  4708.             break;
  4709.         }
  4710.         case -2:
  4711.         {
  4712.             _root.displayAlert("warning", "Purchase Error", "This attempt failed because the part is not available for purchase with the chosen payment method.  Please use another form of payment.");
  4713.             break;
  4714.         }
  4715.         case -3:
  4716.         {
  4717.             _root.displayAlert("warning", "Insufficient Funds", "Sorry, you do not have enough in your balance to pay for this.  Try winning some races, or you could try buying a cheaper part.");
  4718.             break;
  4719.         }
  4720.         case -4:
  4721.         {
  4722.             _root.displayAlert("warning", "Purchase Error", "This part will not fit on the selected car.");
  4723.             break;
  4724.         }
  4725.         case -5:
  4726.         {
  4727.             _root.displayAlert("warning", "Purchase Error", "This part is not available for your location.");
  4728.             break;
  4729.         }
  4730.         case -50:
  4731.         {
  4732.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  4733.             break;
  4734.         }
  4735.     } // End of switch
  4736. } // End of the function
  4737. function engineSwapStart(aeid)
  4738. {
  4739.     getURL("lingo: executeCall \"esst\", \"aeid=" + aeid + "\"", "");
  4740. } // End of the function
  4741. function engineSwapStartCB(s, d)
  4742. {
  4743.     if (s == 1)
  4744.     {
  4745.         var _loc3 = new XML();
  4746.         _loc3.ignoreWhite = true;
  4747.         _loc3.parseXML(d);
  4748.         _global.shopPartsMC.gotoAndPlay("swap");
  4749.         _global.shopPartsMC.buildSwapMenu(_loc3);
  4750.     }
  4751.     else
  4752.     {
  4753.         _root.displayAlert("warning", "Engine not Found", "Sorry, the engine type you picked can\'t be loaded.");
  4754.     } // end else if
  4755. } // End of the function
  4756. function engineSwapFinish(acid, aeid, aepids)
  4757. {
  4758.     getURL("lingo: executeCall \"esfi\", \"acid=" + acid + "&aeid=" + aeid + "&aepids=" + aepids + "\"", "");
  4759. } // End of the function
  4760. function engineSwapFinishCB(s, d)
  4761. {
  4762.     switch (s)
  4763.     {
  4764.         case 1:
  4765.         {
  4766.             var _loc3 = new XML();
  4767.             _loc3.ignoreWhite = true;
  4768.             _loc3.parseXML(d);
  4769.             classes.GlobalData.getSelectedCarXML().attributes.ae = _loc3.firstChild.attributes.ae;
  4770.             classes.GlobalData.getSelectedCarXML().attributes.et = _loc3.firstChild.attributes.et;
  4771.             _global.shopPartsMC.onSwapEngineSuccess();
  4772.             _root.displayAlert("success", "Engine Swapped", "Congratulations, you have successfully swapped your engine.");
  4773.             break;
  4774.         }
  4775.         case 0:
  4776.         {
  4777.             _root.displayAlert("warning", "Engine Not Available", "I\'m sorry, but we can\'t locate the engine you selected.");
  4778.             break;
  4779.         }
  4780.         case -1:
  4781.         {
  4782.             _root.displayAlert("warning", "Car Not Available", "I\'m sorry, but we can\'t locate the car you selected.");
  4783.             break;
  4784.         }
  4785.         case -2:
  4786.         {
  4787.             _root.displayAlert("warning", "Engine Not Available", "I\'m sorry, but we can\'t locate the engine you selected.");
  4788.             break;
  4789.         }
  4790.         case -3:
  4791.         {
  4792.             _root.displayAlert("warning", "Parts Incompatibility", "I\'m sorry, but we can\'t use the parts you selected.");
  4793.             break;
  4794.         }
  4795.         case -4:
  4796.         {
  4797.             _root.displayAlert("warning", "Missing Parts", "I\'m sorry, but there are missing parts for the engine swap.");
  4798.             break;
  4799.         }
  4800.         case -5:
  4801.         {
  4802.             _root.displayAlert("warning", "Missing Parts", "I\'m sorry, but there are missing parts for the engine swap.");
  4803.             break;
  4804.         }
  4805.         case -6:
  4806.         {
  4807.             _root.displayAlert("warning", "Missing Parts", "I\'m sorry, but there are missing parts for the engine swap.");
  4808.             break;
  4809.         }
  4810.         case -7:
  4811.         {
  4812.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to swap the engine for is impounded.");
  4813.             break;
  4814.         }
  4815.         case -8:
  4816.         {
  4817.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to swap the engine for is locked.");
  4818.             break;
  4819.         }
  4820.         case -50:
  4821.         {
  4822.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  4823.             break;
  4824.         }
  4825.     } // End of switch
  4826. } // End of the function
  4827. function getGearInfo(acid)
  4828. {
  4829.     getURL("lingo: executeCall \"getgearinfo\" \"acid=" + acid + "\"", "");
  4830. } // End of the function
  4831. function getGearInfoCB(s, d)
  4832. {
  4833.     if (s == 1)
  4834.     {
  4835.         _global.shopPartsMC.showGearRatio(d);
  4836.     }
  4837.     else
  4838.     {
  4839.         _root.displayAlert("warning", "Data Not Available", "Sorry, the gear ratio for your car can\'t be found.");
  4840.     } // end else if
  4841. } // End of the function
  4842. function buyGears(acid, pt, g1, g2, g3, g4, g5, g6, fg)
  4843. {
  4844.     var _loc1 = new LoadVars();
  4845.     _loc1.acid = acid;
  4846.     _loc1.pt = pt;
  4847.     if (isNaN(Number(g1)))
  4848.     {
  4849.         _loc1.g1 = 0;
  4850.     }
  4851.     else
  4852.     {
  4853.         _loc1.g1 = g1;
  4854.     } // end else if
  4855.     if (isNaN(Number(g2)))
  4856.     {
  4857.         _loc1.g2 = 0;
  4858.     }
  4859.     else
  4860.     {
  4861.         _loc1.g2 = g2;
  4862.     } // end else if
  4863.     if (isNaN(Number(g3)))
  4864.     {
  4865.         _loc1.g3 = 0;
  4866.     }
  4867.     else
  4868.     {
  4869.         _loc1.g3 = g3;
  4870.     } // end else if
  4871.     if (isNaN(Number(g4)))
  4872.     {
  4873.         _loc1.g4 = 0;
  4874.     }
  4875.     else
  4876.     {
  4877.         _loc1.g4 = g4;
  4878.     } // end else if
  4879.     if (isNaN(Number(g5)))
  4880.     {
  4881.         _loc1.g5 = 0;
  4882.     }
  4883.     else
  4884.     {
  4885.         _loc1.g5 = g5;
  4886.     } // end else if
  4887.     if (isNaN(Number(g6)))
  4888.     {
  4889.         _loc1.g6 = 0;
  4890.     }
  4891.     else
  4892.     {
  4893.         _loc1.g6 = g6;
  4894.     } // end else if
  4895.     if (isNaN(Number(fg)))
  4896.     {
  4897.         _loc1.fg = 0;
  4898.     }
  4899.     else
  4900.     {
  4901.         _loc1.fg = fg;
  4902.     } // end else if
  4903.     getURL("lingo: executeCall \"buygears\", \"" + _loc1.toString() + "\"", "");
  4904. } // End of the function
  4905. function buyGearsCB(s, b)
  4906. {
  4907.     if (s > 0)
  4908.     {
  4909.         if (s == 2)
  4910.         {
  4911.             classes.GlobalData.updateInfo("m", b);
  4912.         }
  4913.         else
  4914.         {
  4915.             classes.GlobalData.updateInfo("p", b);
  4916.         } // end else if
  4917.         _root.abc.contentMC.alertIconMC.gotoAndStop("shopplus");
  4918.         _root.abc.contentMC.txtTitle = "Gear Ratio is Modified";
  4919.         _root.abc.contentMC.txtMsg = "Congratulations, the gear ratios are successfully purchased and modified in your engine.";
  4920.         _root.abc.removeButtons();
  4921.         _root.abc.addButton("OK");
  4922.     }
  4923.     else
  4924.     {
  4925.         _root.abc.contentMC.gotoAndStop("response");
  4926.         _root.abc.contentMC.alertIconMC.gotoAndStop("install");
  4927.         _root.abc.removeButtons();
  4928.         _root.abc.addButton("Cancel");
  4929.         switch (s)
  4930.         {
  4931.             case 0:
  4932.             {
  4933.                 _root.abc.contentMC.txtTitle = "Engine not Available";
  4934.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but we can\'t load the engine to modify the gear ratios. Please try again.";
  4935.                 break;
  4936.             }
  4937.             case -1:
  4938.             {
  4939.                 _root.abc.contentMC.txtTitle = "Gears not Available";
  4940.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but you don\'t have that many gears available in your engine. Please try again.";
  4941.                 break;
  4942.             }
  4943.             case -2:
  4944.             {
  4945.                 _root.abc.contentMC.txtTitle = "Invalid Gear Value";
  4946.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but negative numbers aren\'t allowed. Please try again.";
  4947.                 break;
  4948.             }
  4949.             case -3:
  4950.             {
  4951.                 _root.abc.contentMC.txtTitle = "Incomplete Gear Ratios";
  4952.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but at least one of the gears doesn\'t have a value. Please try again.";
  4953.                 break;
  4954.             }
  4955.             case -4:
  4956.             {
  4957.                 _root.abc.contentMC.txtTitle = "Wrong Gear Order";
  4958.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but gear ratios must be in order from largest to smallest (1st > 2nd > 3rd, etc). Please try again.";
  4959.                 break;
  4960.             }
  4961.             case -5:
  4962.             case -6:
  4963.             {
  4964.                 _root.abc.contentMC.txtTitle = "Insufficient Fund";
  4965.                 _root.abc.contentMC.txtMsg = "Sorry, you do not have enough in your balance to pay for this.  Try winning some races, or you could try buying a cheaper part.";
  4966.                 break;
  4967.             }
  4968.             case -7:
  4969.             {
  4970.                 _root.abc.contentMC.txtTitle = "Invalid Gear Value";
  4971.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but 10 is the highest value allowed. Please try again.";
  4972.                 break;
  4973.             }
  4974.             case -8:
  4975.             {
  4976.                 _root.abc.contentMC.txtTitle = "Car is Impounded";
  4977.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the car you\'re buying the gear for is impounded. Please try again.";
  4978.                 break;
  4979.             }
  4980.             case -9:
  4981.             {
  4982.                 _root.abc.contentMC.txtTitle = "Car is Locked";
  4983.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the car you\'re buying the gear for is locked. Please try again.";
  4984.                 break;
  4985.             }
  4986.             case -10:
  4987.             {
  4988.                 _root.abc.contentMC.txtTitle = "Car not Available";
  4989.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the car you\'re buying the gear for is not yours. Please try again.";
  4990.                 break;
  4991.             }
  4992.             case -11:
  4993.             {
  4994.                 _root.abc.contentMC.txtTitle = "Invalid Gear Value";
  4995.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the first gear must be higher than 2.50. Please try again.";
  4996.                 break;
  4997.             }
  4998.             case -12:
  4999.             {
  5000.                 _root.abc.contentMC.txtTitle = "Invalid Gear Value";
  5001.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the second gear must be higher than 1.60. Please try again.";
  5002.                 break;
  5003.             }
  5004.             case -13:
  5005.             {
  5006.                 _root.abc.contentMC.txtTitle = "Invalid Gear Value";
  5007.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the third gear must be higher than 1.20. Please try again.";
  5008.                 break;
  5009.             }
  5010.             case -14:
  5011.             {
  5012.                 _root.abc.contentMC.txtTitle = "Invalid Gear Value";
  5013.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the final gear must be higher than 2.50. Please try again.";
  5014.                 break;
  5015.             }
  5016.             case -15:
  5017.             {
  5018.                 classes.GlobalData.makeTestDriveCarExpired();
  5019.                 _root.abc.contentMC.txtTitle = "Drive Expired";
  5020.                 _root.abc.contentMC.txtMsg = "I\'m sorry, but the car you\'re buying the gear for is an expired test drive car. Please try again.";
  5021.                 break;
  5022.             }
  5023.         } // End of switch
  5024.     } // end else if
  5025. } // End of the function
  5026. function getSparePrice()
  5027. {
  5028.     getURL("lingo: executeCall \"getspareprice\"");
  5029. } // End of the function
  5030. function getSparePriceCB(s, p)
  5031. {
  5032.     if (s == 1)
  5033.     {
  5034.         _global.shopPartsMC.onSellAllSpareParts(p);
  5035.     } // end if
  5036. } // End of the function
  5037. function sellAllSpare()
  5038. {
  5039.     getURL("lingo: executeCall \"sellallspare\", \"acid=" + classes.GlobalData.getSelectedCarXML().attributes.i + "\"", "");
  5040. } // End of the function
  5041. function sellAllSpareCB(s, b)
  5042. {
  5043.     if (s == 1)
  5044.     {
  5045.         classes.GlobalData.updateInfo("m", b);
  5046.         _root.abc.contentMC.gotoAndStop("response");
  5047.         _root.abc.contentMC.alertIconMC.gotoAndStop("shopplus");
  5048.         _root.abc.contentMC.txtTitle = "All Spare Parts are Sold";
  5049.         _root.abc.contentMC.txtMsg = "All parts are successfully traded in.";
  5050.         _root.abc.removeButtons();
  5051.         _root.abc.addButton("OK");
  5052.         _global.partsBinXML.parseXML("<n2/>");
  5053.         _global.shopPartsMC.gotoAndPlay("refresh");
  5054.     }
  5055.     else if (s == -1)
  5056.     {
  5057.         displayAlert("warning", "Test Drive Car", "I\'m sorry, but you cannot sell parts from a test drive car.");
  5058.     } // end else if
  5059. } // End of the function
  5060. function getPartDescription(pid, pt)
  5061. {
  5062.     getURL("lingo: executeCall \"getdescription\", \"id=" + pid + "&pt=" + pt + "\"", "");
  5063. } // End of the function
  5064. function getPartDescriptionCB(d)
  5065. {
  5066.     var _loc2 = new XML();
  5067.     _loc2.ignoreWhite = true;
  5068.     _loc2.parseXML(d);
  5069.     if (_loc2.firstChild.firstChild.nodeValue)
  5070.     {
  5071.         _global.shopPartsMC.partDetail.fldDescription.text = _loc2.firstChild.firstChild.nodeValue;
  5072.     } // end if
  5073. } // End of the function
  5074. function getInstalledEngineParts(accountCarID)
  5075. {
  5076.     classes.Frame.serverLights(true);
  5077.     getURL("lingo: executeCall \"getinstalledenginepartbyaccountcar\", \"acid=" + accountCarID + "\"", "");
  5078. } // End of the function
  5079. function getInstalledEnginePartsCB(s, d)
  5080. {
  5081.     classes.Frame.serverLights(false);
  5082.     switch (s)
  5083.     {
  5084.         case 1:
  5085.         {
  5086.             var _loc1 = new XML(d);
  5087.             classes.Lookup.runCallback("getInstalledEngineParts", "", _loc1);
  5088.             break;
  5089.         }
  5090.         case -1:
  5091.         {
  5092.             break;
  5093.         }
  5094.         case -2:
  5095.         {
  5096.             break;
  5097.         }
  5098.     } // End of switch
  5099. } // End of the function
  5100. function getRepairParts(acid)
  5101. {
  5102.     getURL("lingo: executeCall \"getrepairparts\", \"acid=" + acid + "\"", "");
  5103. } // End of the function
  5104. function getRepairPartsCB(s, d)
  5105. {
  5106.     if (s == 1)
  5107.     {
  5108.         var _loc2 = new XML();
  5109.         _loc2.ignoreWhite = true;
  5110.         _loc2.parseXML(d);
  5111.         repairPartMC.loadRepairShop(_loc2);
  5112.     }
  5113.     else
  5114.     {
  5115.         _root.displayAlert("warning", "Repair Error", "Sorry, the repair attempt failed.  Please try again later.");
  5116.     } // end else if
  5117. } // End of the function
  5118. function repairParts(acid, aepids, price, pt)
  5119. {
  5120.     _global.repairPartsPrice = price;
  5121.     getURL("lingo: executeCall \"repairparts\", \"acid=" + acid + "&aepids=" + aepids + "&pt=" + pt + "\"", "");
  5122. } // End of the function
  5123. function repairPartsCB(s)
  5124. {
  5125.     switch (s)
  5126.     {
  5127.         case 2:
  5128.         {
  5129.             _root.displayAlert("success", "Part(s) Repaired", "You have repaired the selected part(s).");
  5130.             classes.GlobalData.addFunds(-_global.repairPartsPrice);
  5131.             repairPartMC.gotoAndPlay("refresh");
  5132.             break;
  5133.         }
  5134.         case 1:
  5135.         {
  5136.             _root.displayAlert("success", "Part(s) Repaired", "You have repaired the selected part(s).");
  5137.             classes.GlobalData.addPoints(-_global.repairPartsPrice);
  5138.             repairPartMC.gotoAndPlay("refresh");
  5139.             break;
  5140.         }
  5141.         case 0:
  5142.         {
  5143.             _root.displayAlert("warning", "Repair Error", "Sorry, the repair attempt failed.  Please try again later.");
  5144.             break;
  5145.         }
  5146.         case -1:
  5147.         {
  5148.             _root.displayAlert("warning", "Repair Error", "Sorry, you don\'t have enough balance to repair the parts.");
  5149.             break;
  5150.         }
  5151.         case -2:
  5152.         {
  5153.             _root.displayAlert("warning", "Repair Error", "Sorry, you don\'t have enough points to repair the parts.");
  5154.             break;
  5155.         }
  5156.         case -3:
  5157.         {
  5158.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  5159.             break;
  5160.         }
  5161.         case -4:
  5162.         {
  5163.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is locked.");
  5164.             break;
  5165.         }
  5166.         case -5:
  5167.         {
  5168.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is not yours.");
  5169.             break;
  5170.         }
  5171.         case -50:
  5172.         {
  5173.             _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  5174.             break;
  5175.         }
  5176.     } // End of switch
  5177.     delete _global.repairPartsPrice;
  5178. } // End of the function
  5179. function getEmailTotalNew()
  5180. {
  5181.     getURL("lingo: executeCall \"gettotalnewmail\"");
  5182. } // End of the function
  5183. function getEmailTotalNewCB(s, eNum)
  5184. {
  5185.     classes.GlobalData.updateInfo("im", eNum);
  5186. } // End of the function
  5187. function getEmailList()
  5188. {
  5189.     classes.Frame.serverLights(true);
  5190.     getURL("lingo: executeCall \"getemaillist\"");
  5191. } // End of the function
  5192. function getEmailListCB(d)
  5193. {
  5194.     classes.Frame.serverLights(false);
  5195.     _global.inbox_xml = new XML();
  5196.     _global.inbox_xml.ignoreWhite = true;
  5197.     _global.inbox_xml.parseXML(d);
  5198.     classes.GlobalData.updateInfo("im", "count");
  5199.     classes.Email.redrawInbox();
  5200. } // End of the function
  5201. function getEmail(id)
  5202. {
  5203.     getURL("lingo: executeCall \"getemail\", \"eid=" + id + "\"", "");
  5204. } // End of the function
  5205. function getEmailCB(d)
  5206. {
  5207.     var _loc1 = new XML();
  5208.     _loc1.ignoreWhite = true;
  5209.     _loc1.parseXML(d);
  5210.     classes.Email.viewMail(_loc1);
  5211. } // End of the function
  5212. function markEmailRead(id)
  5213. {
  5214.     getURL("lingo: executeCall \"markemailread\", \"eid=" + id + "\"", "");
  5215. } // End of the function
  5216. function deleteEmail(id)
  5217. {
  5218.     classes.Email.viewedEmailID = 0;
  5219.     getURL("lingo: executeCall \"deleteemail\", \"eid=" + id + "\"", "");
  5220. } // End of the function
  5221. function deleteEmailCB(s, eid)
  5222. {
  5223.     if (s == 1)
  5224.     {
  5225.         for (var _loc2 = 0; _loc2 < _global.inbox_xml.firstChild.childNodes.length; ++_loc2)
  5226.         {
  5227.             if (_global.inbox_xml.firstChild.childNodes[_loc2].attributes.i == eid)
  5228.             {
  5229.                 _global.inbox_xml.firstChild.childNodes[_loc2].removeNode();
  5230.                 getEmailTotalNew();
  5231.                 break;
  5232.             } // end if
  5233.         } // end of for
  5234.     } // end if
  5235. } // End of the function
  5236. function sendEmail(tu, s, b, id)
  5237. {
  5238.     if (classes.Control.serverAvail())
  5239.     {
  5240.         if (!s.length)
  5241.         {
  5242.             s = " ";
  5243.         } // end if
  5244.         classes.Frame.serverLights(true);
  5245.         var _loc1 = new LoadVars();
  5246.         _loc1.tu = tu;
  5247.         _loc1.s = s;
  5248.         _loc1.b = b;
  5249.         _loc1.i = id;
  5250.         getURL("lingo: executeCall \"sendemail\", \"" + _loc1.toString() + "\"", "");
  5251.     } // end if
  5252. } // End of the function
  5253. function sendEmailCB(d)
  5254. {
  5255.     var _loc2 = new XML();
  5256.     _loc2.ignoreWhite = true;
  5257.     _loc2.parseXML(d);
  5258.     classes.Frame.serverLights(false);
  5259.     classes.Control.serverUnlock();
  5260.     switch (_loc2.firstChild.attributes.s)
  5261.     {
  5262.         case "1":
  5263.         {
  5264.             _root["compose" + _loc2.firstChild.attributes.id].removeMovieClip();
  5265.             break;
  5266.         }
  5267.         default:
  5268.         {
  5269.             _root.displayAlert("warning", _loc2.firstChild.attributes.t, _loc2.firstChild.attributes.m);
  5270.         }
  5271.     } // End of switch
  5272. } // End of the function
  5273. function addRemark(remark, toID)
  5274. {
  5275.     var _loc1 = new LoadVars();
  5276.     _loc1.rmk = remark;
  5277.     _loc1.tid = toID;
  5278.     getURL("lingo: executeCall \"addremark\", \"" + _loc1.toString() + "\"", "");
  5279. } // End of the function
  5280. function addRemarkCB(s)
  5281. {
  5282.     switch (s)
  5283.     {
  5284.         case 1:
  5285.         {
  5286.             dialogGiveRemark.contentMC.gotoAndPlay("success");
  5287.             break;
  5288.         }
  5289.         case 0:
  5290.         {
  5291.             viewer.remarkError("Sorry, this user was not found in our records.");
  5292.             break;
  5293.         }
  5294.         case -1:
  5295.         {
  5296.             viewer.remarkError("Sorry, this user is not your buddy.  You may only give remarks to your buddies.");
  5297.             break;
  5298.         }
  5299.         case -2:
  5300.         {
  5301.             viewer.remarkError("Sorry, there was a server error.  Please try again.");
  5302.             break;
  5303.         }
  5304.         case -3:
  5305.         {
  5306.             viewer.remarkError("Sorry, this user\'s remark box is full.");
  5307.             break;
  5308.         }
  5309.         case -60:
  5310.         {
  5311.             viewer.remarkError("Sorry, you must verify your account to leave remarks.");
  5312.             break;
  5313.         }
  5314.     } // End of switch
  5315. } // End of the function
  5316. function deleteRemark(accountRemarkID)
  5317. {
  5318.     if (classes.Control.serverAvail())
  5319.     {
  5320.         getURL("lingo: executeCall \"deleteremark\", \"arid=" + accountRemarkID + "\"", "");
  5321.     } // end if
  5322. } // End of the function
  5323. function deleteRemarkCB(s, arid)
  5324. {
  5325.     classes.Control.serverUnlock();
  5326.     if (s)
  5327.     {
  5328.         var _loc4 = _global.myRemarksXML.firstChild.childNodes.length - 1;
  5329.         if (_loc4 || _loc4 === 0)
  5330.         {
  5331.             for (var _loc2 = _loc4; _loc2 >= 0; --_loc2)
  5332.             {
  5333.                 if (_global.myRemarksXML.firstChild.childNodes[_loc2].attributes.rid == arid)
  5334.                 {
  5335.                     _global.myRemarksXML.firstChild.childNodes[_loc2].removeNode();
  5336.                 } // end if
  5337.             } // end of for
  5338.         } // end if
  5339.         if (classes.HomeProfile._MC.scrollerContent.remarkMC)
  5340.         {
  5341.             classes.HomeProfile._MC.scrollerContent.remarkMC.drawAllRemark(_global.myRemarksXML, true);
  5342.         } // end if
  5343.        
  5344.     } // end if
  5345. } // End of the function
  5346. function getRemarks()
  5347. {
  5348.     classes.Frame.serverLights(true);
  5349.     getURL("lingo: executeCall \"getremarks\"");
  5350. } // End of the function
  5351. function getRemarksCB(d)
  5352. {
  5353.     classes.Frame.serverLights(false);
  5354.     classes.HomeProfile._MC.CB_getRemarks(d);
  5355. } // End of the function
  5356. function getUserRemarks(tid)
  5357. {
  5358.     getURL("lingo: executeCall \"getuserremarks\", \"tid=" + tid + "\"", "");
  5359. } // End of the function
  5360. function getUserRemarksCB(d)
  5361. {
  5362.     classes.Viewer.viewRemarksXML = new XML();
  5363.     classes.Viewer.viewRemarksXML.ignoreWhite = true;
  5364.     classes.Viewer.viewRemarksXML.parseXML(d);
  5365.     _root.viewer.scrollerContent.remarkMC.drawAllRemark(classes.Viewer.viewRemarksXML, false);
  5366. } // End of the function
  5367. function setRemarkNonDeletes(arids)
  5368. {
  5369.     if (classes.Control.serverAvail())
  5370.     {
  5371.         getURL("lingo: executeCall \"setnondeletes\", \"arids=" + arids + "\"", "");
  5372.     } // end if
  5373. } // End of the function
  5374. function setRemarkNonDeletesCB(s)
  5375. {
  5376.     classes.Control.serverUnlock();
  5377.     switch (s)
  5378.     {
  5379.         case 1:
  5380.         {
  5381.             _root.getRemarks();
  5382.             break;
  5383.         }
  5384.         case 0:
  5385.         {
  5386.             break;
  5387.         }
  5388.         case -1:
  5389.         {
  5390.             break;
  5391.         }
  5392.         case -2:
  5393.         {
  5394.             break;
  5395.         }
  5396.     } // End of switch
  5397. } // End of the function
  5398. function setRemarkDeletes(arids)
  5399. {
  5400.     if (classes.Control.serverAvail())
  5401.     {
  5402.         getURL("lingo: executeCall \"setdeletes\", \"arids=" + arids + "\"", "");
  5403.     } // end if
  5404. } // End of the function
  5405. function setRemarkDeletesCB(s)
  5406. {
  5407.     classes.Control.serverUnlock();
  5408.     if (s)
  5409.     {
  5410.         _root.getRemarks();
  5411.        
  5412.     } // end if
  5413. } // End of the function
  5414. function buddySetTop(baid)
  5415. {
  5416.     getURL("lingo: executeCall \"addastopbuddy\", \"baid=" + baid + "\"", "");
  5417. } // End of the function
  5418. function buddyUnsetTop(baid)
  5419. {
  5420.     getURL("lingo: executeCall \"removeastopbuddy\", \"baid=" + baid + "\"", "");
  5421. } // End of the function
  5422. function getLocations()
  5423. {
  5424.     getURL("lingo: executeCall \"getlocations\"");
  5425. } // End of the function
  5426. function getLocationsCB(d)
  5427. {
  5428.     _global.locationXML.parseXML(d);
  5429. } // End of the function
  5430. function moveLocation(lid, pt)
  5431. {
  5432.     _global.hMoveLoc = lid;
  5433.     classes.Frame.serverLights(true);
  5434.     getURL("lingo: executeCall \"movelocation\", \"lid=" + lid + "&pt=" + pt + "\"", "");
  5435. } // End of the function
  5436. function moveLocationCB(s, m)
  5437. {
  5438.     classes.Frame.serverLights(false);
  5439.     switch (s)
  5440.     {
  5441.         case 2:
  5442.         case 1:
  5443.         {
  5444.             if (s == 1)
  5445.             {
  5446.                 classes.GlobalData.updateInfo("p", m);
  5447.             }
  5448.             else
  5449.             {
  5450.                 classes.GlobalData.updateInfo("m", m);
  5451.             } // end else if
  5452.             classes.GlobalData.updateInfo("lid", _global.hMoveLoc);
  5453.             if (classes.Frame.__MC.map != undefined)
  5454.             {
  5455.                 classes.Frame.__MC.resetMap();
  5456.             }
  5457.             else
  5458.             {
  5459.                 classes.SectionHome.__MC.updateUserValues();
  5460.                 classes.HomeProfile._MC.goProfilePage(2);
  5461.             } // end else if
  5462.             _root.getCars();
  5463.             break;
  5464.         }
  5465.         case 0:
  5466.         {
  5467.             displayAlert("warning", "Error", "Sorry, you could not move your home because of some error.");
  5468.             break;
  5469.         }
  5470.         case -1:
  5471.         {
  5472.             break;
  5473.         }
  5474.         case -2:
  5475.         {
  5476.             displayAlert("warning", "Error", "Sorry, you could not move your home because of some error.");
  5477.             break;
  5478.         }
  5479.         case -3:
  5480.         {
  5481.             displayAlert("warning", "Not Enough Money", "Sorry, you do not have enough money to make this move.");
  5482.             break;
  5483.         }
  5484.         case -4:
  5485.         {
  5486.             displayAlert("warning", "Moving Failed", "Sorry, your move failed because you can not move to this location from your current location. You can only move one level up from your current location.");
  5487.             break;
  5488.         }
  5489.         case -5:
  5490.         {
  5491.             displayAlert("warning", "Not Enough Points", "Sorry, you do not have enough points to make this move.");
  5492.             break;
  5493.         }
  5494.         case -50:
  5495.         {
  5496.             displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  5497.             break;
  5498.         }
  5499.     } // End of switch
  5500.     delete _global.hMoveLoc;
  5501. } // End of the function
  5502. function changeHomeMachine()
  5503. {
  5504.     getURL("lingo: executeCall \"changehomemachine\"");
  5505. } // End of the function
  5506. function changeHomeMachineCB(s)
  5507. {
  5508.     if (s)
  5509.     {
  5510.        
  5511.     } // end if
  5512. } // End of the function
  5513. function changeEmail(newEmail, newEmailConfirm)
  5514. {
  5515.     if (newEmail == newEmailConfirm)
  5516.     {
  5517.         getURL("lingo: executeCall \"changeemail\", \"e=" + escape(newEmail) + "&ec=" + escape(newEmailConfirm) + "\"", "");
  5518.     }
  5519.     else
  5520.     {
  5521.         changeEmailCB(-2);
  5522.     } // end else if
  5523. } // End of the function
  5524. function changeEmailCB(s)
  5525. {
  5526.     switch (s)
  5527.     {
  5528.         case 2:
  5529.         {
  5530.             _global.homeAccountEmailMC.gotoAndPlay("updateSent");
  5531.             break;
  5532.         }
  5533.         case 1:
  5534.         {
  5535.             _global.homeAccountEmailMC.gotoAndPlay("emailDone");
  5536.             break;
  5537.         }
  5538.         case 0:
  5539.         {
  5540.             _root.displayAlert("warning", "Error Updating Email", "Sorry, an error occurred while trying to save your new email.  Please try again later.");
  5541.             _global.homeAccountEmailMC.gotoAndPlay("emailForm");
  5542.             break;
  5543.         }
  5544.         case -1:
  5545.         {
  5546.             _global.homeAccountEmailMC.gotoAndPlay("emailForm");
  5547.             _root.displayAlert("warning", "Invalid Machine", "Sorry, you can not update your email from the computer you are currently using.  Security protocols allow you to make account updates from your home machine only.");
  5548.             break;
  5549.         }
  5550.         case -2:
  5551.         {
  5552.             _global.homeAccountEmailMC.gotoAndPlay("emailForm");
  5553.             _root.displayAlert("warning", "New Emails Don\'t Match", "Sorry, the new email doesn\'t match the confirmed email. Please try again.");
  5554.             break;
  5555.         }
  5556.         case -3:
  5557.         {
  5558.             _global.homeAccountEmailMC.gotoAndPlay("emailForm");
  5559.             _root.displayAlert("warning", "Email Taken", "Sorry, the email you have entered has been used and verified by another account. Please try again.");
  5560.             break;
  5561.         }
  5562.         case -4:
  5563.         {
  5564.             _global.homeAccountEmailMC.gotoAndPlay("emailForm");
  5565.             _root.displayAlert("warning", "Invalid Email Format", "Sorry, the email you have entered is invalid. An email must follow the youremail@yourdomain.com format. Please try again.");
  5566.             break;
  5567.         }
  5568.         case -5:
  5569.         {
  5570.             _global.homeAccountEmailMC.gotoAndPlay("emailForm");
  5571.             _root.displayAlert("warning", "Error Sending Email", "Sorry, we can\'t send the new activation code to the email you have entered. Please try again.");
  5572.             break;
  5573.         }
  5574.     } // End of switch
  5575. } // End of the function
  5576. function getUser(tid)
  5577. {
  5578.     classes.Control.getUserID = tid;
  5579.     getURL("lingo: executeCall \"getuser\", \"tid=" + tid + "\"", "");
  5580. } // End of the function
  5581. function getUserCB(d)
  5582. {
  5583.     var _loc2 = new XML(d);
  5584.     var _loc1 = _loc2.firstChild.firstChild.attributes.i;
  5585.     classes.Lookup.addUserName(Number(_loc1), _loc2.firstChild.firstChild.attributes.u);
  5586.     classes.Lookup.addToUsersXML(_loc2.firstChild.firstChild);
  5587.     classes.Lookup.runCallback("getUser", _loc1, d);
  5588. } // End of the function
  5589. function getUsers(aidsArr)
  5590. {
  5591.     for (var _loc1 = 0; _loc1 < aidsArr.length; ++_loc1)
  5592.     {
  5593.         var _loc3 = classes.Lookup.getUserNode(aidsArr[_loc1]);
  5594.         if (_loc3)
  5595.         {
  5596.             var _loc4 = "<n2>" + _loc3.toString() + "</n2>";
  5597.             classes.Lookup.runCallback("getUsers", String(aidsArr[_loc1]), _loc4);
  5598.             aidsArr.splice(_loc1, 1);
  5599.         } // end if
  5600.     } // end of for
  5601.     if (aidsArr.length)
  5602.     {
  5603.         getURL("lingo: executeCall \"getusers\", \"aids=" + aidsArr.toString() + "\"", "");
  5604.     } // end if
  5605. } // End of the function
  5606. function getUsersCB(d)
  5607. {
  5608.     var _loc6 = new XML(d);
  5609.     var _loc5 = _loc6.firstChild.childNodes.length - 1;
  5610.     if (!isNaN(_loc5))
  5611.     {
  5612.         for (var _loc2 = _loc5; _loc2 >= 0; --_loc2)
  5613.         {
  5614.             var _loc1 = _loc6.firstChild.childNodes[_loc2];
  5615.             d = "<n2>" + _loc1.toString() + "</n2>";
  5616.             var _loc3 = String(_loc1.attributes.i);
  5617.             classes.Lookup.addUserName(Number(_loc3), _loc1.attributes.u);
  5618.             classes.Lookup.addToUsersXML(_loc1);
  5619.             classes.Lookup.runCallback("getUsers", _loc3, d);
  5620.         } // end of for
  5621.     } // end if
  5622. } // End of the function
  5623. function getUserBuddies(tid)
  5624. {
  5625.     classes.Control.serverAvail();
  5626.     getURL("lingo: executeCall \"getbuddies\", \"tid=" + tid + "\"", "");
  5627. } // End of the function
  5628. function getUserBuddiesCB(d)
  5629. {
  5630.     classes.Control.serverUnlock();
  5631.     classes.Viewer.viewBuddiesXML = new XML();
  5632.     classes.Viewer.viewBuddiesXML.ignoreWhite = true;
  5633.     classes.Viewer.viewBuddiesXML.parseXML(d);
  5634.     viewer.drawBuddies(1);
  5635. } // End of the function
  5636. function updateBgColor(bg)
  5637. {
  5638.     classes.GlobalData.updateInfo("bg", bg);
  5639.     getURL("lingo: executeCall \"updatebg\", \"bg=" + bg + "\"", "");
  5640. } // End of the function
  5641. function updateBgColorCB(s)
  5642. {
  5643. } // End of the function
  5644. function updateDefaultCar(acid)
  5645. {
  5646.     classes.GlobalData.setSelectedCar(acid);
  5647.     getURL("lingo: executeCall \"updatedefaultcar\", \"acid=" + acid + "\"", "");
  5648. } // End of the function
  5649. function updateDefaultCarCB(s)
  5650. {
  5651. } // End of the function
  5652. function racerSearch(st, pn)
  5653. {
  5654.     if (!pn)
  5655.     {
  5656.         pn = 1;
  5657.     } // end if
  5658.     classes.Frame.serverLights(true);
  5659.     getURL("lingo: executeCall \"racersearch\", \"st=" + escape(st) + "&pn=" + pn + "\"", "");
  5660. } // End of the function
  5661. function racerSearchCB(s, d)
  5662. {
  5663.     classes.Frame.serverLights(false);
  5664.     classes.Lookup.runCallback("racerSearch", "", d);
  5665. } // End of the function
  5666. function racerSearchNoPage(st)
  5667. {
  5668.     if (!pn)
  5669.     {
  5670.         pn = 1;
  5671.     } // end if
  5672.     classes.Frame.serverLights(true);
  5673.     getURL("lingo: executeCall \"racersearchnopage\", \"st=" + escape(st) + "\"", "");
  5674. } // End of the function
  5675. function racerSearchNoPageCB(s, d)
  5676. {
  5677.     classes.Frame.serverLights(false);
  5678.     classes.Lookup.runCallback("racerSearchNoPage", "", d);
  5679. } // End of the function
  5680. function getInfo()
  5681. {
  5682.     getURL("lingo: executeCall \"getinfo\"");
  5683. } // End of the function
  5684. function getInfoCB(d)
  5685. {
  5686. } // End of the function
  5687. function changePassword(opw, npw, npwc)
  5688. {
  5689.     if (npw.indexOf(" ") > -1)
  5690.     {
  5691.         changePasswordCB(-4);
  5692.     }
  5693.     else if (npw == npwc)
  5694.     {
  5695.         getURL("lingo: executeCall \"changepassword\",\"opw=" + escape(opw) + "&npw=" + escape(npw) + "&npwc=" + escape(npwc) + "\"", "");
  5696.     }
  5697.     else
  5698.     {
  5699.         changePasswordCB(-3);
  5700.     } // end else if
  5701. } // End of the function
  5702. function changePasswordCB(s)
  5703. {
  5704.     switch (s)
  5705.     {
  5706.         case 1:
  5707.         {
  5708.             _global.homeAccountSecurityMC.gotoAndPlay("passDone");
  5709.             break;
  5710.         }
  5711.         case 0:
  5712.         {
  5713.             _global.homeAccountSecurityMC.gotoAndPlay("securityForm");
  5714.             _root.displayAlert("warning", "Server Problem", "Sorry, the server can\'t save your new password. Please try again.");
  5715.             break;
  5716.         }
  5717.         case -1:
  5718.         {
  5719.             _global.homeAccountSecurityMC.gotoAndPlay("securityForm");
  5720.             _root.displayAlert("warning", "Invalid Machine", "Sorry, you can not update your email from the computer you are currently using.  Security protocols allow you to make account updates from your home machine only.");
  5721.             break;
  5722.         }
  5723.         case -2:
  5724.         {
  5725.             _global.homeAccountSecurityMC.gotoAndPlay("securityForm");
  5726.             _root.displayAlert("warning", "Wrong Old Password", "Sorry, the old password you have entered doesn\'t match the password in the system. Please try again.");
  5727.             break;
  5728.         }
  5729.         case -3:
  5730.         {
  5731.             _global.homeAccountSecurityMC.gotoAndPlay("securityForm");
  5732.             _root.displayAlert("warning", "Passwords Don\'t Match", "Sorry, the new password doesn\'t match the confirmed password. Please try again.");
  5733.             break;
  5734.         }
  5735.         case -4:
  5736.         {
  5737.             _global.homeAccountSecurityMC.gotoAndPlay("securityForm");
  5738.             _root.displayAlert("warning", "Bad Password", "Sorry, your password cannot contain any spaces. Please try again.");
  5739.             break;
  5740.         }
  5741.     } // End of switch
  5742. } // End of the function
  5743. function changePasswordReq(npw, npwc)
  5744. {
  5745.     if (npw.indexOf(" ") > -1)
  5746.     {
  5747.         _root.introHolder.cpCB_Intro(-4);
  5748.     }
  5749.     else if (npw == npwc)
  5750.     {
  5751.         getURL("lingo: executeCall \"changepasswordreq\",\"npw=" + escape(npw) + "&npwc=" + escape(npwc) + "\"", "");
  5752.     }
  5753.     else
  5754.     {
  5755.         _root.introHolder.cpCB_Intro(-3);
  5756.     } // end else if
  5757. } // End of the function
  5758. function forgotPassword(username)
  5759. {
  5760.     getURL("lingo: executeCall \"forgotpw\", \"un=" + escape(username) + "\"", "");
  5761. } // End of the function
  5762. function forgotPasswordCB(s)
  5763. {
  5764.     _global.clearTimeout(_root.abc.contentMC.sendSI);
  5765.     switch (s)
  5766.     {
  5767.         case 1:
  5768.         {
  5769.             _root.abc.contentMC.gotoAndPlay("sent");
  5770.             break;
  5771.         }
  5772.         case 0:
  5773.         {
  5774.             _root.displayAlert("warning", "User Not Found", "Sorry, the username you have entered is not in the system. Please try again.");
  5775.             break;
  5776.         }
  5777.         case -1:
  5778.         {
  5779.             _root.displayAlert("warning", "Server Error", "Sorry, there is an error with the server. Please try again a little later.");
  5780.             break;
  5781.         }
  5782.         case -2:
  5783.         {
  5784.             _root.displayAlert("warning", "Account Has No Email", "This account does not have a registered email address, therefore you cannot recover your password.");
  5785.             break;
  5786.         }
  5787.     } // End of switch
  5788. } // End of the function
  5789. function createAccountCB(s)
  5790. {
  5791.     _root.dialogCreateAccountExt.createAccountCB(s);
  5792. } // End of the function
  5793. function verifyAccount(ac, u, p)
  5794. {
  5795.     getURL("lingo: executeCall \"verifyaccount\", \"ac=" + escape(ac) + "&un=" + escape(u) + "&pw=" + escape(p) + "\"", "");
  5796. } // End of the function
  5797. function verifyAccountCB(s)
  5798. {
  5799.     _global.clearTimeout(_root.abc.contentMC.sendSI);
  5800.     switch (s)
  5801.     {
  5802.         case 1:
  5803.         {
  5804.             var _loc4 = _root.abc.contentMC.tu;
  5805.             var _loc6 = _root.abc.contentMC.tp;
  5806.             _root.abc.closeMe();
  5807.             _root.attachMovie("dialogContainer", "abc", _root.getNextHighestDepth(), {contentName: "dialogTermsContent", askAgree: true, u: _loc4, p: _loc6});
  5808.             break;
  5809.         }
  5810.         case 0:
  5811.         {
  5812.             _root.abc.contentMC.errHead = "Incorrect Activation Code";
  5813.             _root.abc.contentMC.err = "Sorry, the activation code you\'ve entered is incorrect. Please try again.";
  5814.             break;
  5815.         }
  5816.         case -1:
  5817.         {
  5818.             _root.abc.contentMC.errHead = "Email Not Available";
  5819.             _root.abc.contentMC.err = "Sorry, the email you have entered is already being used by another account. Try creating a new account with a different email.";
  5820.             break;
  5821.         }
  5822.         case -2:
  5823.         {
  5824.             _root.abc.contentMC.errHead = "Racer Name Not Available";
  5825.             _root.abc.contentMC.err = "Sorry, the Racer Name (username) you have entered is already taken. Someone must have activated this username before you. Please try creating a new account with a new name.";
  5826.             break;
  5827.         }
  5828.         case -3:
  5829.         {
  5830.             _root.abc.contentMC.errHead = "Server Problem";
  5831.             _root.abc.contentMC.err = "Sorry, the system can\'t verify your account at this time. Please try again later.";
  5832.             break;
  5833.         }
  5834.     } // End of switch
  5835.     if (s <= 0)
  5836.     {
  5837.         _root.abc.contentMC.gotoAndPlay("error");
  5838.     } // end if
  5839. } // End of the function
  5840. function activateAccount(activationCode)
  5841. {
  5842.     getURL("lingo: executeCall \"activateaccount\", \"acd=" + escape(activationCode) + "\"", "");
  5843. } // End of the function
  5844. function activateAccountCB(s, e)
  5845. {
  5846.     _global.clearTimeout(_root.abc.contentMC.sendSI);
  5847.     if (s == 1)
  5848.     {
  5849.         _root.abc.contentMC.gotoAndStop("success");
  5850.         classes.GlobalData.updateInfo("act", "1");
  5851.         if (_global.emailLimitedAccessAlert)
  5852.         {
  5853.             classes.LimitedAccessFunctions.showLimitedAccessAlert(false, _global.emailLimitedAccessAlert);
  5854.         } // end if
  5855.         if (_global.supportCenterLimitedAccessAlert)
  5856.         {
  5857.             classes.LimitedAccessFunctions.showLimitedAccessAlert(false, _global.supportCenterLimitedAccessAlert);
  5858.         } // end if
  5859.     }
  5860.     else
  5861.     {
  5862.         _root.abc.contentMC.gotoAndStop("error");
  5863.         _root.abc.contentMC.takeErrorMessage(e);
  5864.     } // end else if
  5865. } // End of the function
  5866. function resendActivation(username)
  5867. {
  5868.     getURL("lingo: executeCall \"resendactivation\", \"un=" + escape(username) + "\"", "");
  5869. } // End of the function
  5870. function resendActivationCB(s)
  5871. {
  5872.     switch (s)
  5873.     {
  5874.         case 1:
  5875.         {
  5876.             if (_root.abc.contentName == "dialogActivateAccountContentNew")
  5877.             {
  5878.                 _root.abc.contentMC.gotoAndPlay("resent");
  5879.             } // end if
  5880.             break;
  5881.         }
  5882.         case 0:
  5883.         {
  5884.             _root.abc.closeMe();
  5885.             _root.displayAlert("warning", "User Not Found", "Sorry, there is no verification code for the username you have entered. Try creating a new account.");
  5886.             break;
  5887.         }
  5888.         case -1:
  5889.         {
  5890.             _root.abc.closeMe();
  5891.             _root.displayAlert("warning", "Server Error", "Sorry, there is an error with the server. Please try again a little later.");
  5892.             break;
  5893.         }
  5894.         case -2:
  5895.         {
  5896.             _root.abc.closeMe();
  5897.             _root.displayAlert("triangle", "Account Already Verified", "Your account has already been verified. Please log out and back in if you\'re getting verification alerts.");
  5898.             break;
  5899.         }
  5900.         case -3:
  5901.         {
  5902.             _root.abc.closeMe();
  5903.             _root.displayAlert("warning", "Email Unavailable", "You can\'t send the verification code without an email. Please update your email and try again.");
  5904.             break;
  5905.         }
  5906.         case -4:
  5907.         {
  5908.             _root.abc.closeMe();
  5909.             _root.displayAlert("warning", "Email Taken", "Sorry, the email associated to this account has been used and verified by another account. Please change your email and try again.");
  5910.             break;
  5911.         }
  5912.     } // End of switch
  5913. } // End of the function
  5914. function agreeToTerms(username, pwd, facebookLogin)
  5915. {
  5916.     var _loc1 = 0;
  5917.     if (facebookLogin == true)
  5918.     {
  5919.         _loc1 = 1;
  5920.     } // end if
  5921.     getURL("lingo: executeCall \"agreetoterms\", \"un=" + escape(username) + "&pw=" + escape(pwd) + "&fbl=" + _loc1 + "\"", "");
  5922. } // End of the function
  5923. function agreeToTermsCB(s)
  5924. {
  5925.     _global.clearTimeout(_root.abc.contentMC.sendSI);
  5926.     switch (s)
  5927.     {
  5928.         case 1:
  5929.         {
  5930.             var _loc3 = _root.abc.contentMC.tu;
  5931.             var _loc4 = _root.abc.contentMC.tp;
  5932.             if (!_loc3.length)
  5933.             {
  5934.                 _loc3 = classes.Frame._MC.loginGroup.username;
  5935.             } // end if
  5936.             if (!_loc4.length)
  5937.             {
  5938.                 _loc4 = classes.Frame._MC.loginGroup.pass;
  5939.             } // end if
  5940.             _root.abc.closeMe();
  5941.             _root.login(_loc3, _loc4, classes.Frame._MC.loginGroup.facebookLogin);
  5942.             break;
  5943.         }
  5944.         case 0:
  5945.         {
  5946.             _root.displayAlert("warning", "User Not Found", "Sorry, the username you have entered is not in the system. Please restart the game and try again.");
  5947.             break;
  5948.         }
  5949.     } // End of switch
  5950. } // End of the function
  5951. function getCode()
  5952. {
  5953.     getURL("lingo: executeCall \"getcode\"");
  5954. } // End of the function
  5955. function getCodeCB(s, guid)
  5956. {
  5957.     if (s == 1)
  5958.     {
  5959.         _root.dialogCreateAccountExt.loadCode(guid);
  5960.     } // end if
  5961. } // End of the function
  5962. function activatePoints(ac)
  5963. {
  5964.     if (classes.Control.serverAvail())
  5965.     {
  5966.         var _loc1 = new LoadVars();
  5967.         _loc1.ac = ac;
  5968.         getURL("lingo: executeCall \"activatepoints\", \"" + _loc1.toString() + "\"", "");
  5969.     } // end if
  5970. } // End of the function
  5971. function activateMember(u, p, ac)
  5972. {
  5973.     if (classes.Control.serverAvail())
  5974.     {
  5975.         var _loc1 = new LoadVars();
  5976.         _loc1.un = u;
  5977.         _loc1.pw = p;
  5978.         _loc1.ac = ac;
  5979.         getURL("lingo: executeCall \"activatemember\", \"" + _loc1.toString() + "\"", "");
  5980.     } // end if
  5981. } // End of the function
  5982. function activatePurchaseCB(s, m, p, ma, va, d)
  5983. {
  5984.     classes.Control.serverUnlock();
  5985.     switch (s)
  5986.     {
  5987.         case 1:
  5988.         {
  5989.             classes.GlobalData.updateInfo("p", String(p));
  5990.             if (ma == 1)
  5991.             {
  5992.                 _global.loginXML.firstChild.firstChild.attributes.mb = String(ma);
  5993.             } // end if
  5994.             if (va == 1)
  5995.             {
  5996.                 classes.GlobalData.isVIPUser = true;
  5997.             } // end if
  5998.             if (d)
  5999.             {
  6000.                 var _loc3 = new XML();
  6001.                 _loc3.ignoreWhite = true;
  6002.                 _loc3.parseXML(d);
  6003.                 _root.updateDefaultCar(_loc3.firstChild.attributes.i);
  6004.                 _global.garageXML.firstChild.appendChild(_loc3.firstChild);
  6005.             } // end if
  6006.             classes.Frame._MC.loginGroup.activateSuccess(m);
  6007.             break;
  6008.         }
  6009.         case 0:
  6010.         {
  6011.             _root.displayAlert("warning", "Incorrect Login", "Sorry, your login was incorrect. Please try again.");
  6012.             break;
  6013.         }
  6014.         case -1:
  6015.         case -7:
  6016.         {
  6017.             _root.displayAlert("warning", "Incorrect Code", "Sorry, your activation code was incorrect. Please try again.");
  6018.             break;
  6019.         }
  6020.         case -2:
  6021.         {
  6022.             _root.displayAlert("warning", "Expired Code", "Sorry, your code was already activated. Please try again.");
  6023.             break;
  6024.         }
  6025.         case -3:
  6026.         {
  6027.             _root.displayAlert("warning", "Update Error", "Sorry, there was an error updating the database. Please try again.");
  6028.             break;
  6029.         }
  6030.         case -6:
  6031.         {
  6032.             _root.displayAlert("warning", "Too Many Attempts", "Sorry, your have exceeded the number of trials allowed. Please call us at 562.285.0298 or 888-Nitto-1320 (888-648-8613) to activate your purchase.");
  6033.             break;
  6034.         }
  6035.         case -8:
  6036.         {
  6037.             _root.displayAlert("warning", "Purchase Voided", "Sorry, your purchase has been voided. Please call us at 562.285.0298 or 888-Nitto-1320 (888-648-8613) to activate your purchase.");
  6038.             break;
  6039.         }
  6040.         case -9:
  6041.         {
  6042.             _root.displayAlert("warning", "Purchase Refunded", "Sorry, your purchase has been refunded. Please call us at 562.285.0298 or 888-Nitto-1320 (888-648-8613) to activate your purchase.");
  6043.             break;
  6044.         }
  6045.         case -11:
  6046.         case -12:
  6047.         {
  6048.             displayAlert("warning", "Computer Banned", "This computer has been banned.  If you think this is in error, please contact Customer Service for help.");
  6049.             break;
  6050.         }
  6051.         case -13:
  6052.         {
  6053.             displayAlert("warning", "Account Banned", "This account has been banned.  If you think this is in error, please contact Customer Service for help.");
  6054.             break;
  6055.         }
  6056.         case -14:
  6057.         {
  6058.             displayAlert("warning", "Transaction Error", "Sorry, there was an error starting transaction activation. Please try again.");
  6059.             break;
  6060.         }
  6061.         case -15:
  6062.         {
  6063.             displayAlert("warning", "Transfer Error", "Sorry, there was an error transfering the car. Please try again.");
  6064.             break;
  6065.         }
  6066.         case -16:
  6067.         {
  6068.             displayAlert("warning", "Car Sales Error", "Sorry, there was an error updating car sales. Please try again.");
  6069.             break;
  6070.         }
  6071.         case -17:
  6072.         {
  6073.             displayAlert("warning", "Badge Error", "Sorry, there was an error awarding your badge. Please try again.");
  6074.             break;
  6075.         }
  6076.         case -18:
  6077.         {
  6078.             displayAlert("warning", "Membership Error", "Sorry, there was an error updating membership info. Please try again.");
  6079.             break;
  6080.         }
  6081.         case -19:
  6082.         {
  6083.             displayAlert("warning", "VIP Error", "Sorry, there was error updating your VIP Status. Please try again");
  6084.             break;
  6085.         }
  6086.         case -20:
  6087.         {
  6088.             displayAlert("warning", "Car Load Error", "Sorry, there was error loading your new car info. Please try again.");
  6089.             break;
  6090.         }
  6091.     } // End of switch
  6092. } // End of the function
  6093. function getWinsAndLosses()
  6094. {
  6095.     getURL("lingo: executeCall \"getwinsandlosses\"");
  6096. } // End of the function
  6097. function getWinsAndLossesCB(d)
  6098. {
  6099.     classes.SectionHome._MC.CB_getWinsAndLosses(d);
  6100. } // End of the function
  6101. function earnIncentive(iid)
  6102. {
  6103.     getURL("lingo: executeCall \"earnincentive\", \"iid=" + iid + "\"", "");
  6104. } // End of the function
  6105. function earnIncentiveCB(s, b)
  6106. {
  6107.     if (s == 1)
  6108.     {
  6109.         classes.GlobalData.prefsObj.incentiveArray[classes.data.TutorialData.holdIncentiveID] = 1;
  6110.         delete classes.data.TutorialData.holdIncentiveID;
  6111.         classes.GlobalData.updateInfo("m", b);
  6112.         classes.Control.dialogTextBrief("Congratulations!", classes.data.TutorialData.holdIncentiveMsg, "plus");
  6113.     }
  6114.     else if (s == 0)
  6115.     {
  6116.     }
  6117.     else if (s == -1)
  6118.     {
  6119.         classes.GlobalData.prefsObj.incentiveArray[classes.data.TutorialData.holdIncentiveID] = 1;
  6120.     } // end else if
  6121.     delete classes.data.TutorialData.holdIncentiveID;
  6122.     delete classes.data.TutorialData.holdIncentiveMsg;
  6123.     classes.GlobalData.savePrefsObj();
  6124. } // End of the function
  6125. function getStarterShowroom()
  6126. {
  6127.     getURL("lingo: executeCall \"getstartershowroom\"");
  6128. } // End of the function
  6129. function getStarterShowroomCB(d)
  6130. {
  6131.     _root.dialogCreateAccount.infoXML = new XML();
  6132.     _root.dialogCreateAccount.infoXML.ignoreWhite = true;
  6133.     _root.dialogCreateAccount.infoXML.parseXML(d);
  6134.     _root.dialogCreateAccount.gotoAndPlay("car");
  6135. } // End of the function
  6136. function getBlackCardProgress()
  6137. {
  6138.     getURL("lingo: executeCall \"getblackcardprogress\"");
  6139. } // End of the function
  6140. function getBlackCardProgressCB(d)
  6141. {
  6142.     classes.SectionHome._MC.CB_getBlackCardProgress(d);
  6143. } // End of the function
  6144. function getAvatar(tid, io, avatarType, noCache)
  6145. {
  6146.     if (Number(tid))
  6147.     {
  6148.         var _loc3 = false;
  6149.         for (var _loc1 = 0; _loc1 < aryAvatar.length; ++_loc1)
  6150.         {
  6151.             if (aryAvatar[_loc1][0] == tid && aryAvatar[_loc1][2] == avatarType)
  6152.             {
  6153.                 _loc3 = true;
  6154.                 aryAvatar[_loc1][1].push(io);
  6155.                 if (noCache)
  6156.                 {
  6157.                     aryAvatar[_loc1][3] = true;
  6158.                 } // end if
  6159.                 break;
  6160.             } // end if
  6161.         } // end of for
  6162.         if (!_loc3)
  6163.         {
  6164.             aryAvatar.push(new Array(tid, new Array(io), avatarType, noCache));
  6165.             if (!isTimeoutSet)
  6166.             {
  6167.                 isTimeoutSet = true;
  6168.                 setTimeout(getAvatarTimer, 150);
  6169.             } // end if
  6170.         } // end if
  6171.        
  6172.     } // end if
  6173. } // End of the function
  6174. function getAvatarCB(tid, avatarType, avatarAvailable)
  6175. {
  6176.     for (var _loc1 = 0; _loc1 < aryAvatar.length; ++_loc1)
  6177.     {
  6178.         if (aryAvatar[_loc1][0] == tid && aryAvatar[_loc1][2] == avatarType)
  6179.         {
  6180.             for (var _loc2 = 0; _loc2 < aryAvatar[_loc1][1].length; ++_loc2)
  6181.             {
  6182.                 if (avatarAvailable)
  6183.                 {
  6184.                     aryAvatar[_loc1][1][_loc2].showAvatar();
  6185.                     continue;
  6186.                 } // end if
  6187.                 aryAvatar[_loc1][1][_loc2].showDefaultAvatar();
  6188.             } // end of for
  6189.             aryAvatar.splice(_loc1, 1);
  6190.             break;
  6191.         } // end if
  6192.     } // end of for
  6193. } // End of the function
  6194. function getAvatarTimer()
  6195. {
  6196.     isTimeoutSet = false;
  6197.     var _loc5 = "";
  6198.     var _loc2 = "";
  6199.     var _loc4 = "";
  6200.     var _loc3 = "";
  6201.     for (var _loc1 = 0; _loc1 < aryAvatar.length; ++_loc1)
  6202.     {
  6203.         if (aryAvatar[_loc1][2] == "avatars")
  6204.         {
  6205.             if (aryAvatar[_loc1][3])
  6206.             {
  6207.                 _loc4 = _loc4 + (aryAvatar[_loc1][0] + ",");
  6208.             }
  6209.             else
  6210.             {
  6211.                 _loc5 = _loc5 + (aryAvatar[_loc1][0] + ",");
  6212.             } // end else if
  6213.             continue;
  6214.         } // end if
  6215.         if (aryAvatar[_loc1][2] == "teamavatars")
  6216.         {
  6217.             if (aryAvatar[_loc1][3])
  6218.             {
  6219.                 _loc3 = _loc3 + (aryAvatar[_loc1][0] + ",");
  6220.                 continue;
  6221.             } // end if
  6222.             _loc2 = _loc2 + (aryAvatar[_loc1][0] + ",");
  6223.         } // end if
  6224.     } // end of for
  6225.     if (_loc5)
  6226.     {
  6227.         _loc5 = _loc5.substr(0, _loc5.length - 1);
  6228.         getURL("lingo: getAvatar \"" + _loc5 + "\", \"avatars\"", "");
  6229.     } // end if
  6230.     if (_loc2)
  6231.     {
  6232.         _loc2 = _loc2.substr(0, _loc2.length - 1);
  6233.         getURL("lingo: getAvatar \"" + _loc2 + "\", \"teamavatars\"", "");
  6234.     } // end if
  6235.     if (_loc4)
  6236.     {
  6237.         _loc4 = _loc4.substr(0, _loc4.length - 1);
  6238.         getURL("lingo: getAvatar \"" + _loc4 + "\", \"avatars\", 1", "");
  6239.     } // end if
  6240.     if (_loc3)
  6241.     {
  6242.         _loc3 = _loc3.substr(0, _loc3.length - 1);
  6243.         getURL("lingo: getAvatar \"" + _loc3 + "\", \"teamavatars\", 1", "");
  6244.     } // end if
  6245. } // End of the function
  6246. function avatarUploadRequest(l)
  6247. {
  6248.     getURL("lingo: executeCall \"uploadrequest\", \"" + l.toString() + "\"", "");
  6249. } // End of the function
  6250. function avatarUploadRequestCB(s)
  6251. {
  6252.     if (aub)
  6253.     {
  6254.         aub.uploadRequestCB(s);
  6255.     } // end if
  6256. } // End of the function
  6257. function getCars()
  6258. {
  6259.     classes.Frame.serverLights(true);
  6260.     getURL("lingo: executeCall \"getallcars\"");
  6261. } // End of the function
  6262. function getCarsCB(stat, d)
  6263. {
  6264.     classes.Frame.serverLights(false);
  6265.     var _loc10 = classes.GlobalData.getTestDriveCarXML();
  6266.     var _loc4 = Number(_loc10.attributes.i);
  6267.     var _loc6 = _loc10.attributes.tdex;
  6268.     var _loc8 = Number(_loc10.attributes.tid);
  6269.     var _loc5 = Number(_loc10.attributes.p);
  6270.     var _loc9 = Number(_loc10.attributes.pp);
  6271.     var _loc7 = _loc10.attributes.rh;
  6272.     if (classes.Control.loginDone == false)
  6273.     {
  6274.         _loc4 = Number(classes.GlobalData.testDriveCarAccountID);
  6275.         if (classes.GlobalData.testDriveCarExpired == true)
  6276.         {
  6277.             _loc6 = "1";
  6278.         }
  6279.         else
  6280.         {
  6281.             _loc6 = "0";
  6282.         } // end else if
  6283.         _loc8 = Number(classes.GlobalData.testDriveInvitationID);
  6284.         _loc5 = Number(classes.GlobalData.testDriveCarPrice);
  6285.         _loc9 = Number(classes.GlobalData.testDriveCarPointPrice);
  6286.         _loc7 = classes.GlobalData.testDriveTimeRemaining;
  6287.     } // end if
  6288.     _global.garageXML = new XML(d);
  6289.     for (var _loc2 = 0; _loc2 < _global.garageXML.firstChild.childNodes.length; ++_loc2)
  6290.     {
  6291.         if (_global.garageXML.firstChild.childNodes[_loc2].attributes.i == _loc4)
  6292.         {
  6293.             _global.garageXML.firstChild.childNodes[_loc2].attributes.td = 1;
  6294.             _global.garageXML.firstChild.childNodes[_loc2].attributes.tdex = _loc6;
  6295.             _global.garageXML.firstChild.childNodes[_loc2].attributes.tid = _loc8;
  6296.             _global.garageXML.firstChild.childNodes[_loc2].attributes.p = _loc5;
  6297.             _global.garageXML.firstChild.childNodes[_loc2].attributes.pp = _loc9;
  6298.             _global.garageXML.firstChild.childNodes[_loc2].attributes.rh = _loc7;
  6299.             break;
  6300.         } // end if
  6301.     } // end of for
  6302.     for (var _loc2 = 0; _loc2 < _global.garageXML.firstChild.childNodes.length; ++_loc2)
  6303.     {
  6304.         var _loc3 = new XML(_global.garageXML.firstChild.childNodes[_loc2].toString());
  6305.         classes.Lookup.addToRaceCarsXML(_loc3.firstChild);
  6306.     } // end of for
  6307.     if (!classes.Control.loginObj.completed)
  6308.     {
  6309.         switch (stat)
  6310.         {
  6311.             case 1:
  6312.             {
  6313.                 for (var _loc2 = 0; _loc2 < _global.garageXML.firstChild.childNodes.length; ++_loc2)
  6314.                 {
  6315.                     if (_global.garageXML.firstChild.childNodes[_loc2].attributes.sel == 1)
  6316.                     {
  6317.                         classes.GlobalData.setSelectedCar(Number(_global.garageXML.firstChild.childNodes[_loc2].attributes.i));
  6318.                         break;
  6319.                     } // end if
  6320.                 } // end of for
  6321.                 classes.Control.loginFinished("cars");
  6322.                 break;
  6323.             }
  6324.             case 0:
  6325.             {
  6326.                 displayAlert("warning", "Error Loading Parts", "Sorry, there was a problem loading your car parts.");
  6327.                 classes.Frame._MC.loginGroup.gotoAndPlay(1);
  6328.                 break;
  6329.             }
  6330.             case -1:
  6331.             {
  6332.                 displayAlert("warning", "Error Loading Cars", "Sorry, there was a problem loading your cars");
  6333.                 classes.Frame._MC.loginGroup.gotoAndPlay(1);
  6334.                 break;
  6335.             }
  6336.         } // End of switch
  6337.     }
  6338.     else if (stat == 1)
  6339.     {
  6340.         for (var _loc2 = 0; _loc2 < _global.garageXML.firstChild.childNodes.length; ++_loc2)
  6341.         {
  6342.             if (_global.garageXML.firstChild.childNodes[_loc2].attributes.sel == 1)
  6343.             {
  6344.                 classes.GlobalData.setSelectedCar(Number(_global.garageXML.firstChild.childNodes[_loc2].attributes.i));
  6345.                 break;
  6346.             } // end if
  6347.         } // end of for
  6348.     } // end else if
  6349.     _global.introData.testDriveCarXML = classes.GlobalData.getTestDriveCarXML();
  6350. } // End of the function
  6351. function getCarCategories()
  6352. {
  6353.     getURL("lingo: executeCall \"getcarcategories\"");
  6354. } // End of the function
  6355. function getCarCategoriesCB(d)
  6356. {
  6357.     _global.dealerXML = new XML(d);
  6358.     viewShowroom();
  6359. } // End of the function
  6360. function viewShowroom()
  6361. {
  6362.     getURL("lingo: executeCall \"viewshowroom\"");
  6363. } // End of the function
  6364. function viewShowroomCB(d)
  6365. {
  6366.     _global.dealerCarsXML = new XML(d);
  6367.     _root.main.sectionHolder.sectionClip.gotoAndPlay("refresh");
  6368. } // End of the function
  6369. function getOtherUserCars(i)
  6370. {
  6371.     classes.Control.serverAvail();
  6372.     getURL("lingo: executeCall \"getallotherusercars\", \"tid=" + i + "\"", "");
  6373. } // End of the function
  6374. function getOtherUserCarsCB(stat, d)
  6375. {
  6376.     classes.Control.serverUnlock();
  6377.     switch (stat)
  6378.     {
  6379.         case 1:
  6380.         {
  6381.             var _loc1 = new XML(d);
  6382.             var _loc2 = _loc1.firstChild.attributes.i;
  6383.             classes.Lookup.runCallback("getOtherUserCars", String(_loc2), _loc1);
  6384.             break;
  6385.         }
  6386.         case 0:
  6387.         {
  6388.             break;
  6389.         }
  6390.         case -1:
  6391.         {
  6392.             break;
  6393.         }
  6394.     } // End of switch
  6395. } // End of the function
  6396. function buyCar(cid, pt, c)
  6397. {
  6398.     var _loc1 = new LoadVars();
  6399.     _loc1.cid = cid;
  6400.     _loc1.pt = pt;
  6401.     _loc1.c = c;
  6402.     getURL("lingo: executeCall \"buycar\", \"" + _loc1.toString() + "\"", "");
  6403. } // End of the function
  6404. function buyCarCB(stat, m, d)
  6405. {
  6406.     if (stat <= 0)
  6407.     {
  6408.         _root.abc.thumb.dispose();
  6409.         _root.abc.closeMe();
  6410.     } // end if
  6411.     switch (stat)
  6412.     {
  6413.         case 1:
  6414.         case 2:
  6415.         {
  6416.             if (stat == 1)
  6417.             {
  6418.                 classes.GlobalData.updateInfo("p", String(m));
  6419.             }
  6420.             else if (stat == 2)
  6421.             {
  6422.                 classes.GlobalData.updateInfo("m", String(m));
  6423.             } // end else if
  6424.             if (d)
  6425.             {
  6426.                 var _loc4 = new XML();
  6427.                 _loc4.ignoreWhite = true;
  6428.                 _loc4.parseXML(d);
  6429.                 _root.updateDefaultCar(_loc4.firstChild.attributes.i);
  6430.                 _global.garageXML.firstChild.appendChild(_loc4.firstChild);
  6431.             } // end if
  6432.             _root.abc.removeButtons();
  6433.             _root.abc.contentMC.gotoAndStop("success");
  6434.             _root.abc.addButton("OK");
  6435.             var _loc7 = new Object();
  6436.             _loc7.onRelease = function (theButton, keepBoxOpen)
  6437.             {
  6438.                 switch (theButton.btnLabel.text)
  6439.                 {
  6440.                     case "OK":
  6441.                     {
  6442.                         _root.abc.thumb.dispose();
  6443.                         break;
  6444.                     }
  6445.                 } // End of switch
  6446.                 if (!keepBoxOpen)
  6447.                 {
  6448.                     false;
  6449.                     theButton._parent._parent.closeMe();
  6450.                 } // end if
  6451.             };
  6452.             _root.abc.addListener(_loc7);
  6453.             break;
  6454.         }
  6455.         case 0:
  6456.         {
  6457.             displayAlert("warning", "Invalid Vehicle", "Sorry, the vehicle is not available for purchase.");
  6458.             break;
  6459.         }
  6460.         case -1:
  6461.         {
  6462.             displayAlert("warning", "Access Denied", "Sorry, this vehicle is only available to users with paid memberships.  Please see www.NittoLegends.com for more information.");
  6463.             break;
  6464.         }
  6465.         case -2:
  6466.         {
  6467.             displayAlert("warning", "Unrecognized Payment", "Sorry, your payment method is not accepted.");
  6468.             break;
  6469.         }
  6470.         case -3:
  6471.         {
  6472.             displayAlert("warning", "Account Inaccessible", "Sorry, your account cannot be accessed at this time. Please try again later.");
  6473.             break;
  6474.         }
  6475.         case -4:
  6476.         {
  6477.             displayAlert("warning", "Insufficient Balance", "Sorry, you don\'t have enough to purchase this vehicle.");
  6478.             break;
  6479.         }
  6480.         case -5:
  6481.         {
  6482.             var _loc6 = "Sorry, but your parking lot is full. To make space for a new car, you can move to a better neighborhood or sell an extra car.";
  6483.             if (classes.GlobalData.attr.mb != 1)
  6484.             {
  6485.                 _loc6 = _loc6 + " You can also get more space with a membership. Members get double the parking spaces! See www.NittoLegends.com for details.";
  6486.             } // end if
  6487.             displayAlert("warning", "Not Enough Space", _loc6);
  6488.             break;
  6489.         }
  6490.         case -6:
  6491.         {
  6492.             displayAlert("warning", "Invalid Location", "Sorry, but you need to move to a better neighborhood to purchase this car.");
  6493.             break;
  6494.         }
  6495.         case -7:
  6496.         {
  6497.             displayAlert("warning", "Sold Out!", "Sorry, but these cars are sold out!");
  6498.             break;
  6499.         }
  6500.         case -8:
  6501.         {
  6502.             displayAlert("warning", "Black Card Required!", "Sorry, but these cars are only available for black card holders!");
  6503.             break;
  6504.         }
  6505.         case -9:
  6506.         {
  6507.             displayAlert("warning", "Sold Out!", "Sorry, but this car has sold out!");
  6508.             break;
  6509.         }
  6510.         case -50:
  6511.         {
  6512.             displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  6513.             break;
  6514.         }
  6515.     } // End of switch
  6516. } // End of the function
  6517. function getCarPrice(acid)
  6518. {
  6519.     getURL("lingo: executeCall \"getcarprice\", \"acid=" + acid + "\"", "");
  6520. } // End of the function
  6521. function getCarPriceCB(s, p)
  6522. {
  6523.     if (s == 1)
  6524.     {
  6525.         _global.myGarageMC.carXML.firstChild.attributes.vw = p;
  6526.         classes.Control.dialogContainer("dialogSellCarContent", _global.sellCarObj.tObj);
  6527.        
  6528.     } // end if
  6529. } // End of the function
  6530. function sellCar(acid)
  6531. {
  6532.     getURL("lingo: executeCall \"sellcar\", \"acid=" + acid + "\"", "");
  6533. } // End of the function
  6534. function sellCarCB(s, b)
  6535. {
  6536.     var _loc1 = {s: s, b: b};
  6537.     classes.Lookup.runCallback("sellCar", "", _loc1);
  6538. } // End of the function
  6539. function getAllImCars()
  6540. {
  6541.     classes.Frame.serverLights(true);
  6542.     getURL("lingo: executeCall \"getallimcars\"");
  6543. } // End of the function
  6544. function getAllImCarsCB(s, d)
  6545. {
  6546.     classes.Frame.serverLights(false);
  6547.     if (s == 1 || s == -1)
  6548.     {
  6549.         classes.Lookup.runCallback("getAllImCars", "", d);
  6550.     }
  6551.     else
  6552.     {
  6553.         displayAlert("warning", "Problem Encountered", "Sorry, there was a problem finding your impounded cars. Please try again later.");
  6554.         classes.Lookup.clearCallback("getAllImCars", "");
  6555.     } // end else if
  6556. } // End of the function
  6557. function getCarOutOfImpound(acid)
  6558. {
  6559.     _global.retrieveCarObj = new Object();
  6560.     _global.retrieveCarObj.id = acid;
  6561.     getURL("lingo: executeCall \"getoutofimpound\", \"acid=" + acid + "\"", "");
  6562. } // End of the function
  6563. function getCarOutOfImpoundCB(s, b)
  6564. {
  6565.     classes.SectionImpound._MC.infoBar.btnRelease.enabled = true;
  6566.     switch (s)
  6567.     {
  6568.         case 1:
  6569.         {
  6570.             classes.GlobalData.updateInfo("m", b);
  6571.             classes.GlobalData.updateCarAttr(_global.retrieveCarObj.id, "ii", 0);
  6572.             classes.Frame._MC.goMainSection("impound");
  6573.             classes.Control.dialogAlert("Success", "You have successfully retrieved this car from impound. It is now back in your garage.");
  6574.             _root.abc.contentMC.alertIconMC.gotoAndStop("success");
  6575.             break;
  6576.         }
  6577.         case 0:
  6578.         {
  6579.             classes.Control.dialogAlert("Problem Encountered", "Sorry, there was a problem releasing your impounded car. Please try again later.");
  6580.             break;
  6581.         }
  6582.         case -1:
  6583.         {
  6584.             classes.Frame._MC.goMainSection("impound");
  6585.             classes.Control.dialogAlert("Problem Encountered", "We could not find this car in the impound.");
  6586.             break;
  6587.         }
  6588.         case -2:
  6589.         {
  6590.             classes.Control.dialogAlert("Not Enough Funds", "Sorry, you do not have enough funds to release your car. You can sell the car or try again later.");
  6591.             break;
  6592.         }
  6593.         case -3:
  6594.         {
  6595.             classes.Control.dialogAlert("No Garage Space Available", "Sorry, you do not have any available space in your garage to accommodate this vehicle. To make garage space available, you need to either move your home to a nicer area, or sell some cars.");
  6596.             break;
  6597.         }
  6598.         case -4:
  6599.         {
  6600.             classes.Control.dialogAlert("Car not Available", "I\'m sorry, but the car you selected is locked.");
  6601.             break;
  6602.         }
  6603.         case -50:
  6604.         {
  6605.             classes.Control.dialogAlert("Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  6606.             break;
  6607.         }
  6608.     } // End of switch
  6609. } // End of the function
  6610. function getOneCar(acid)
  6611. {
  6612.     classes.Frame.serverLights(true);
  6613.     getURL("lingo: executeCall \"getonecar\", \"acid=" + acid + "\"", "");
  6614. } // End of the function
  6615. function getOneCarCB(s, d)
  6616. {
  6617.     classes.Frame.serverLights(false);
  6618.     if (s == 1)
  6619.     {
  6620.         var _loc1 = new XML(d);
  6621.         classes.Lookup.runCallback("getOneCar", _loc1.firstChild.firstChild.attributes.i, _loc1);
  6622.     } // end if
  6623. } // End of the function
  6624. function teamInfo(tids)
  6625. {
  6626.     getURL("lingo: executeCall \"teaminfo\", \"tids=" + escape(tids) + "\"", "");
  6627. } // End of the function
  6628. function teamInfoCB(d)
  6629. {
  6630.     var _loc2 = new XML(d);
  6631.     var _loc3 = _loc2.firstChild.childNodes.length - 1;
  6632.     for (var _loc1 = _loc3; _loc1 >= 0; --_loc1)
  6633.     {
  6634.         classes.Lookup.addToTeamsXML(_loc2.firstChild.firstChild);
  6635.     } // end of for
  6636.     classes.Lookup.runCallback("teamInfo", "", d);
  6637. } // End of the function
  6638. function teamTrans(tid)
  6639. {
  6640.     if (classes.Control.serverAvail())
  6641.     {
  6642.         getURL("lingo: executeCall \"teamtrans\", \"tid=" + tid + "\"", "");
  6643.     } // end if
  6644. } // End of the function
  6645. function teamTransCB(s, d)
  6646. {
  6647.     classes.Control.serverUnlock();
  6648.     if (s == 1)
  6649.     {
  6650.         classes.Lookup.runCallback("teamTrans", "sectionTeamHQ", d);
  6651.        
  6652.     } // end if
  6653. } // End of the function
  6654. function teamSearch(st, pn)
  6655. {
  6656.     if (!pn)
  6657.     {
  6658.         pn = 1;
  6659.     } // end if
  6660.     classes.Frame.serverLights(true);
  6661.     getURL("lingo: executeCall \"teamsearch\", \"st=" + escape(st) + "&pn=" + pn + "\"", "");
  6662. } // End of the function
  6663. function teamSearchCB(s, d)
  6664. {
  6665.     classes.Frame.serverLights(false);
  6666.     classes.Lookup.runCallback("teamSearch", "", d);
  6667. } // End of the function
  6668. function teamUpdateLeaderComments(lc)
  6669. {
  6670.     _global.newLeaderComments = lc;
  6671.     getURL("lingo: executeCall \"updateleadercomments\", \"lc=" + lc + "\"", "");
  6672. } // End of the function
  6673. function teamUpdateLeaderCommentsCB(s)
  6674. {
  6675.     if (s == 1)
  6676.     {
  6677.        
  6678.     } // end if
  6679.     classes.Lookup.runCallback("teamUpdateLeaderComments", "", s);
  6680. } // End of the function
  6681. function teamUpdateTeamReq(rt, v)
  6682. {
  6683.     getURL("lingo: executeCall \"updateteamreq\", \"rt=" + rt + "&v=" + v + "\"", "");
  6684. } // End of the function
  6685. function teamUpdateTeamReqCB(s)
  6686. {
  6687.     if (s == 1)
  6688.     {
  6689.        
  6690.     } // end if
  6691. } // End of the function
  6692. function teamGetInfo(tid)
  6693. {
  6694.     classes.Control.serverAvail();
  6695.     getURL("lingo: executeCall \"getteaminfo\", \"tid=" + tid + "\"", "");
  6696. } // End of the function
  6697. function teamGetInfoCB(s, d)
  6698. {
  6699.     classes.Control.serverUnlock();
  6700.     if (s == 1)
  6701.     {
  6702.         var _loc1 = new XML(d);
  6703.         classes.Lookup.addToTeamsXML(_loc1.firstChild.firstChild, true);
  6704.         classes.Lookup.runCallback("teamGetInfo", "", d);
  6705.        
  6706.     } // end if
  6707. } // End of the function
  6708. function teamGetAllApps(tid)
  6709. {
  6710.     if (classes.Control.serverAvail())
  6711.     {
  6712.         getURL("lingo: executeCall \"getallteamapps\", \"tid=" + tid + "\"", "");
  6713.     } // end if
  6714. } // End of the function
  6715. function teamGetAllAppsCB(s, d)
  6716. {
  6717.     classes.Control.serverUnlock();
  6718.     if (s == 1)
  6719.     {
  6720.         classes.Lookup.runCallback("teamGetAllApps", "sectionTeamHQ", d);
  6721.        
  6722.     } // end if
  6723. } // End of the function
  6724. function teamGetMyApps()
  6725. {
  6726.     classes.Frame.serverLights(true);
  6727.     getURL("lingo: executeCall \"getallmyapps\"");
  6728. } // End of the function
  6729. function teamGetMyAppsCB(s, d)
  6730. {
  6731.     classes.Frame.serverLights(false);
  6732.     if (s == 1)
  6733.     {
  6734.        
  6735.     } // end if
  6736.     classes.Lookup.runCallback("teamGetMyApps", "", d);
  6737. } // End of the function
  6738. function teamDeleteApp(tid)
  6739. {
  6740.     getURL("lingo: executeCall \"deleteapp\", \"tid=" + tid + "\"", "");
  6741. } // End of the function
  6742. function teamDeleteAppCB(s)
  6743. {
  6744.     if (s == 1)
  6745.     {
  6746.        
  6747.     } // end if
  6748. } // End of the function
  6749. function teamUpdateApp(aaid, r)
  6750. {
  6751.     classes.Frame.serverLights(true);
  6752.     getURL("lingo: executeCall \"updateteamapp\", \"aaid=" + aaid + "&r=" + r + "\"", "");
  6753. } // End of the function
  6754. function teamUpdateAppCB(s)
  6755. {
  6756.     classes.Frame.serverLights(false);
  6757.     switch (s)
  6758.     {
  6759.         case 1:
  6760.         {
  6761.             break;
  6762.         }
  6763.         case 0:
  6764.         {
  6765.             break;
  6766.         }
  6767.         case -1:
  6768.         {
  6769.             break;
  6770.         }
  6771.         case -2:
  6772.         {
  6773.             break;
  6774.         }
  6775.     } // End of switch
  6776.     classes.Lookup.runCallback("teamUpdateApp", "", s);
  6777. } // End of the function
  6778. function teamAddApp(tid, c)
  6779. {
  6780.     getURL("lingo: executeCall \"addteamapp\", \"tid=" + tid + "&c=" + escape(c) + "\"", "");
  6781. } // End of the function
  6782. function teamAddAppCB(s)
  6783. {
  6784.     classes.Lookup.runCallback("teamAddApp", "", s);
  6785.     switch (s)
  6786.     {
  6787.         case 1:
  6788.         {
  6789.             break;
  6790.         }
  6791.         case 0:
  6792.         {
  6793.             break;
  6794.         }
  6795.         case -1:
  6796.         {
  6797.             break;
  6798.         }
  6799.         case -2:
  6800.         {
  6801.             break;
  6802.         }
  6803.         case -3:
  6804.         {
  6805.             break;
  6806.         }
  6807.         case -4:
  6808.         {
  6809.             break;
  6810.         }
  6811.         case -5:
  6812.         {
  6813.             break;
  6814.         }
  6815.         case -6:
  6816.         {
  6817.             break;
  6818.         }
  6819.         case -60:
  6820.         {
  6821.             break;
  6822.         }
  6823.     } // End of switch
  6824. } // End of the function
  6825. function teamUpdateBgColor(bg)
  6826. {
  6827.     _global.teamXML.firstChild.firstChild.attributes.bg = bg;
  6828.     var _loc2 = Number(_global.teamXML.firstChild.firstChild.attributes.i);
  6829.     if (_loc2)
  6830.     {
  6831.         getURL("lingo: executeCall \"setteamcolor\", \"tid=" + _loc2 + "&bg=" + bg + "\"", "");
  6832.     } // end if
  6833. } // End of the function
  6834. function teamUpdateBgColorCB(s)
  6835. {
  6836. } // End of the function
  6837. function raceGetTwoRacersCars(r1acid, r2acid)
  6838. {
  6839.     if (!r2acid)
  6840.     {
  6841.         r2acid = 0;
  6842.     } // end if
  6843.     var _loc5 = classes.Lookup.getRaceCarNode(r1acid);
  6844.     var _loc4 = classes.Lookup.getRaceCarNode(r2acid);
  6845.     if (_loc5.toString() && (!r2acid || _loc4.toString()))
  6846.     {
  6847.         var _loc2 = "<n2>";
  6848.         _loc2 = _loc2 + _loc5.toString();
  6849.         if (_loc4.toString())
  6850.         {
  6851.             _loc2 = _loc2 + _loc4.toString();
  6852.         } // end if
  6853.         _loc2 = _loc2 + "</n2>";
  6854.         _root.raceGetTwoRacersCarsCB(1, _loc2);
  6855.     }
  6856.     else if (r1acid)
  6857.     {
  6858.         getURL("lingo: executeCall \"gettworacerscars\", \"r1acid=" + r1acid + "&r2acid=" + r2acid + "\"", "");
  6859.     }
  6860.     else
  6861.     {
  6862.         _root.raceGetTwoRacersCarsCB(0, "");
  6863.     } // end else if
  6864. } // End of the function
  6865. function raceGetTwoRacersCarsCB(s, d)
  6866. {
  6867.     if (s == 1)
  6868.     {
  6869.         var _loc1 = new XML(d);
  6870.         for (var _loc2 = 0; _loc2 < _loc1.firstChild.firstChild.childNodes.length; ++_loc2)
  6871.         {
  6872.             _loc1.firstChild.firstChild.childNodes[_loc2].attributes.in = 1;
  6873.         } // end of for
  6874.         for (var _loc2 = 0; _loc2 < _loc1.firstChild.childNodes[1].childNodes.length; ++_loc2)
  6875.         {
  6876.             _loc1.firstChild.childNodes[1].childNodes[_loc2].attributes.in = 1;
  6877.         } // end of for
  6878.         var _loc4 = new XML(_loc1.toString());
  6879.         var _loc3 = "";
  6880.         if (_loc1.firstChild.childNodes[1].attributes.i)
  6881.         {
  6882.             _loc3 = "," + _loc1.firstChild.childNodes[1].attributes.i;
  6883.             classes.Lookup.addToRaceCarsXML(_loc1.firstChild.childNodes[1]);
  6884.         } // end if
  6885.         classes.Lookup.addToRaceCarsXML(_loc1.firstChild.firstChild);
  6886.         classes.Lookup.runCallback("raceGetTwoRacersCars", _loc4.firstChild.childNodes[0].attributes.i + _loc3, _loc4);
  6887.        
  6888.     } // end if
  6889. } // End of the function
  6890. function getRacersCars(pArr)
  6891. {
  6892.     var _loc4 = pArr.length - 1;
  6893.     if (!isNaN(_loc4))
  6894.     {
  6895.         for (var _loc1 = _loc4; _loc1 >= 0; --_loc1)
  6896.         {
  6897.             var _loc2 = classes.Lookup.getRaceCarNode(pArr[_loc1]);
  6898.             if (_loc2)
  6899.             {
  6900.                 classes.Lookup.runCallback("getRacersCars", String(pArr[_loc1]), _loc2.toString());
  6901.                 pArr.splice(_loc1, 1);
  6902.             } // end if
  6903.         } // end of for
  6904.     } // end if
  6905.     if (pArr.length)
  6906.     {
  6907.         getURL("lingo: executeCall \"getracerscars\", \"acids=" + pArr.toString() + "\"", "");
  6908.     } // end if
  6909. } // End of the function
  6910. function getRacersCarsCB(s, d)
  6911. {
  6912.     var _loc6 = new XML(d);
  6913.     var _loc5 = _loc6.firstChild.childNodes.length - 1;
  6914.     if (!isNaN(_loc5))
  6915.     {
  6916.         for (var _loc3 = _loc5; _loc3 >= 0; --_loc3)
  6917.         {
  6918.             var _loc2 = _loc6.firstChild.childNodes[_loc3];
  6919.             for (var _loc1 = 0; _loc1 < _loc2.childNodes.length; ++_loc1)
  6920.             {
  6921.                 _loc2.childNodes[_loc1].attributes.in = 1;
  6922.             } // end of for
  6923.             var _loc4 = String(_loc2.attributes.i);
  6924.             classes.Lookup.addToRaceCarsXML(_loc2.cloneNode(true));
  6925.             classes.Lookup.runCallback("getRacersCars", _loc4, _loc2.toString());
  6926.         } // end of for
  6927.     } // end if
  6928. } // End of the function
  6929. function ctGetRacers()
  6930. {
  6931.     if (classes.Control.serverAvail())
  6932.     {
  6933.         getURL("lingo: executeCall \"ctgr\"");
  6934.     } // end if
  6935. } // End of the function
  6936. function ctGetRacersCB(d)
  6937. {
  6938.     classes.Control.serverUnlock();
  6939.     classes.Control.ctourneyMC.compXML = new XML(d);
  6940.     classes.Control.ctourneyMC.startRoom();
  6941. } // End of the function
  6942. function ctJoin(ctid)
  6943. {
  6944.     if (classes.Control.serverAvail())
  6945.     {
  6946.         getURL("lingo: executeCall \"ctjt\" \"ctid=" + ctid + "\"", "");
  6947.     } // end if
  6948. } // End of the function
  6949. function ctJoinCB(s)
  6950. {
  6951.     classes.Control.serverUnlock();
  6952.     switch (s)
  6953.     {
  6954.         case 1:
  6955.         {
  6956.             classes.Control.ctourneyMC.gotoAndPlay("computerPreQualification");
  6957.             break;
  6958.         }
  6959.         case 0:
  6960.         {
  6961.             _root.displayAlert("warning", "Tournament Error", "Sorry, the tournament you selected does not exist.");
  6962.             break;
  6963.         }
  6964.         case -1:
  6965.         {
  6966.             _root.displayAlert("warning", "Tournament Error", "Sorry, the tournament you selected is temporarily unavailable.");
  6967.             break;
  6968.         }
  6969.     } // End of switch
  6970. } // End of the function
  6971. function ctCreate(k, bt, acid)
  6972. {
  6973.     _global.chatObj.raceObj = new Object();
  6974.     _global.chatObj.raceObj.bt = bt;
  6975.     _global.chatObj.raceObj.myObj = new Object();
  6976.     var _loc2 = _global.chatObj.raceObj.myObj;
  6977.     _loc2.cid = acid;
  6978.     _loc2.id = classes.GlobalData.id;
  6979.     _loc2.un = classes.GlobalData.uname;
  6980.     _loc2.ti = classes.GlobalData.attr.ti;
  6981.     _loc2.tn = classes.GlobalData.attr.tn;
  6982.     _loc2.sc = classes.GlobalData.attr.sc;
  6983.     _loc2.bt = bt;
  6984.     _global.chatObj.raceObj.r1Obj = _global.chatObj.raceObj.myObj;
  6985.     getURL("lingo: executeCall \"ctct\" \"k=" + escape(k) + "&bt=" + bt + "&acid=" + acid + "\"", "");
  6986. } // End of the function
  6987. function CB_getTwoRacersCars(txml)
  6988. {
  6989.     _global.chatObj.twoRacersCarsXML = txml;
  6990.     classes.Control.ctourneyMC.gotoAndPlay("qualifyTrack");
  6991. } // End of the function
  6992. function ctCreateCB(s)
  6993. {
  6994.     if (s == 1)
  6995.     {
  6996.         classes.Lookup.addCallback("raceGetTwoRacersCars", this, CB_getTwoRacersCars, _global.chatObj.raceObj.myObj.cid);
  6997.         _root.raceGetTwoRacersCars(_global.chatObj.raceObj.myObj.cid, 0);
  6998.     }
  6999.     else if (s == -1)
  7000.     {
  7001.         _root.displayAlert("warning", "Wrong Number", "Sorry, the number you put on your car is wrong. Please try again.");
  7002.     }
  7003.     else if (s == -2)
  7004.     {
  7005.         _root.displayAlert("warning", "Disqualified", "Sorry, the tournament has started without you. Please rejoin the tournament.");
  7006.     }
  7007.     else if (s == -3)
  7008.     {
  7009.         _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  7010.     }
  7011.     else if (s == -4)
  7012.     {
  7013.         _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is locked.");
  7014.     }
  7015.     else if (s == -5)
  7016.     {
  7017.         _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is not yours.");
  7018.     }
  7019.     else if (s == -6)
  7020.     {
  7021.         _root.markTestDriveExpiredAndDisplayWarning();
  7022.     }
  7023.     else
  7024.     {
  7025.         _root.displayAlert("warning", "Tournament Error", "Sorry, the tournament you selected is temporarily unavailable.");
  7026.     } // end else if
  7027. } // End of the function
  7028. function ctRequest(caid)
  7029. {
  7030.     getURL("lingo: executeCall \"ctrt\" \"caid=" + caid + "\"", "");
  7031. } // End of the function
  7032. function ctRequestCB(s, d, b)
  7033. {
  7034.     if (s == 1)
  7035.     {
  7036.         var _loc2 = new XML(d);
  7037.         classes.Control.ctourneyMC.CB_ctRequest(_loc2, Number(b));
  7038.     }
  7039.     else
  7040.     {
  7041.         _root.displayAlert("warning", "Tournament Error", "Sorry, the tournament you selected is temporarily unavailable.");
  7042.     } // end else if
  7043. } // End of the function
  7044. function ctSaveCB(s, d)
  7045. {
  7046.     if (s == 1)
  7047.     {
  7048.         var _loc3 = new XML(d);
  7049.         var _loc2 = Number(_loc3.firstChild.attributes.b);
  7050.         switch (Number(_loc3.firstChild.attributes.w))
  7051.         {
  7052.             case 0:
  7053.             {
  7054.                 classes.Control.ctourneyMC.goLoserPage();
  7055.                 classes.Control.setMapButton("nonrace");
  7056.                 break;
  7057.             }
  7058.             case 1:
  7059.             {
  7060.                 classes.GlobalData.updateInfo("m", Number(classes.GlobalData.attr.m) + _loc2);
  7061.                 classes.Control.ctourneyMC.goWinOneAndContinue(_loc2);
  7062.                 break;
  7063.             }
  7064.             case 2:
  7065.             {
  7066.                 classes.GlobalData.updateInfo("m", Number(classes.GlobalData.attr.m) + _loc2);
  7067.                 classes.Control.ctourneyMC.goWinnerPage(_loc2);
  7068.                 classes.Control.setMapButton("nonrace");
  7069.                 break;
  7070.             }
  7071.         } // End of switch
  7072.     }
  7073.     else
  7074.     {
  7075.         _root.displayAlert("warning", "Tournament Error", "Sorry, the tournament you selected is temporarily unavailable.");
  7076.     } // end else if
  7077. } // End of the function
  7078. function ctStartAnimateComputerCB()
  7079. {
  7080.     classes.RacePlay._MC.tripWire(_global.chatObj.raceObj.oppObj.id, _global.chatObj.raceObj.oppObj.rt);
  7081.     _global.chatObj.raceObj.oppObj.startTS = new Date();
  7082. } // End of the function
  7083. function ctFinishCB(et, ts)
  7084. {
  7085.     classes.Control.ctourneyMC.finishCompRace(et, ts);
  7086. } // End of the function
  7087. function practiceCreate(acid)
  7088. {
  7089.     classes.GlobalData.currentAccountCarID = acid;
  7090.     if (classes.Control.serverAvail())
  7091.     {
  7092.         classes.Frame.serverLights(true);
  7093.         getURL("lingo: executeCall \"practice\" \"acid=" + acid + "\"", "");
  7094.     } // end if
  7095. } // End of the function
  7096. function practiceCreateCB(s)
  7097. {
  7098.     function CB_getTwoRacersCars(pxml)
  7099.     {
  7100.         classes.mc.TrackPractice._mc.resetTrack();
  7101.     } // End of the function
  7102.     classes.Frame.serverLights(false);
  7103.     classes.Control.serverUnlock();
  7104.     if (s == 1)
  7105.     {
  7106.         classes.Lookup.addCallback("raceGetTwoRacersCars", this, CB_getTwoRacersCars, String(classes.GlobalData.currentAccountCarID));
  7107.         _root.raceGetTwoRacersCars(classes.GlobalData.currentAccountCarID);
  7108.     }
  7109.     else if (s == -1)
  7110.     {
  7111.         if (classes.GlobalData.priorSelectedCarID)
  7112.         {
  7113.             _root.updateDefaultCar(classes.GlobalData.priorSelectedCarID);
  7114.             classes.mc.TrackPractice._mc.selCarID = classes.GlobalData.priorSelectedCarID;
  7115.             classes.mc.TrackPractice._mc.selCarXML = new XML(classes.GlobalData.getSelectedCarXML().toString());
  7116.         } // end if
  7117.         _root.markTestDriveExpiredAndDisplayWarning();
  7118.     } // end else if
  7119. } // End of the function
  7120. function practiceFinishCB(et, ts)
  7121. {
  7122.     classes.mc.TrackPractice._mc.finishRace(et, ts);
  7123. } // End of the function
  7124. function garageDynoBuy(acid)
  7125. {
  7126.     if (classes.Control.serverAvail())
  7127.     {
  7128.         classes.Frame.serverLights(true);
  7129.         getURL("lingo: executeCall \"buydyno\", \"acid=" + acid + "\"", "");
  7130.     } // end if
  7131. } // End of the function
  7132. function garageDynoBuyCB(s, b, bs, mp, cs, sl, rl)
  7133. {
  7134.     classes.Frame.serverLights(false);
  7135.     classes.Control.serverUnlock();
  7136.     switch (s)
  7137.     {
  7138.         case 1:
  7139.         {
  7140.             classes.GlobalData.updateInfo("m", b);
  7141.             garageDynoMC.boostSetting = Number(bs);
  7142.             garageDynoMC.maxPsi = Number(mp);
  7143.             garageDynoMC.chipSetting = garageDynoMC.AFMeter = Number(cs);
  7144.             classes.GlobalData.shiftLightGaugeRPM = Number(sl);
  7145.             garageDynoMC.redLine = Number(rl);
  7146.             garageDynoMC.gotoAndStop("dynoReady");
  7147.             break;
  7148.         }
  7149.         case 0:
  7150.         {
  7151.             _root.displayAlert("warning", "Car not Available", "Sorry, we cannot locate the car for the dyno.");
  7152.             break;
  7153.         }
  7154.         case -2:
  7155.         {
  7156.             _root.displayAlert("warning", "Insufficient Funds", "Sorry, you do not have enough in your balance to pay for a dyno session.");
  7157.             break;
  7158.         }
  7159.         case -3:
  7160.         {
  7161.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected to buy the dyno for is impounded.");
  7162.             break;
  7163.         }
  7164.         case -4:
  7165.         {
  7166.             _root.markTestDriveExpiredAndDisplayWarning();
  7167.             break;
  7168.         }
  7169.     } // End of switch
  7170. } // End of the function
  7171. function garageDynoBuySession(acid, m)
  7172. {
  7173.     getURL("lingo: executeCall \"buydyno\", \"acid=" + acid + "\"", "");
  7174. } // End of the function
  7175. function garageDynoBuySessionCB(s, b)
  7176. {
  7177.     if (s == 2)
  7178.     {
  7179.         classes.GlobalData.updateInfo("p", b);
  7180.         garageDynoMC.gotoAndStop("dynoReady");
  7181.         garageDynoMC.populateSessionSwatch();
  7182.     }
  7183.     else if (s == 1)
  7184.     {
  7185.         classes.GlobalData.updateInfo("m", b);
  7186.         garageDynoMC.gotoAndStop("dynoReady");
  7187.     }
  7188.     else if (s == -50)
  7189.     {
  7190.         _root.displayAlert("triangle", "Account Locked", "Sorry, you left a race that is still in progress. Your account is temporarily locked until the race is finished.  This may take moment.");
  7191.     }
  7192.     else
  7193.     {
  7194.         _root.displayAlert("warning", "Insufficient Funds", "Sorry, you do not have enough in your balance to pay for dyno run.");
  7195.     } // end else if
  7196. } // End of the function
  7197. function garageDynoRun(boost, chip)
  7198. {
  7199.     getURL("lingo: runEngineDyno " + boost + ", " + chip, "");
  7200. } // End of the function
  7201. function garageDynoRunCB(strTorque, strFlow, strRatio, strMaxIcon)
  7202. {
  7203.     var _loc2 = strTorque.split(",");
  7204.     var _loc4 = strFlow.split(",");
  7205.     var _loc5 = strRatio.split(",");
  7206.     var _loc3 = strMaxIcon.split(",");
  7207.     for (var _loc1 = 0; _loc1 < _loc2.length; ++_loc1)
  7208.     {
  7209.         _loc2[_loc1] = Number(_loc2[_loc1]);
  7210.         _loc4[_loc1] = Number(_loc4[_loc1]);
  7211.         _loc5[_loc1] = Number(_loc5[_loc1]);
  7212.         _loc3[_loc1] = Number(_loc3[_loc1]);
  7213.     } // end of for
  7214.     garageDynoMC.drawDyno(_loc2, _loc4, _loc5, _loc3);
  7215. } // End of the function
  7216. function garageDynoLoad()
  7217. {
  7218.     getURL("lingo: loadDyno");
  7219. } // End of the function
  7220. function garageDynoLoadCB(n, strTorque, strFlow, strRatio, strMaxIcon)
  7221. {
  7222.     var _loc2 = strTorque.split(",");
  7223.     var _loc4 = strFlow.split(",");
  7224.     var _loc5 = strRatio.split(",");
  7225.     var _loc3 = strMaxIcon.split(",");
  7226.     for (var _loc1 = 0; _loc1 < _loc2.length; ++_loc1)
  7227.     {
  7228.         _loc2[_loc1] = Number(_loc2[_loc1]);
  7229.         _loc4[_loc1] = Number(_loc4[_loc1]);
  7230.         _loc5[_loc1] = Number(_loc5[_loc1]);
  7231.         _loc3[_loc1] = Number(_loc3[_loc1]);
  7232.     } // end of for
  7233.     garageDynoMC.drawDyno(_loc2, _loc4, _loc5, _loc3, n);
  7234. } // End of the function
  7235. function garageDynoSave(aryDyno, aryAir, aryRatio, aryMaxIcon)
  7236. {
  7237.     getURL("lingo: saveDyno \"" + aryDyno.toString() + "\", \"" + aryAir.toString() + "\", \"" + aryRatio.toString() + "\", \"" + aryMaxIcon.toString() + "\"", "");
  7238. } // End of the function
  7239. function garageDynoSaveCB(n)
  7240. {
  7241.     garageDynoMC.saveDynoInfoCallback(n);
  7242. } // End of the function
  7243. function garageSetBoost(acid, b)
  7244. {
  7245.     getURL("lingo: executeCall \"changeboost\", \"acid=" + acid + "&bs=" + b + "\"", "");
  7246. } // End of the function
  7247. function garageSetBoostCB(s)
  7248. {
  7249.     switch (s)
  7250.     {
  7251.         case 1:
  7252.         {
  7253.             break;
  7254.         }
  7255.         case 0:
  7256.         {
  7257.             _root.displayAlert("warning", "No Controller", "Sorry, you do not have a boost controller to adjust your boost.");
  7258.             break;
  7259.         }
  7260.         case -1:
  7261.         {
  7262.             _root.displayAlert("warning", "Invalid Value", "Sorry, the boost you entered is invalid.");
  7263.             break;
  7264.         }
  7265.         case -2:
  7266.         {
  7267.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  7268.             break;
  7269.         }
  7270.         case -3:
  7271.         {
  7272.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is locked.");
  7273.             break;
  7274.         }
  7275.         case -4:
  7276.         {
  7277.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is not yours.");
  7278.             break;
  7279.         }
  7280.     } // End of switch
  7281. } // End of the function
  7282. function garageSetAFRatio(acid, af)
  7283. {
  7284.     getURL("lingo: executeCall \"changeairfuel\", \"acid=" + acid + "&af=" + af + "\"", "");
  7285. } // End of the function
  7286. function garageSetAFRatioCB(s)
  7287. {
  7288.     switch (s)
  7289.     {
  7290.         case 1:
  7291.         {
  7292.             break;
  7293.         }
  7294.         case 0:
  7295.         {
  7296.             _root.displayAlert("warning", "No Controller", "Sorry, you do not have a Full Engine Management to adjust your air to fuel ratio.");
  7297.             break;
  7298.         }
  7299.         case -1:
  7300.         {
  7301.             _root.displayAlert("warning", "Invalid Value", "Sorry, the air to fuel ratio you entered is invalid.");
  7302.             break;
  7303.         }
  7304.         case -2:
  7305.         {
  7306.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  7307.             break;
  7308.         }
  7309.         case -3:
  7310.         {
  7311.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is locked.");
  7312.             break;
  7313.         }
  7314.         case -4:
  7315.         {
  7316.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is not yours.");
  7317.             break;
  7318.         }
  7319.     } // End of switch
  7320. } // End of the function
  7321. function garageSetShiftLightRPM(acid, b)
  7322. {
  7323.     getURL("lingo: executeCall \"changeshiftlightrpm\", \"acid=" + acid + "&slr=" + b + "\"", "");
  7324. } // End of the function
  7325. function garageSetShiftLightRPMCB(s, r)
  7326. {
  7327.     switch (s)
  7328.     {
  7329.         case 1:
  7330.         {
  7331.             break;
  7332.         }
  7333.         case 0:
  7334.         {
  7335.             _root.displayAlert("warning", "No Indicator", "Sorry, you do not have a shift light indicator.");
  7336.             break;
  7337.         }
  7338.         case -1:
  7339.         {
  7340.             _root.displayAlert("warning", "Invalid Value", "Sorry, the rpm you entered is invalid.");
  7341.             break;
  7342.         }
  7343.         case -2:
  7344.         {
  7345.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is impounded.");
  7346.             break;
  7347.         }
  7348.         case -3:
  7349.         {
  7350.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is locked.");
  7351.             break;
  7352.         }
  7353.         case -4:
  7354.         {
  7355.             _root.displayAlert("warning", "Car not Available", "I\'m sorry, but the car you selected is not yours.");
  7356.             break;
  7357.         }
  7358.         case -5:
  7359.         {
  7360.             _root.displayAlert("warning", "Database Error", "I\'m sorry, there was an error accessing your info in the database.");
  7361.             break;
  7362.         }
  7363.         case -6:
  7364.         {
  7365.             _root.displayAlert("warning", "Database Error", "I\'m sorry, but there was an error loading your engine.");
  7366.             break;
  7367.         }
  7368.     } // End of switch
  7369. } // End of the function
  7370. function htGetTournaments()
  7371. {
  7372.     if (classes.Control.serverAvail())
  7373.     {
  7374.         getURL("lingo: executeCall \"gethumantournaments\"");
  7375.     } // end if
  7376. } // End of the function
  7377. function htGetTournamentsCB(s, d)
  7378. {
  7379.     classes.Control.serverUnlock();
  7380.     if (s == 1)
  7381.     {
  7382.         classes.Control.tourneyMenuMC.eventListXML = new XML();
  7383.         classes.Control.tourneyMenuMC.eventListXML.ignoreWhite = true;
  7384.         classes.Control.tourneyMenuMC.eventListXML.parseXML(d);
  7385.     } // end if
  7386.     classes.Control.tourneyMenuMC.gotoAndPlay("listing");
  7387. } // End of the function
  7388. function htJoinTournament(k, bt, acid, tid, pt)
  7389. {
  7390.     if (classes.Control.serverAvail())
  7391.     {
  7392.         _global.htJoinTournamentBT = bt;
  7393.         _global.htJoinTournamentACID = acid;
  7394.         getURL("lingo: executeCall \"joinhumantournament\", \"acid=" + acid + "&tid=" + tid + "&pt=" + pt + "&bt=" + bt + "&k=" + k + "\"", "");
  7395.     } // end if
  7396. } // End of the function
  7397. function htJoinTournamentCB(s, b, d)
  7398. {
  7399.     classes.Control.serverUnlock();
  7400.     if (s == 1)
  7401.     {
  7402.         classes.Control.dialogClose();
  7403.         classes.GlobalData.updateInfo("p", b);
  7404.         _global.sectionTrackMC.gotoAndPlay("humanTourney");
  7405.     }
  7406.     else if (s == 2)
  7407.     {
  7408.         classes.Control.dialogClose();
  7409.         classes.GlobalData.updateInfo("m", b);
  7410.         _global.sectionTrackMC.gotoAndPlay("humanTourney");
  7411.     }
  7412.     else if (s == -27)
  7413.     {
  7414.         delete _global.htJoinTournamentBT;
  7415.         delete _global.htJoinTournamentACID;
  7416.         _root.markTestDriveExpiredAndDisplayWarning();
  7417.     }
  7418.     else
  7419.     {
  7420.         delete _global.htJoinTournamentBT;
  7421.         delete _global.htJoinTournamentACID;
  7422.         _root.displayAlert("warning", "Tournament Error", d);
  7423.     } // end else if
  7424. } // End of the function
  7425. function putCarOnClassified(acid, p, pw, t)
  7426. {
  7427.     if (!acid)
  7428.     {
  7429.         putCarOnClassifiedCB(0, "<n2 e=\"This car is invalid. (System error. Please report code CL760.)\" />");
  7430.         return;
  7431.     } // end if
  7432.     if (!p)
  7433.     {
  7434.         p = 0;
  7435.     } // end if
  7436.     if (!pw.length)
  7437.     {
  7438.         pw = "";
  7439.     } // end if
  7440.     if (!t)
  7441.     {
  7442.         t = 0;
  7443.     } // end if
  7444.     getURL("lingo: executeCall \"putcaronclassified\", \"acid=" + acid + "&p=" + p + "&pw=" + escape(pw) + "&t=" + t + "\"", "");
  7445. } // End of the function
  7446. function putCarOnClassifiedCB(s, d)
  7447. {
  7448.     var _loc1 = new XML();
  7449.     _loc1.ignoreWhite = true;
  7450.     _loc1.parseXML(d);
  7451.     if (s == 1)
  7452.     {
  7453.         classes.GlobalData.updateInfo("m", Number(_loc1.firstChild.attributes.ub));
  7454.     } // end if
  7455.     classes.Control.currentDialog.s = s;
  7456.     classes.Control.currentDialog.msg = _loc1.firstChild.attributes.e;
  7457.     classes.Control.currentDialog.newClassifiedID = _loc1.firstChild.attributes.i;
  7458.     classes.Control.currentDialog.gotoAndStop("finished");
  7459. } // End of the function
  7460. function listClassified(cid, et, p)
  7461. {
  7462.     if (!cid)
  7463.     {
  7464.         cid = 0;
  7465.     } // end if
  7466.     if (!et)
  7467.     {
  7468.         et = 0;
  7469.     } // end if
  7470.     if (!p)
  7471.     {
  7472.         p = 1;
  7473.     } // end if
  7474.     getURL("lingo: executeCall \"listclassified\", \"cid=" + cid + "&et=" + et + "&p=" + p + "\"", "");
  7475. } // End of the function
  7476. function listClassifiedCB(d)
  7477. {
  7478.     classes.SectionClassified._mc.listingGroup.buildList(d);
  7479. } // End of the function
  7480. function getClassifiedDetail(cid)
  7481. {
  7482.     if (!cid)
  7483.     {
  7484.         getClassifiedDetailCB(0, "<n2 e=\"This listing is invalid. (System error. Please report code CL228.)\" />");
  7485.         return;
  7486.     } // end if
  7487.     getURL("lingo: executeCall \"getclassifieddetail\", \"cid=" + cid + "\"", "");
  7488. } // End of the function
  7489. function getClassifiedDetailCB(s, d)
  7490. {
  7491.     if (s == 1)
  7492.     {
  7493.         classes.SectionClassified._mc.detail.build(d);
  7494.     }
  7495.     else
  7496.     {
  7497.         var _loc1 = new XML();
  7498.         _loc1.ignoreWhite = true;
  7499.         _loc1.parseXML(d);
  7500.         classes.Control.dialogTextBrief("Error", _loc1.firstChild.attributes.e, "warning");
  7501.         classes.SectionClassified._mc.closeDetail();
  7502.     } // end else if
  7503. } // End of the function
  7504. function buyFromClassified(cid, p)
  7505. {
  7506.     if (!cid)
  7507.     {
  7508.         buyFromClassifiedCB(0, "<n2 e=\"This listing is invalid. (System error. Please report code CL870.)\" />");
  7509.         return;
  7510.     } // end if
  7511.     getURL("lingo: executeCall \"buyfromclassified\", \"cid=" + cid + "&p=" + escape(p) + "\"", "");
  7512. } // End of the function
  7513. function buyFromClassifiedCB(s, d)
  7514. {
  7515.     var _loc1 = new XML();
  7516.     _loc1.ignoreWhite = true;
  7517.     _loc1.parseXML(d);
  7518.     if (s == 1)
  7519.     {
  7520.         classes.GlobalData.updateInfo("m", Number(_loc1.firstChild.attributes.ub));
  7521.     } // end if
  7522.     classes.Control.currentDialog.s = s;
  7523.     classes.Control.currentDialog.msg = _loc1.firstChild.attributes.e;
  7524.     classes.Control.currentDialog.gotoAndStop("finished");
  7525. } // End of the function
  7526. function sellerClassifiedHistory()
  7527. {
  7528.     getURL("lingo: executeCall \"classifiedhistory\"");
  7529. } // End of the function
  7530. function sellerClassifiedHistoryCB(d)
  7531. {
  7532.     classes.SectionClassified._mc.myListingsGroup.buildList(d);
  7533. } // End of the function
  7534. function cancelClassified(cid)
  7535. {
  7536.     if (!cid)
  7537.     {
  7538.         cancelClassifiedCB(0, "<n2 e=\"Listing is invalid. (System error. Please report code CL239.)\" />");
  7539.         return;
  7540.     } // end if
  7541.     getURL("lingo: executeCall \"cancelclassified\", \"cid=" + cid + "\"", "");
  7542. } // End of the function
  7543. function cancelClassifiedCB(s, d)
  7544. {
  7545.     var _loc1 = new XML();
  7546.     _loc1.ignoreWhite = true;
  7547.     _loc1.parseXML(d);
  7548.     if (s == 1)
  7549.     {
  7550.         classes.SectionClassified._mc.gotoAndPlay("trade");
  7551.         classes.GlobalData.updateCarAttr(Number(_loc1.firstChild.attributes.i), "lk", 0);
  7552.         classes.Control.dialogTextBrief("Listing Retracted", "You have canceled this listing, so it has been removed from Used Cars.  If this car was impounded, it will remain impounded.  Otherwise, you can now race with this car again.", "key");
  7553.     }
  7554.     else
  7555.     {
  7556.         classes.Control.dialogTextBrief("Error", _loc1.firstChild.attributes.e, "warning");
  7557.         classes.SectionClassified._mc.closeDetail();
  7558.     } // end else if
  7559. } // End of the function
  7560. function requestTrade(cid1, cid2, p)
  7561. {
  7562.     if (!cid1 || !cid2)
  7563.     {
  7564.         requestTradeCB(0, "<n2 e=\"Two used car listing ID\'s are required to make a trade offer.  Please try again.\" />");
  7565.         return;
  7566.     } // end if
  7567.     getURL("lingo: executeCall \"requesttrade\", \"cid1=" + cid1 + "&cid2=" + cid2 + "&p=" + escape(p) + "\"", "");
  7568. } // End of the function
  7569. function requestTradeCB(s, d)
  7570. {
  7571.     var _loc1 = new XML();
  7572.     _loc1.ignoreWhite = true;
  7573.     _loc1.parseXML(d);
  7574.     classes.Control.currentDialog.s = s;
  7575.     classes.Control.currentDialog.msg = _loc1.firstChild.attributes.e;
  7576.     classes.Control.currentDialog.gotoAndStop("finished");
  7577. } // End of the function
  7578. function respondTrade(cid1, cid2, a)
  7579. {
  7580.     if (!cid1 || !cid2)
  7581.     {
  7582.         respondTradeCB(0, "<n2 e=\"Trade offer cannot be found. (System error. Please report code CL283.)\" />");
  7583.         return;
  7584.     } // end if
  7585.     if (!a)
  7586.     {
  7587.         a = 0;
  7588.     } // end if
  7589.     getURL("lingo: executeCall \"respondtrade\", \"cid1=" + cid1 + "&cid2=" + cid2 + "&a=" + a + "\"", "");
  7590. } // End of the function
  7591. function respondTradeCB(s, d)
  7592. {
  7593.     var _loc2 = new XML();
  7594.     _loc2.ignoreWhite = true;
  7595.     _loc2.parseXML(d);
  7596.     if (s == 1)
  7597.     {
  7598.         if (_loc2.firstChild.attributes.a == 1)
  7599.         {
  7600.             classes.GlobalData.updateInfo("m", Number(_loc2.firstChild.attributes.ub));
  7601.             _root.getCars();
  7602.             classes.Control.dialogTextBrief("Trade Succeeded", "The trade has been made!  Your new car is now in your garage.  Your old car has been removed from your garage and has been given to the other party.", "keyPlus");
  7603.         } // end if
  7604.         classes.SectionClassified._mc.gotoAndPlay("trade");
  7605.     }
  7606.     else
  7607.     {
  7608.         classes.Control.dialogTextBrief("Error", _loc2.firstChild.attributes.e, "warning");
  7609.     } // end else if
  7610. } // End of the function
  7611. function cancelTrade(cid1, cid2)
  7612. {
  7613.     if (!cid1 || !cid2)
  7614.     {
  7615.         cancelTradeCB(0, "<n2 e=\"Trade offer cannot be found. (System error. Please report code CL196.)\" />");
  7616.         return;
  7617.     } // end if
  7618.     getURL("lingo: executeCall \"canceltrade\", \"cid1=" + cid1 + "&cid2=" + cid2 + "\"", "");
  7619. } // End of the function
  7620. function cancelTradeCB(s, d)
  7621. {
  7622.     if (s == 1)
  7623.     {
  7624.         classes.SectionClassified._mc.closeDetail();
  7625.         classes.SectionClassified._mc.gotoAndPlay("trade");
  7626.     }
  7627.     else
  7628.     {
  7629.         var _loc1 = new XML();
  7630.         _loc1.ignoreWhite = true;
  7631.         _loc1.parseXML(d);
  7632.         classes.Control.dialogTextBrief("Error", _loc1.firstChild.attributes.e, "warning");
  7633.     } // end else if
  7634. } // End of the function
  7635. function pendingTrades(cid)
  7636. {
  7637.     if (!cid)
  7638.     {
  7639.         return;
  7640.     } // end if
  7641.     getURL("lingo: executeCall \"getpendingtrades\", \"cid=" + cid + "\"", "");
  7642. } // End of the function
  7643. function pendingTradesCB(d)
  7644. {
  7645.     classes.mc.UCIncomingTrades._mc.buildList(d);
  7646. } // End of the function
  7647. function outgoingTradeHistory()
  7648. {
  7649.     getURL("lingo: executeCall \"getoutgoingtradehistory\"");
  7650. } // End of the function
  7651. function outgoingTradeHistoryCB(d)
  7652. {
  7653.     classes.SectionClassified._mc.myTradesGroup.buildList(d);
  7654. } // End of the function
  7655. function claimPendingUCLProfit()
  7656. {
  7657.     getURL("lingo: executeCall \"claimpendinguclprofit\"");
  7658. } // End of the function
  7659. function claimPendingUCLProfitCB(s, d)
  7660. {
  7661.     var _loc2 = new XML(d);
  7662.     if (s == 0)
  7663.     {
  7664.         var _loc3 = _loc2.firstChild.attributes.e;
  7665.         _root.displayAlert("warning", "Error", _loc3);
  7666.     }
  7667.     else if (s == -1)
  7668.     {
  7669.         _root.displayAlert("warning", "Warning", "There were no sold cars to deposit money for");
  7670.     } // end else if
  7671. } // End of the function
  7672. function uggGetPartID(catID)
  7673. {
  7674.     for (var _loc2 = 0; _loc2 < _global.partXML.firstChild.childNodes.length; ++_loc2)
  7675.     {
  7676.         if (_global.partXML.firstChild.childNodes[_loc2].attributes.pi == catID)
  7677.         {
  7678.             return (Number(_global.partXML.firstChild.childNodes[_loc2].attributes.i));
  7679.             break;
  7680.         } // end if
  7681.     } // end of for
  7682.     return (0);
  7683. } // End of the function
  7684. function uggUpload(acid, pathHood, pathSide, pathFront, pathBack)
  7685. {
  7686.     _global.uggUploadObj = new Object();
  7687.     _global.uggUploadObj.selectedCar = Number(acid);
  7688.     if (!pathHood.length || pathHood == "" || pathHood == "undefined")
  7689.     {
  7690.         pathHood = "";
  7691.     } // end if
  7692.     if (!pathSide.length || pathSide == "" || pathSide == "undefined")
  7693.     {
  7694.         pathSide = "";
  7695.     } // end if
  7696.     if (!pathFront.length || pathFront == "" || pathFront == "undefined")
  7697.     {
  7698.         pathFront = "";
  7699.     } // end if
  7700.     if (!pathBack.length || pathBack == "" || pathBack == "undefined")
  7701.     {
  7702.         pathBack = "";
  7703.     } // end if
  7704.     getURL("lingo: uggUpload \"" + pathHood + "\", \"" + pathSide + "\", \"" + pathFront + "\", \"" + pathBack + "\"", "");
  7705. } // End of the function
  7706. function uggUploadCB(s, d)
  7707. {
  7708.     _global.uggUploadObj.uggInstallArr = new Array();
  7709.     if (s == 1)
  7710.     {
  7711.         var _loc4 = new XML();
  7712.         _loc4.ignoreWhite = true;
  7713.         _loc4.parseXML(d);
  7714.         var _loc3;
  7715.         if (_loc4.firstChild.attributes.h)
  7716.         {
  7717.             _loc3 = uggGetPartID(160);
  7718.             if (_loc3)
  7719.             {
  7720.                 _global.uggUploadObj.uggInstallArr.push(["Hood", "lingo: executeCall \"buypartugg\", \"acid=" + _global.uggUploadObj.selectedCar + "&pid=" + _loc3 + "&did=" + _loc4.firstChild.attributes.h + "&pt=p&pvid=&c=\""]);
  7721.             } // end if
  7722.         } // end if
  7723.         if (_loc4.firstChild.attributes.s)
  7724.         {
  7725.             _loc3 = uggGetPartID(161);
  7726.             if (_loc3)
  7727.             {
  7728.                 _global.uggUploadObj.uggInstallArr.push(["Side", "lingo: executeCall \"buypartugg\", \"acid=" + _global.uggUploadObj.selectedCar + "&pid=" + _loc3 + "&did=" + _loc4.firstChild.attributes.s + "&pt=p&pvid=&c=\""]);
  7729.             } // end if
  7730.         } // end if
  7731.         if (_loc4.firstChild.attributes.f)
  7732.         {
  7733.             _loc3 = uggGetPartID(162);
  7734.             if (_loc3)
  7735.             {
  7736.                 _global.uggUploadObj.uggInstallArr.push(["Front", "lingo: executeCall \"buypartugg\", \"acid=" + _global.uggUploadObj.selectedCar + "&pid=" + _loc3 + "&did=" + _loc4.firstChild.attributes.f + "&pt=p&pvid=&c=\""]);
  7737.             } // end if
  7738.         } // end if
  7739.         if (_loc4.firstChild.attributes.b)
  7740.         {
  7741.             _loc3 = uggGetPartID(163);
  7742.             if (_loc3)
  7743.             {
  7744.                 _global.uggUploadObj.uggInstallArr.push(["Back", "lingo: executeCall \"buypartugg\", \"acid=" + _global.uggUploadObj.selectedCar + "&pid=" + _loc3 + "&did=" + _loc4.firstChild.attributes.b + "&pt=p&pvid=&c=\""]);
  7745.             } // end if
  7746.         } // end if
  7747.         if (_global.uggUploadObj.uggInstallArr.length > 0)
  7748.         {
  7749.             uggBuyCycleCB();
  7750.         }
  7751.         else
  7752.         {
  7753.             _root.abc.contentMC.gotoAndStop("done");
  7754.             _root.abc.contentMC.msg = "Sorry, some kind of error occurred, which caused the process to fail.";
  7755.         } // end else if
  7756.     }
  7757.     else
  7758.     {
  7759.         _root.abc.contentMC.gotoAndStop("done");
  7760.         _root.abc.contentMC.msg = "Sorry, some kind of error occurred, which caused the process to fail.";
  7761.     } // end else if
  7762. } // End of the function
  7763. function uggBuyCycleCB(d1, d2)
  7764. {
  7765.     _root.abc.contentMC.gotoAndStop("installing");
  7766.     var _loc7 = new XML(d1);
  7767.     if (d1.length)
  7768.     {
  7769.         if (_loc7.firstChild.attributes.s == 0)
  7770.         {
  7771.             _root.abc.contentMC.gotoAndStop("done");
  7772.             _root.abc.contentMC.msg = "Sorry, some kind of error occurred, which caused the process to fail.";
  7773.             return;
  7774.         } // end if
  7775.         var _loc6 = new XML(d1);
  7776.         var _loc4 = Number(_loc6.firstChild.attributes.b);
  7777.         if (!_global.uggUploadObj.newBal || _loc4 <= _global.uggUploadObj.newBal)
  7778.         {
  7779.             _global.uggUploadObj.newBal = _loc4;
  7780.         } // end if
  7781.     } // end if
  7782.     if (_global.uggUploadObj.uggInstallArr.length)
  7783.     {
  7784.         getURL(_global.uggUploadObj.uggInstallArr[0][1], "");
  7785.         _global.uggUploadObj.uggInstallArr.shift();
  7786.     }
  7787.     else
  7788.     {
  7789.         classes.Lookup.addCallback("getOneCar", this, uggUpdateCarCB, String(_global.uggUploadObj.selectedCar));
  7790.         _root.getOneCar(_global.uggUploadObj.selectedCar);
  7791.         if (_global.uggUploadObj.newBal != undefined)
  7792.         {
  7793.             classes.GlobalData.updateInfo("p", _global.uggUploadObj.newBal);
  7794.             delete _global.uggUploadObj.newBal;
  7795.         } // end if
  7796.         delete _global.uggUploadObj.uggInstallArr;
  7797.         delete _global.uggUploadObj;
  7798.     } // end else if
  7799. } // End of the function
  7800. function uggUpdateCarCB(carXML)
  7801. {
  7802.     var _loc4 = Number(carXML.firstChild.firstChild.attributes.i);
  7803.     var _loc3;
  7804.     for (var _loc3 = 0; _loc3 < _global.garageXML.firstChild.childNodes.length; ++_loc3)
  7805.     {
  7806.         if (_loc4 == _global.garageXML.firstChild.childNodes[_loc3].attributes.i)
  7807.         {
  7808.             _global.garageXML.firstChild.childNodes[_loc3].removeNode();
  7809.             break;
  7810.         } // end if
  7811.     } // end of for
  7812.     if (_loc3 < _global.garageXML.firstChild.childNodes.length - 1)
  7813.     {
  7814.         _global.garageXML.firstChild.insertBefore(carXML.firstChild.firstChild, _global.garageXML.firstChild.childNodes[_loc3]);
  7815.     }
  7816.     else
  7817.     {
  7818.         _global.garageXML.firstChild.appendChild(carXML.firstChild.firstChild);
  7819.     } // end else if
  7820.     _global.shopPartsMC.cloneGarageCar();
  7821.     _global.shopUGGGroup.init();
  7822.     _global.shopPartsMC.initUGGPurchase();
  7823.     _root.abc.contentMC.gotoAndStop("done");
  7824.     classes.Lookup.removeFromRaceCarsXML(_loc4);
  7825.     _root.abc.contentMC.msg = "Graphics purchase and installation complete!  " + _root.abc.uggCost + " points have been deducted from your account.";
  7826. } // End of the function
  7827. function downloadUgg(finalLocalPath, requestingCarMC)
  7828. {
  7829.     var _loc6 = finalLocalPath.split("/");
  7830.     var _loc3 = _loc6.pop();
  7831.     if (_loc3.length)
  7832.     {
  7833.         if (!_global.downloadUggArray)
  7834.         {
  7835.             _global.downloadUggArray = new Array();
  7836.         } // end if
  7837.         var _loc4;
  7838.         for (var _loc2 = 0; _loc2 < _global.downloadUggArray.length; ++_loc2)
  7839.         {
  7840.             if (_global.downloadUggArray[_loc2][0] == _loc3)
  7841.             {
  7842.                 _loc4 = true;
  7843.                 break;
  7844.             } // end if
  7845.         } // end of for
  7846.         var _loc5 = new Array(_loc3, requestingCarMC);
  7847.         _global.downloadUggArray.push(_loc5);
  7848.         if (!_loc4)
  7849.         {
  7850.             getURL("lingo: downloadUgg \"" + _loc3 + "\"", "");
  7851.         } // end if
  7852.     } // end if
  7853. } // End of the function
  7854. function downloadUggCB(filename, isAvailable)
  7855. {
  7856.     var _loc4 = filename.split("_")[0];
  7857.     for (var _loc2 = 0; _loc2 < _global.downloadUggArray.length; ++_loc2)
  7858.     {
  7859.         if (_global.downloadUggArray[_loc2][0] == filename)
  7860.         {
  7861.             _global.downloadUggArray[_loc2][1].uggOnRetrieve(_loc4, isAvailable);
  7862.             _global.downloadUggArray.splice(_loc2, 1);
  7863.             --_loc2;
  7864.         } // end if
  7865.     } // end of for
  7866. } // End of the function
  7867. function twitterLogin(username, password, command)
  7868. {
  7869.     var _loc1 = new LoadVars();
  7870.     _loc1.twu = username;
  7871.     _loc1.twp = password;
  7872.     _loc1.twc = command;
  7873.     getURL("lingo: executeCall \"logintwitter\", \"" + _loc1.toString() + "\"", "");
  7874. } // End of the function
  7875. function loginTwitterCB(s, u)
  7876. {
  7877.     _global.homeTwitterAccountMC.visible = true;
  7878.     _global.twitterName = u;
  7879.     if (s == 1)
  7880.     {
  7881.         _global.homeTwitterAccountMC.gotoAndStop("loggedIn");
  7882.     }
  7883.     else if (s == 2)
  7884.     {
  7885.         _global.homeTwitterAccountMC.gotoAndStop("disable");
  7886.     }
  7887.     else if (s == 3)
  7888.     {
  7889.         _global.homeTwitterAccountMC.gotoAndStop("enable");
  7890.     }
  7891.     else if (s == 4)
  7892.     {
  7893.         _global.homeTwitterAccountMC.gotoAndStop("login");
  7894.     }
  7895.     else if (s == 5)
  7896.     {
  7897.         _global.homeTwitterAccountMC.gotoAndStop("disable");
  7898.     }
  7899.     else if (s == 6)
  7900.     {
  7901.         _global.homeTwitterAccountMC.gotoAndStop("enable");
  7902.     }
  7903.     else if (s == -7)
  7904.     {
  7905.         _root.displayAlert("warning", "Disabled", "This feature has been temporarily disabled.");
  7906.     }
  7907.     else
  7908.     {
  7909.         _root.displayAlert("warning", "Failed Login", "Sorry, your login failed.");
  7910.     } // end else if
  7911. } // End of the function
  7912. function setBadgeVisible(badgeID, visible)
  7913. {
  7914.     var _loc1 = new LoadVars();
  7915.     var _loc2 = 0;
  7916.     if (visible == true)
  7917.     {
  7918.         _loc2 = 1;
  7919.     } // end if
  7920.     _loc1.vis = _loc2;
  7921.     _loc1.bid = badgeID;
  7922.     getURL("lingo: executeCall \"setbadgevisible\", \"" + _loc1.toString() + "\"", "");
  7923. } // End of the function
  7924. function setBadgeVisibleCB(s)
  7925. {
  7926. } // End of the function
  7927. function getElectionPhase(id)
  7928. {
  7929.     classes.Frame.serverLights(true);
  7930.     getURL("lingo: executeCall \"getelectionphase\", \"i=" + id + "\"", "");
  7931. } // End of the function
  7932. function getElectionPhaseCB(s, phase, timeRemainingInPhase, i)
  7933. {
  7934.     classes.Frame.serverLights(false);
  7935.     var _loc1 = new Object();
  7936.     _loc1.phase = phase;
  7937.     _loc1.secsRemaining = timeRemainingInPhase;
  7938.     _loc1.activeElection = s;
  7939.     classes.Lookup.runCallback("setElectionPhase", String(i), _loc1);
  7940. } // End of the function
  7941. function getElectionSchedule()
  7942. {
  7943.     getURL("lingo: executeCall \"getelectionschedule\"");
  7944.     classes.Frame.serverLights(true);
  7945. } // End of the function
  7946. function getElectionScheduleCB(d)
  7947. {
  7948.     classes.Frame.serverLights(false);
  7949.     var _loc8 = new XML(d);
  7950.     var _loc1 = new classes.ElectionSchedule();
  7951.     var _loc11 = new Date();
  7952.     for (var _loc6 = 0; _loc6 < _loc8.firstChild.childNodes.length; ++_loc6)
  7953.     {
  7954.         var _loc7 = _loc8.firstChild.childNodes[_loc6].childNodes[0].nodeValue;
  7955.         var _loc3;
  7956.         var _loc2;
  7957.         if (_loc8.firstChild.childNodes[_loc6].nodeName != "q" && _loc8.firstChild.childNodes[_loc6].nodeName != "nomdates" && _loc8.firstChild.childNodes[_loc6].nodeName != "eliminationdates" && _loc8.firstChild.childNodes[_loc6].nodeName != "finalvotedates")
  7958.         {
  7959.             _loc3 = new Date(Number(_loc7) * 1000);
  7960.             _loc2 = new Date(_loc3.getUTCFullYear(), _loc3.getUTCMonth(), _loc3.getUTCDate(), _loc3.getUTCHours(), _loc3.getUTCMinutes(), _loc3.getUTCSeconds(), _loc3.getUTCMilliseconds());
  7961.         } // end if
  7962.         switch (_loc8.firstChild.childNodes[_loc6].nodeName)
  7963.         {
  7964.             case "q":
  7965.             {
  7966.                 _loc1.quarter = Number(_loc7);
  7967.                 break;
  7968.             }
  7969.             case "nomdates":
  7970.             {
  7971.                 _loc1.nomDates = _loc7;
  7972.                 break;
  7973.             }
  7974.             case "eliminationdates":
  7975.             {
  7976.                 _loc1.eliminationDates = _loc7;
  7977.                 break;
  7978.             }
  7979.             case "finalvotedates":
  7980.             {
  7981.                 _loc1.finalVoteDates = _loc7;
  7982.                 break;
  7983.             }
  7984.             case "currentdate":
  7985.             {
  7986.                 _loc1.currentDate = _loc2;
  7987.                 break;
  7988.             }
  7989.             case "promobeg":
  7990.             {
  7991.                 _loc1.promoBeg = _loc2;
  7992.                 break;
  7993.             }
  7994.             case "promoend":
  7995.             {
  7996.                 _loc1.promoEnd = _loc2;
  7997.                 break;
  7998.             }
  7999.             case "nomclosedbeg":
  8000.             {
  8001.                 _loc1.nomClosedBeg = _loc2;
  8002.                 break;
  8003.             }
  8004.             case "nomclosedend":
  8005.             {
  8006.                 _loc1.nomClosedEnd = _loc2;
  8007.                 break;
  8008.             }
  8009.             case "nomannouncebeg":
  8010.             {
  8011.                 _loc1.nomAnnounceBeg = _loc2;
  8012.                 break;
  8013.             }
  8014.             case "nomannounceend":
  8015.             {
  8016.                 _loc1.nomAnnounceEnd = _loc2;
  8017.                 break;
  8018.             }
  8019.             case "nombeg":
  8020.             {
  8021.                 _loc1.nomBeg = _loc2;
  8022.                 break;
  8023.             }
  8024.             case "nomend":
  8025.             {
  8026.                 _loc1.nomEnd = _loc2;
  8027.                 break;
  8028.             }
  8029.             case "voting":
  8030.             {
  8031.                 for (var _loc10 = 0; _loc10 < _loc8.firstChild.childNodes[_loc6].childNodes.length; ++_loc10)
  8032.                 {
  8033.                     var _loc9 = _loc8.firstChild.childNodes[_loc6].childNodes[_loc10];
  8034.                     var _loc4 = Number(_loc8.firstChild.childNodes[_loc6].childNodes[_loc10].nodeName);
  8035.                     _loc1.votingRounds[_loc4] = new Object();
  8036.                     for (var _loc5 = 0; _loc5 < _loc9.childNodes.length; ++_loc5)
  8037.                     {
  8038.                         _loc7 = _loc9.childNodes[_loc5].childNodes[0].nodeValue;
  8039.                         _loc3 = new Date(Number(_loc7) * 1000);
  8040.                         _loc2 = new Date(_loc3.getUTCFullYear(), _loc3.getUTCMonth(), _loc3.getUTCDate(), _loc3.getUTCHours(), _loc3.getUTCMinutes(), _loc3.getUTCSeconds(), _loc3.getUTCMilliseconds());
  8041.                         switch (_loc9.childNodes[_loc5].nodeName)
  8042.                         {
  8043.                             case "interviewbeg":
  8044.                             {
  8045.                                 _loc1.votingRounds[_loc4].interviewBeg = _loc2;
  8046.                                 break;
  8047.                             }
  8048.                             case "interviewend":
  8049.                             {
  8050.                                 _loc1.votingRounds[_loc4].interviewEnd = _loc2;
  8051.                                 break;
  8052.                             }
  8053.                             case "votingbeg":
  8054.                             {
  8055.                                 _loc1.votingRounds[_loc4].votingBeg = _loc2;
  8056.                                 break;
  8057.                             }
  8058.                             case "votingend":
  8059.                             {
  8060.                                 _loc1.votingRounds[_loc4].votingEnd = _loc2;
  8061.                                 break;
  8062.                             }
  8063.                             case "votingclosedbeg":
  8064.                             {
  8065.                                 _loc1.votingRounds[_loc4].votingClosedBeg = _loc2;
  8066.                                 break;
  8067.                             }
  8068.                             case "votingclosedend":
  8069.                             {
  8070.                                 _loc1.votingRounds[_loc4].votingClosedEnd = _loc2;
  8071.                                 break;
  8072.                             }
  8073.                             case "votingresults":
  8074.                             {
  8075.                                 _loc1.votingRounds[_loc4].votingResults = _loc2;
  8076.                             }
  8077.                         } // End of switch
  8078.                     } // end of for
  8079.                 } // end of for
  8080.             }
  8081.         } // End of switch
  8082.     } // end of for
  8083.     classes.SectionModElection.MC.takeElectionSchedule(_loc1);
  8084. } // End of the function
  8085. function getNominateCount()
  8086. {
  8087.     getURL("lingo: executeCall \"getnominatecount\"");
  8088.     classes.Frame.serverLights(true);
  8089. } // End of the function
  8090. function getNominateCountCB(c)
  8091. {
  8092.     classes.Frame.serverLights(false);
  8093.     classes.SectionModElection.MC.takeNomsRemaining(3 - c);
  8094.     classes.SectionModElection.MC.startNomination();
  8095. } // End of the function
  8096. function nominate(nomineeAccountID)
  8097. {
  8098.     classes.Frame.serverLights(true);
  8099.     getURL("lingo: executeCall \"nominate\", \"nid=" + nomineeAccountID + "\"", "");
  8100. } // End of the function
  8101. function nominateCB(s, e)
  8102. {
  8103.     classes.Frame.serverLights(false);
  8104.     classes.SectionModElection.MC.takeNominationResult(s, e);
  8105. } // End of the function
  8106. function getElectionResult(phaseId)
  8107. {
  8108.     classes.Frame.serverLights(true);
  8109.     getURL("lingo: executeCall \"getelectionresult\", \"pid=" + phaseId + "\"", "");
  8110. } // End of the function
  8111. function getElectionResultCB(d)
  8112. {
  8113.     classes.Frame.serverLights(false);
  8114.     var _loc2 = new XML(d);
  8115.     var _loc7 = Number(_loc2.firstChild.attributes.s);
  8116.     if (_loc7 == 0)
  8117.     {
  8118.         var _loc8 = _loc2.firstChild.childNodes[0].firstChild;
  8119.     }
  8120.     else
  8121.     {
  8122.         var _loc3 = new Array();
  8123.         var _loc6 = _loc2.firstChild.childNodes.length;
  8124.         for (var _loc1 = 0; _loc1 < _loc6; ++_loc1)
  8125.         {
  8126.             _loc3.push(new Object({i: _loc2.firstChild.childNodes[_loc1].attributes.i, u: _loc2.firstChild.childNodes[_loc1].attributes.u, c: _loc2.firstChild.childNodes[_loc1].attributes.c}));
  8127.         } // end of for
  8128.         classes.SectionModElection.MC.takeElectionResult(_loc3);
  8129.     } // end else if
  8130. } // End of the function
  8131. function electionVote(nomineeAccountID, amount)
  8132. {
  8133.     classes.Frame.serverLights(true);
  8134.     getURL("lingo: executeCall \"electionvote\", \"nid=" + nomineeAccountID + "&amt=" + amount + "\"", "");
  8135. } // End of the function
  8136. function electionVoteCB(s, e)
  8137. {
  8138.     classes.Frame.serverLights(false);
  8139.     if (s == 1)
  8140.     {
  8141.         classes.GlobalData.updateInfo("m", Number(e));
  8142.     } // end if
  8143.     classes.SectionModElection.MC.takeVoteResult(s, e);
  8144. } // End of the function
  8145. function getSupport(supportID, supportVars, callID)
  8146. {
  8147.     classes.Frame.serverLights(true);
  8148.     var _loc2 = new LoadVars();
  8149.     _loc2.sid = supportID;
  8150.     _loc2.i = callID;
  8151.     if (supportVars.email)
  8152.     {
  8153.         _loc2.em = supportVars.email;
  8154.     } // end if
  8155.     if (supportVars.offenderUsername)
  8156.     {
  8157.         _loc2.offun = supportVars.offenderUsername;
  8158.     } // end if
  8159.     if (supportVars.playerName)
  8160.     {
  8161.         _loc2.pn = supportVars.playerName;
  8162.     } // end if
  8163.     if (supportVars.notes1)
  8164.     {
  8165.         _loc2.n1 = supportVars.notes1;
  8166.     } // end if
  8167.     if (supportVars.notes2)
  8168.     {
  8169.         _loc2.n2 = supportVars.notes2;
  8170.     } // end if
  8171.     getURL("lingo: executeCall \"getsupport\", \"" + _loc2.toString() + "\"", "");
  8172. } // End of the function
  8173. function getSupportCB(s, m, i, t)
  8174. {
  8175.     classes.Frame.serverLights(false);
  8176.     var _loc1 = new Object();
  8177.     _loc1.s = s;
  8178.     _loc1.m = m;
  8179.     _loc1.t = t;
  8180.     classes.Lookup.runCallback("getSupport", String(i), _loc1);
  8181. } // End of the function
  8182. function getMisconductCount(offenderAccountID)
  8183. {
  8184.     getURL("lingo: executeCall \"getmisconductcount\", \"oid=" + offenderAccountID + "\"", "");
  8185. } // End of the function
  8186. function getMisconductCountCB(offenderAccountID, newReport, totalBanned)
  8187. {
  8188.     var _loc1 = new Object();
  8189.     _loc1.id = offenderAccountID;
  8190.     _loc1.r = newReport;
  8191.     _loc1.b = totalBanned;
  8192.     classes.Lookup.runCallback("getMisconductCount", String(offenderAccountID), _loc1);
  8193. } // End of the function
  8194. function fbGetToken()
  8195. {
  8196.     getURL("lingo: executeCall \"fbgettoken\"");
  8197. } // End of the function
  8198. function fbGetTokenCB(s)
  8199. {
  8200.     if (s == 1)
  8201.     {
  8202.         classes.Frame._MC.loginGroup.fbTokenSuccess();
  8203.        
  8204.     } // end if
  8205. } // End of the function
  8206. function fbGetSession()
  8207. {
  8208.     _root.doPreLoginStuff();
  8209.     getURL("lingo: executeCall \"fbgetsession\"");
  8210. } // End of the function
  8211. function fbGetSessionCB(s)
  8212. {
  8213.     classes.Frame._MC.loginGroup.getSessionCB(s);
  8214. } // End of the function
  8215. function fbRemoveFacebook(password, passwordConfirm)
  8216. {
  8217.     var _loc1 = new LoadVars();
  8218.     _loc1.npw = password;
  8219.     _loc1.npwc = passwordConfirm;
  8220.     classes.Frame.serverLights(true);
  8221.     getURL("lingo: executeCall \"fbremovefacebook\", \"" + _loc1.toString() + "\"", "");
  8222. } // End of the function
  8223. function fbRemoveFacebookCB(s)
  8224. {
  8225.     _global.clearTimeout(_root.abc.contentMC.sendSI);
  8226.     classes.Frame.serverLights(false);
  8227.     switch (s)
  8228.     {
  8229.         case 1:
  8230.         {
  8231.             classes.GlobalData.facebookConnected = false;
  8232.             classes.Console.hideFacebookInviteButton();
  8233.             if (classes.HomeAccount._MC.accountSecurity.btnRemoveFacebook)
  8234.             {
  8235.                 classes.HomeAccount._MC.accountSecurity.btnRemoveFacebook._visible = false;
  8236.                 classes.HomeAccount._MC.accountSecurity.btnRemoveFacebook.onRelease = null;
  8237.             } // end if
  8238.             _root.abc.contentMC.gotoAndPlay("sent");
  8239.             break;
  8240.         }
  8241.         case 0:
  8242.         {
  8243.             _root.abc.contentMC.err = "Error creating new password, please try again later.";
  8244.             _root.abc.contentMC.gotoAndPlay("error");
  8245.             break;
  8246.         }
  8247.         case -1:
  8248.         {
  8249.             _root.abc.contentMC.err = "Error disconnecting account from Facebook. Please try again later.";
  8250.             _root.abc.contentMC.gotoAndPlay("error");
  8251.             break;
  8252.         }
  8253.         case -3:
  8254.         {
  8255.             _root.abc.contentMC.err = "Passwords don\'t match, please try again.";
  8256.             _root.abc.contentMC.gotoAndPlay("error");
  8257.             break;
  8258.         }
  8259.         case -4:
  8260.         {
  8261.             _root.abc.contentMC.err = "Password cannot contain spaces.";
  8262.             _root.abc.contentMC.gotoAndPlay("error");
  8263.             break;
  8264.         }
  8265.     } // End of switch
  8266. } // End of the function
  8267. function openFBInviteURL()
  8268. {
  8269.     if (classes.GlobalData.prefsObj.dev)
  8270.     {
  8271.         openURL("http://wwwstaging.nittolegends.com/invite.aspx");
  8272.     }
  8273.     else
  8274.     {
  8275.         openURL("http://www.nittolegends.com/invite.aspx");
  8276.     } // end else if
  8277. } // End of the function
  8278. function clearFB()
  8279. {
  8280.     getURL("lingo: clearFB");
  8281. } // End of the function
  8282. function checkTestDrive()
  8283. {
  8284.     classes.Frame.serverLights(true);
  8285.     getURL("lingo: executeCall \"checktestdrive\"");
  8286. } // End of the function
  8287. function checkTestDriveCB(s, d)
  8288. {
  8289.     classes.Frame.serverLights(false);
  8290.     switch (s)
  8291.     {
  8292.         case 1:
  8293.         {
  8294.             var _loc1 = new XML(d);
  8295.             classes.TestDriveCar.carID = _loc1.firstChild.attributes.ci;
  8296.             classes.TestDriveCar.color = _loc1.firstChild.attributes.c;
  8297.             classes.TestDriveCar.invitationID = _loc1.firstChild.attributes.tid;
  8298.             var _loc2 = new Object();
  8299.             _loc2.loc = _loc1.firstChild.attributes.lod;
  8300.             _loc2.carID = classes.TestDriveCar.carID;
  8301.             classes.Control.dialogContainer("dialogTestDriveAcceptContent", _loc2);
  8302.             break;
  8303.         }
  8304.         case -2:
  8305.         {
  8306.             break;
  8307.         }
  8308.         case -3:
  8309.         {
  8310.             displayAlert("warning", "Account Error", "Sorry, there was error accessing your account.");
  8311.             break;
  8312.         }
  8313.         case -4:
  8314.         {
  8315.             break;
  8316.         }
  8317.         case -5:
  8318.         {
  8319.             displayAlert("warning", "Error", "Sorry, unable to create the test drive invitation");
  8320.             break;
  8321.         }
  8322.     } // End of switch
  8323. } // End of the function
  8324. function acceptTestDrive()
  8325. {
  8326.     var _loc1 = new LoadVars();
  8327.     _loc1.tid = classes.TestDriveCar.invitationID;
  8328.     _loc1.c = classes.TestDriveCar.color;
  8329.     _loc1.cid = classes.TestDriveCar.carID;
  8330.     classes.Frame.serverLights(true);
  8331.     getURL("lingo: executeCall \"accepttestdrive\", \"" + _loc1.toString() + "\"", "");
  8332. } // End of the function
  8333. function acceptTestDriveCB(s, h, m, p, d)
  8334. {
  8335.     classes.Frame.serverLights(false);
  8336.     switch (s)
  8337.     {
  8338.         case 1:
  8339.         {
  8340.             var _loc3 = new XML();
  8341.             _loc3.ignoreWhite = true;
  8342.             _loc3.parseXML(d);
  8343.             _root.updateDefaultCar(_loc3.firstChild.attributes.i);
  8344.             _loc3.firstChild.attributes.td = 1;
  8345.             _loc3.firstChild.attributes.tdex = 0;
  8346.             _loc3.firstChild.attributes.tid = classes.TestDriveCar.invitationID;
  8347.             _loc3.firstChild.attributes.rh = h;
  8348.             _loc3.firstChild.attributes.p = m;
  8349.             _loc3.firstChild.attributes.pp = p;
  8350.             _global.garageXML.firstChild.appendChild(_loc3.firstChild);
  8351.             displayAlert("success", "Test Drive Accepted", "Your test drive car is in your garage and you have " + h + " hours left in your test drive.");
  8352.             break;
  8353.         }
  8354.         case -1:
  8355.         {
  8356.             displayAlert("warning", "Invalid", "Sorry, invalid test drive invitation.");
  8357.             break;
  8358.         }
  8359.         case -2:
  8360.         {
  8361.             displayAlert("warning", "Error Loading", "Sorry, unable to load test drive invitation.");
  8362.             break;
  8363.         }
  8364.         case -3:
  8365.         {
  8366.             displayAlert("warning", "Error", "Sorry, there was error giving you the car.");
  8367.             break;
  8368.         }
  8369.         case -4:
  8370.         {
  8371.             displayAlert("warning", "Error", "Sorry, unable to accept test drive.");
  8372.             break;
  8373.         }
  8374.         case -5:
  8375.         {
  8376.             displayAlert("warning", "Error", "Sorry, unable to load test drive car details");
  8377.             break;
  8378.         }
  8379.         case -6:
  8380.         {
  8381.             displayAlert("warning", "Error", "Sorry, unable to load test drive car");
  8382.             break;
  8383.         }
  8384.         case -50:
  8385.         {
  8386.             displayAlert("warning", "Account Locked", "Sorry, your account is locked");
  8387.             break;
  8388.         }
  8389.     } // End of switch
  8390. } // End of the function
  8391. function buyTestDriveCar(paymentType)
  8392. {
  8393.     var _loc2 = classes.GlobalData.getTestDriveCarXML();
  8394.     var _loc1 = new LoadVars();
  8395.     _loc1.tid = Number(_loc2.attributes.tid);
  8396.     _loc1.pt = paymentType;
  8397.     _loc1.cid = Number(_loc2.attributes.ci);
  8398.     classes.Frame.serverLights(true);
  8399.     getURL("lingo: executeCall \"buytestdrivecar\", \"" + _loc1.toString() + "\"", "");
  8400. } // End of the function
  8401. function buyTestDriveCarCB(s, m)
  8402. {
  8403.     classes.Frame.serverLights(false);
  8404.     if (s <= 0)
  8405.     {
  8406.         _root.abc.thumb.dispose();
  8407.         _root.abc.closeMe();
  8408.     } // end if
  8409.     if (s == 1 || s == 2)
  8410.     {
  8411.         var _loc3 = classes.GlobalData.getTestDriveCarXML();
  8412.         _loc3.attributes.td = 0;
  8413.         _loc3.attributes.tdex = 0;
  8414.         _root.updateDefaultCar(_loc3.attributes.i);
  8415.     } // end if
  8416.     if (s == 1)
  8417.     {
  8418.         classes.GlobalData.updateInfo("p", String(m));
  8419.     }
  8420.     else if (s == 2)
  8421.     {
  8422.         classes.GlobalData.updateInfo("m", String(m));
  8423.     } // end else if
  8424.     _root.introHolder.buyTestDriveCarCB_Intro(s);
  8425. } // End of the function
  8426. function removeTestDriveCar()
  8427. {
  8428.     var _loc2 = classes.GlobalData.getTestDriveCarXML();
  8429.     var _loc1 = new LoadVars();
  8430.     _loc1.tid = Number(_loc2.attributes.tid);
  8431.     classes.Frame.serverLights(true);
  8432.     getURL("lingo: executeCall \"removetestdrivecar\", \"" + _loc1.toString() + "\"", "");
  8433. } // End of the function
  8434. function removeTestDriveCarCB(s)
  8435. {
  8436.     classes.Frame.serverLights(false);
  8437.     if (s == 1)
  8438.     {
  8439.         var _loc2 = classes.GlobalData.getTestDriveCarXML();
  8440.         classes.GlobalData.removeCar(Number(_loc2.attributes.i));
  8441.     } // end if
  8442.     _root.introHolder.removeTestDriveCarCB_Intro(s);
  8443. } // End of the function
  8444. function rejectTestDrive()
  8445. {
  8446.     var _loc1 = new LoadVars();
  8447.     _loc1.tid = Number(classes.TestDriveCar.invitationID);
  8448.     classes.Frame.serverLights(true);
  8449.     getURL("lingo: executeCall \"rejecttestdrive\", \"" + _loc1.toString() + "\"", "");
  8450. } // End of the function
  8451. function rejectTestDriveCB(s)
  8452. {
  8453.     classes.Frame.serverLights(false);
  8454.     switch (s)
  8455.     {
  8456.         case 1:
  8457.         {
  8458.             break;
  8459.         }
  8460.         case -1:
  8461.         {
  8462.             displayAlert("warning", "Failed", "Sorry, there was a db error.");
  8463.             break;
  8464.         }
  8465.     } // End of switch
  8466. } // End of the function
  8467. function joinSpecialEvent(eid, tid)
  8468. {
  8469.     classes.Frame.serverLights(true);
  8470.     var _loc2 = new LoadVars();
  8471.     _loc2.eid = eid;
  8472.     _loc2.tid = tid;
  8473.     _global.specialEvent.teamID = tid;
  8474.     getURL("lingo: executeCall \"joinspecialevent\", \"" + _loc2.toString() + "\"", "");
  8475. } // End of the function
  8476. function joinSpecialEventCB(s, m)
  8477. {
  8478.     classes.Frame.serverLights(false);
  8479.     _root.introHolder.joinSpecialEventCB_Intro(s, m, _global.specialEvent.teamID);
  8480. } // End of the function
  8481. function getLatestNews(count)
  8482. {
  8483.     classes.Frame.serverLights(true);
  8484.     getURL("lingo: executeCall \"getnews\", \"nc=" + count + "\"", "");
  8485. } // End of the function
  8486. function getLatestNewsCB(s, d)
  8487. {
  8488.     classes.Frame.serverLights(false);
  8489.     d = unescape(d);
  8490.     var _loc3 = new XML(d);
  8491.     if (s == 1)
  8492.     {
  8493.         classes.Lookup.runCallback("getLatestNews", "", _loc3);
  8494.     }
  8495.     else
  8496.     {
  8497.         _root.displayAlert("warning", "Error", "Error retrieving news.");
  8498.     } // end else if
  8499. } // End of the function
  8500. function getRacerSpotlight(count)
  8501. {
  8502.     classes.Frame.serverLights(true);
  8503.     getURL("lingo: executeCall \"getspotlightracers\", \"rc=" + count + "\"", "");
  8504. } // End of the function
  8505. function getRacerSpotlightCB(s, d)
  8506. {
  8507.     classes.Frame.serverLights(false);
  8508.     d = unescape(d);
  8509.     var _loc3 = new XML(d);
  8510.     if (s == 1)
  8511.     {
  8512.         classes.Lookup.runCallback("getRacerSpotlight", "", _loc3);
  8513.     }
  8514.     else
  8515.     {
  8516.         _root.displayAlert("warning", "Error", "Error retrieving racers.");
  8517.     } // end else if
  8518. } // End of the function
  8519. function linkHandler(param)
  8520. {
  8521.     _root.openURL(param);
  8522. } // End of the function
  8523. function genericWebCB(command, s, d)
  8524. {
  8525.     _root.imp.genericWebCB(command, s, d);
  8526. } // End of the function
  8527. function getPromoObjects()
  8528. {
  8529.     var _loc4 = new Array();
  8530.     for (var _loc3 = 0; _loc3 < _global.bannersXML.firstChild.childNodes.length; ++_loc3)
  8531.     {
  8532.         var _loc2 = new Object();
  8533.         _loc2.position = _global.bannersXML.firstChild.childNodes[_loc3].attributes.p;
  8534.         _loc2.linkType = _global.bannersXML.firstChild.childNodes[_loc3].attributes.t;
  8535.         _loc2.imageFile = _global.bannersXML.firstChild.childNodes[_loc3].attributes.i;
  8536.         _loc2.clickLink = _global.bannersXML.firstChild.childNodes[_loc3].attributes.l;
  8537.         if (Number(_loc2.linkType) == 2)
  8538.         {
  8539.             _loc2.locationID = classes.Lookup.carLocation(Number(_loc2.clickLink));
  8540.         } // end if
  8541.         _loc4[_loc3] = _loc2;
  8542.     } // end of for
  8543.     return (_loc4);
  8544. } // End of the function
  8545. function genericWebCB(command, s, d)
  8546. {
  8547.     _root.imp.genericWebCB(command, s, d);
  8548. } // End of the function
  8549. function displayAlert(alertIcon, alertTitle, alertMessage)
  8550. {
  8551.     _root.abc.closeMe();
  8552.     _root.alertMC.closeMe();
  8553.     var _loc3 = (classes.AlertBox)(this.attachMovie("alertBox", "alertMC", this.getNextHighestDepth()));
  8554.     _loc3.setValue(alertTitle, alertMessage, alertIcon);
  8555.     _loc3.addButton("OK");
  8556. } // End of the function
  8557. function displayMembershipAlert(alertIcon, alertTitle, alertMessage)
  8558. {
  8559.     _root.abc.closeMe();
  8560.     _root.alertMC.closeMe();
  8561.     var _loc3 = (classes.MembershipAlertBox)(this.attachMovie("membershipAlertBox", "alertMC", this.getNextHighestDepth()));
  8562.     _loc3.setValue(alertTitle, alertMessage, alertIcon);
  8563.     _loc3.addButton("OK");
  8564. } // End of the function
  8565. function displayDailyAward()
  8566. {
  8567.     _root.abc.closeMe();
  8568.     _root.alertMC.closeMe();
  8569.     var _loc6 = (classes.AlertBox)(this.attachMovie("alertBox", "alertMC", this.getNextHighestDepth()));
  8570.     var _loc7 = "";
  8571.     var _loc9 = "";
  8572.     var _loc4 = "";
  8573.     if (classes.GlobalData.dailyAwardType == 1)
  8574.     {
  8575.         _loc7 = "$";
  8576.         _loc4 = "funds";
  8577.     }
  8578.     else
  8579.     {
  8580.         _loc9 = "points";
  8581.         _loc4 = "success";
  8582.     } // end else if
  8583.     var _loc10 = "You received a daily reward of " + _loc7 + classes.NumFuncs.commaFormat(classes.GlobalData.dailyAwardAmount) + " " + _loc9;
  8584.     _loc6.setValue("Daily Reward!", _loc10, _loc4);
  8585.     _loc6.addButton("OK");
  8586.     var _loc5 = new Object();
  8587.     _loc5.owner = this;
  8588.     _loc5.onRelease = function (theButton, keepBoxOpen)
  8589.     {
  8590.         switch (theButton.btnLabel.text)
  8591.         {
  8592.             case "OK":
  8593.             {
  8594.                 var _loc3 = Number(_global.broadcastXML.firstChild.firstChild.attributes.i);
  8595.                 if (!classes.GlobalData.prefsObj.broadcastRead || classes.GlobalData.prefsObj.broadcastRead < _loc3)
  8596.                 {
  8597.                     _root.abc.closeMe();
  8598.                     _root.attachMovie("dialogContainer", "abc", _root.getNextHighestDepth(), {contentName: "dialogBroadcastContent", msg: _global.broadcastXML.firstChild.firstChild.attributes.m});
  8599.                     classes.GlobalData.prefsObj.broadcastRead = _loc3;
  8600.                     classes.GlobalData.savePrefsObj();
  8601.                 }
  8602.                 else if (_root.displaySpecialEventDialogIfNecessary())
  8603.                 {
  8604.                 }
  8605.                 else
  8606.                 {
  8607.                     _root.displayTestDriveExpiredIfNecessary();
  8608.                 } // end else if
  8609.                 break;
  8610.             }
  8611.         } // End of switch
  8612.     };
  8613.     _root.alertMC.addListener(_loc5);
  8614. } // End of the function
  8615. function displayTestDriveExpiredIfNecessary()
  8616. {
  8617.     var _loc3 = false;
  8618.     var _loc2 = classes.GlobalData.getTestDriveCarXML();
  8619.     var _loc4 = Number(_loc2.attributes.rh);
  8620.     if (_loc2 && (classes.GlobalData.testDriveCarExpired || _loc4 <= 1))
  8621.     {
  8622.         _loc3 = true;
  8623.         _root.abc.closeMe();
  8624.         _root.attachMovie("dialogContainer", "abc", _root.getNextHighestDepth(), {contentName: "dialogTestDriveExpiredContent"});
  8625.     } // end if
  8626.     return (_loc3);
  8627. } // End of the function
  8628. function displayTestDriveExpiredIfNecessaryNotLogin()
  8629. {
  8630.     var _loc3 = false;
  8631.     var _loc4 = classes.GlobalData.getTestDriveCarXML();
  8632.     _global.introData.testDriveCarXML = _loc4;
  8633.     _root.introHolder.displayTestDriveExpired(_global.introData);
  8634.     return (_loc3);
  8635. } // End of the function
  8636. function displayTestDriveExpiredWarning()
  8637. {
  8638.     _root.displayAlert("warning", "Test Drive Car", "Your test drive with this car has expired.");
  8639. } // End of the function
  8640. function displayTestDriveExpiredWarningIfNecessary()
  8641. {
  8642.     var _loc2 = false;
  8643.     if (Number(_parent.selCarXML.attributes.td) && Number(_parent.selCarXML.attributes.tdex))
  8644.     {
  8645.         _loc2 = true;
  8646.         displayTestDriveExpiredWarning();
  8647.     } // end if
  8648.     return (_loc2);
  8649. } // End of the function
  8650. function markTestDriveExpiredAndDisplayWarning()
  8651. {
  8652.     classes.GlobalData.makeTestDriveCarExpired();
  8653.     displayTestDriveExpiredWarning();
  8654. } // End of the function
  8655. function displaySpecialEventDialogIfNecessary()
  8656. {
  8657.     var _loc2 = false;
  8658.     if (_global.specialEvent.currentEvent == true && _global.specialEvent.teamID == -1)
  8659.     {
  8660.         _loc2 = true;
  8661.         displaySpecialEventDialog();
  8662.     } // end if
  8663.     return (_loc2);
  8664. } // End of the function
  8665. function displaySpecialEventDialog()
  8666. {
  8667.     _root.abc.closeMe();
  8668.     _root.eventHolder._visible = true;
  8669.     _root.eventHolder._x = 186.500000;
  8670.     _root.eventHolder._y = 107;
  8671.     _root.attachMovie("dialogContainer", "abc", _root.getNextHighestDepth(), {contentName: "dialogSpecialEvent"});
  8672. } // End of the function
  8673. function showBroadcastCB(msg)
  8674. {
  8675.     classes.Frame._MC.overlay.systemMsg.txtTitle = "Message From System Admin";
  8676.     classes.Frame._MC.overlay.systemMsg.txtMsg = msg;
  8677.     classes.Frame._MC.overlay.systemMsg._visible = true;
  8678. } // End of the function
  8679. function showConnectionErrorCB(msgTitle, msg)
  8680. {
  8681.     classes.Frame.serverLights(false);
  8682.     displayAlert("warning", msgTitle, msg);
  8683. } // End of the function
  8684. function showDisconnectedErrorCB(msgTitle, msg)
  8685. {
  8686.     classes.Frame.serverLights(false);
  8687.     _root.abc.closeMe();
  8688.     var _loc3 = (classes.AlertBox)(_root.attachMovie("alertBox", "abc", _root.getNextHighestDepth()));
  8689.     _loc3.setValue(msgTitle, msg, "warning");
  8690.     _loc3.addButton("OK");
  8691.     _loc3.onOK = function ()
  8692.     {
  8693.         getURL("lingo: CLOSEGAME");
  8694.     };
  8695.     var _loc4 = new Object();
  8696.     _loc4.onRelease = function (theButton)
  8697.     {
  8698.         if (theButton.btnLabel.text == "OK")
  8699.         {
  8700.             theButton._parent._parent.onOK();
  8701.         } // end if
  8702.         false;
  8703.     };
  8704.     _root.abc.addListener(_loc4);
  8705. } // End of the function
  8706. function openFile(fileName)
  8707. {
  8708.     getURL("lingo: openFile \"" + fileName + "\"", "");
  8709. } // End of the function
  8710. function openFileCB(s, fileName, textValue)
  8711. {
  8712.     if (fileName == "cache/cd.txt")
  8713.     {
  8714.         if (s)
  8715.         {
  8716.             var _loc4 = new XML(textValue);
  8717.             _root.fromcd = _loc4.firstChild.attributes.id;
  8718.         } // end if
  8719.         _root.getStarterShowroom();
  8720.     }
  8721.     else
  8722.     {
  8723.         if (s)
  8724.         {
  8725.             classes.GlobalData.prefsXML = new XML(textValue);
  8726.         } // end if
  8727.         classes.GlobalData.setPrefsObj();
  8728.         _root.gotoAndPlay("doneLoadPrefs");
  8729.     } // end else if
  8730. } // End of the function
  8731. function saveFile(fileName, textValue)
  8732. {
  8733.     getURL("lingo: saveFile \"" + fileName + "\", \"" + escape(textValue) + "\"", "");
  8734. } // End of the function
  8735. function saveFileCB(s, fileName)
  8736. {
  8737. } // End of the function
  8738. function openBanURL(accountID)
  8739. {
  8740.     var _loc1 = "http://admin.nittolegends.com/";
  8741.     if (classes.GlobalData.prefsObj.dev)
  8742.     {
  8743.         _loc1 = "http://adminstaging.nittolegends.com/";
  8744.     } // end if
  8745.     _loc1 = _loc1 + ("userInfo.aspx?aid=" + accountID);
  8746.     openURL(_loc1);
  8747. } // End of the function
  8748. function openReportsURL(accountID)
  8749. {
  8750.     var _loc1 = "http://admin.nittolegends.com/";
  8751.     if (classes.GlobalData.prefsObj.dev)
  8752.     {
  8753.         _loc1 = "http://adminstaging.nittolegends.com/";
  8754.     } // end if
  8755.     _loc1 = _loc1 + ("userInfo.aspx?aid=" + accountID);
  8756.     openURL(_loc1);
  8757. } // End of the function
  8758. function openPointsURL()
  8759. {
  8760.     openURL("http://www.nittolegends.com/1320Shop_points.aspx");
  8761. } // End of the function
  8762. function openMembershipURL()
  8763. {
  8764.     openURL("http://www.nittolegends.com/1320Shop_default.aspx");
  8765. } // End of the function
  8766. function openURL(url)
  8767. {
  8768.     getURL("lingo: openURL \"" + escape(url) + "\"", "");
  8769. } // End of the function
  8770. function openTestDriveFAQURL()
  8771. {
  8772.     openURL("http://www.nittolegends.com/support_testdrive.aspx");
  8773. } // End of the function
  8774. function fileBrowse(id)
  8775. {
  8776.     getURL("lingo: fileBrowse \"" + id + "\"", "");
  8777. } // End of the function
  8778. function fileBrowseCB(id, path, filesize)
  8779. {
  8780.     var _loc1 = new Object();
  8781.     _loc1.path = path;
  8782.     _loc1.filesize = filesize;
  8783.     classes.Lookup.runCallback("fileBrowse", id, _loc1);
  8784. } // End of the function
  8785. function fileParseCB(filedata, temp)
  8786. {
  8787.     classes.Lookup.runCallback("fileParse", "", filedata + "\r\n" + temp);
  8788. } // End of the function
  8789. function fileClearAllDecals()
  8790. {
  8791.     getURL("lingo: fileClearAllDecals");
  8792. } // End of the function
  8793. function fileClearADecal(pcid, did)
  8794. {
  8795.     getURL("lingo: fileClearADecal " + pcid + ", " + did, "");
  8796. } // End of the function
  8797. function newTutorialObj(_context, arrContent, useBGOverlay, overlayWidth, overlayHeight)
  8798. {
  8799.     tutorialObj = new classes.util.Tutorial(_context, arrContent, useBGOverlay, overlayWidth, overlayHeight);
  8800. } // End of the function
  8801. function clearTutorialObj()
  8802. {
  8803.     tutorialObj.destroy();
  8804. } // End of the function
  8805. function linkHandler(param)
  8806. {
  8807.     _root.openURL(param);
  8808. } // End of the function
  8809. function getOneCarEngineCB(d)
  8810. {
  8811.     var _loc1 = new XML();
  8812.     _loc1.ignoreWhite = true;
  8813.     _loc1.parseXML(d);
  8814.     classes.GlobalData.engineSound = _loc1.firstChild.attributes.es;
  8815.     classes.GlobalData.shiftLightGaugeRPM = _loc1.firstChild.attributes.sl;
  8816.     classes.GlobalData.hasShiftLightGauge = false;
  8817.     if (Number(_loc1.firstChild.attributes.sg) == 1)
  8818.     {
  8819.         classes.GlobalData.hasShiftLightGauge = true;
  8820.     } // end if
  8821.     classes.GlobalData.raceControlsID = _loc1.firstChild.attributes.rc;
  8822. } // End of the function
  8823. function CheckNittoProcesses()
  8824. {
  8825.     getURL("lingo: CheckNittoProcesses");
  8826. } // End of the function
  8827. function CheckNittoProcessesCB(s)
  8828. {
  8829.     if (s > 0)
  8830.     {
  8831.         var _loc4;
  8832.         var _loc6;
  8833.         if (s == 1)
  8834.         {
  8835.             _loc4 = "Already Running";
  8836.             _loc6 = "Only one instance of Nitto 1320 Legends is allowed to be run at a time";
  8837.         }
  8838.         else
  8839.         {
  8840.             _loc4 = "Wrong Name";
  8841.             _loc6 = "The Nitto 1320 Legends application needs to be named NittoLegendsBeta.exe to run";
  8842.         } // end else if
  8843.         _root.abc.closeMe();
  8844.         var _loc3 = (classes.AlertBox)(_root.attachMovie("alertBox", "abc", _root.getNextHighestDepth()));
  8845.         _loc3.setValue(_loc4, _loc6, "warning");
  8846.         _loc3.addButton("OK");
  8847.         _loc3.onOK = function ()
  8848.         {
  8849.             getURL("lingo: CLOSEGAME");
  8850.         };
  8851.         var _loc5 = new Object();
  8852.         _loc5.onRelease = function (theButton)
  8853.         {
  8854.             if (theButton.btnLabel.text == "OK")
  8855.             {
  8856.                 theButton._parent._parent.onOK();
  8857.             } // end if
  8858.             false;
  8859.         };
  8860.         _root.abc.addListener(_loc5);
  8861.     }
  8862.     else
  8863.     {
  8864.         _root.openFile("prefs.txt");
  8865.     } // end else if
  8866. } // End of the function
  8867. function saveBroadcastRead(broadcastNum)
  8868. {
  8869.     classes.GlobalData.prefsObj.broadcastRead = broadcastNum;
  8870.     classes.GlobalData.savePrefsObj();
  8871. } // End of the function
  8872. function setSpecialEventTeamID(id)
  8873. {
  8874.     _global.specialEvent.teamID = id;
  8875. } // End of the function
  8876. _global.mainURL = _root.mainURL = "http://game.nittolegends.com/";
  8877. _global.uggURL = "http://ugg.nittolegends.com/";
  8878. _global.devURL = "http://gamestaging.nittolegends.com/";
  8879. _global.storeLinkURL = "http://www.nittolegends.com/1320Shop_points.aspx";
  8880. _global.assetPath = "cache";
  8881. System.security.allowDomain("game.nittolegends.com");
  8882. System.security.allowDomain("gamestaging.nittolegends.com");
  8883. _global.n2CSS = new TextField.StyleSheet();
  8884. _global.n2CSS.load(_global.mainURL + "gameStyles.css");
  8885. _global.newsCSS = new TextField.StyleSheet();
  8886. _global.newsCSS.load(_global.mainURL + "newsStyles.css");
  8887. var isInAChat = false;
  8888. var raceMovie;
  8889. var raceTreeMovie;
  8890. var raceSound;
  8891. var teamRinp_lookupCarIds;
  8892. var repairPartMC;
  8893. var aryAvatar = new Array();
  8894. var isTimeoutSet = false;
  8895. var garageDynoMC;
  8896. stop ();
  8897. _root.CheckNittoProcesses();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement