Advertisement
dcomicboy

Nitto Lingo Functions update

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