Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1568 lines
40 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Microsoft Out-of-Box Experience</TITLE>
  4. <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <script language=jscript>
  6. // This is intended to hold all the script needed
  7. // in the default & offline OOBE HTML pages.
  8. //
  9. // We want to separate the layout (HTML) from the script.
  10. // At the same time, it's helpful to have all the code
  11. // in one place to make it easier to understand the flow
  12. // from page to page.
  13. // Checkpoint constants
  14. var CKPT_START = 1;
  15. var CKPT_TAPI = 2;
  16. var CKPT_DIALING = 3;
  17. var CKPT_DIALTONE = 4;
  18. var CKPT_MSNINTRO = 6;
  19. var CKPT_WINMSNEULA = 7;
  20. var CKPT_IAASSIGNED = 8;
  21. var CKPT_PASSPORT = 9;
  22. var CKPT_PIDKEY = 10;
  23. var CKPT_MSNPORTAL = 12;
  24. var CKPT_MODEMCANCEL = 13;
  25. var CKPT_MOUSE = 14;
  26. var CKPT_REGKB = 15;
  27. var CKPT_OEMHW = 16;
  28. var CKPT_USERINFO = 17;
  29. var CKPT_EULA = 18;
  30. var CKPT_PID = 19;
  31. var CKPT_OEMISP1 = 20;
  32. var CKPT_OEMISP2 = 21;
  33. var CKPT_OEMISP3 = 22;
  34. var CKPT_CONGRATS = 23;
  35. var CKPT_CONNECT = 24;
  36. var CKPT_OEMREG = 25;
  37. var CKPT_INSTALLED = 26;
  38. var CKPT_ERROR = 27;
  39. var CKPT_REGKBCOMMIT = 28;
  40. var CKPT_BADPID = 29;
  41. var CKPT_MSNINFO = 30;
  42. var CKPT_MSNIDPASS = 31;
  43. var CKPT_MSNCONSET = 32;
  44. var CKPT_MSNPAYMENT = 33;
  45. var CKPT_PRIVACYGUARANTEE = 34;
  46. var CKPT_PASSSIGN = 35;
  47. var CKPT_REGISTER = 36;
  48. // CheckDialReady errors
  49. var ERR_COMM_NO_ERROR = 0;
  50. var ERR_COMM_OOBE_COMP_MISSING = 1;
  51. var ERR_COMM_UNKNOWN = 2;
  52. var ERR_COMM_NOMODEM = 3;
  53. var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
  54. // Dialing errors
  55. var DERR_DIALTONE = -1;
  56. var DERR_BUSY = -2;
  57. var DERR_SERVERBUSY = -3;
  58. // Various objects
  59. var TapiObj = null;
  60. var InfoObj = null;
  61. var EulaObj = null;
  62. var LangObj = null;
  63. var PidObj = null;
  64. var StatusObj = null;
  65. var DirObj = null;
  66. // References to objects on msoobeMain
  67. var g = null;
  68. // global string
  69. var g_strPrefix = "";
  70. // Mandatory Initialization Code
  71. if (StatusObj == null)
  72. {
  73. StatusObj = new Object;
  74. StatusObj = window.external.Status;
  75. }
  76. if (DirObj == null)
  77. {
  78. DirObj = new Object;
  79. DirObj = window.external.Directions;
  80. }
  81. if (InfoObj == null)
  82. {
  83. InfoObj = new Object;
  84. InfoObj = window.external.UserInfo;
  85. }
  86. // END Initialization Code
  87. // start.htm
  88. function Start_OnKeyPress()
  89. {
  90. // Treat the enter key like the next button
  91. // since the user hasn't gone through the mouse tutorial yet.
  92. if ((g.event.keyCode == 13) &&
  93. (g.btnNext.disabled == false))
  94. {
  95. GoNext(CKPT_START);
  96. }
  97. }
  98. // Function: Start_LoadMe
  99. // Description: This function is called after start.htm is
  100. // loaded. we then initialize Items on the page.
  101. // we also populate the edits with any values already
  102. // found in the registry.
  103. //
  104. function Start_LoadMe()
  105. {
  106. InitGlobals();
  107. // disable the next button until any field has a value.
  108. g.btnNext.disabled = true;
  109. InfoObj = new Object;
  110. InfoObj = window.external.UserInfo;
  111. g.edt_FirstName.value = InfoObj.get_FirstName();
  112. g.edt_MiddleName.value = InfoObj.get_MiddleInitial();
  113. g.edt_LastName.value = InfoObj.get_LastName();
  114. // set focus on the first edit field.
  115. g.edt_FirstName.focus();
  116. Start_CheckEnableNextButton();
  117. InitButtons();
  118. }
  119. // Function: Start_CheckEdits
  120. // Description: This function is called everytime an OnClick
  121. // event fires on the page. This is done so if the user
  122. // loses focus from one of the edits we can push them
  123. // in the right direction and hint them along the way
  124. // Or if all elements are filled then we enabled
  125. // the next button or if any value is 0 then we
  126. // disable the next button
  127. //
  128. function Start_CheckEdits()
  129. {
  130. if ((g.event.srcElement != g.edt_FirstName) &&
  131. (g.event.srcElement != g.edt_MiddleName) &&
  132. (g.event.srcElement != g.edt_LastName))
  133. {
  134. Start_CheckEnableNextButton();
  135. }
  136. }
  137. // Function: Start_CheckEnableNextButton
  138. // Description: This function is called everytime a keyup
  139. // event fires on a edit box for first, middle, or last
  140. // name. We then see if we should enable or disable the
  141. // next button based on if every field has a value.
  142. //
  143. function Start_CheckEnableNextButton()
  144. {
  145. if ((g.edt_FirstName.value.length != 0) ||
  146. (g.edt_MiddleName.value.length != 0) ||
  147. (g.edt_LastName.value.length != 0))
  148. {
  149. g.btnNext.disabled = false;
  150. InitButtons();
  151. }
  152. else
  153. {
  154. g.btnNext.disabled = true;
  155. InitButtons();
  156. }
  157. }
  158. // END start.htm
  159. // tapi.htm
  160. function TapiLoadMe()
  161. {
  162. InitGlobals();
  163. TapiObj = new Object;
  164. TapiObj = window.external.Tapi;
  165. InitButtons();
  166. RetrieveTapi();
  167. }
  168. function StoreTapi()
  169. {
  170. TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
  171. // TapiObj.set_AreaCode = g.edtAreaCode.value;
  172. TapiObj.set_PhoneSystem = radioTouchTone.value ? 1 : 0;
  173. // TapiObj.set_CallWaiting = g.edtCallWaiting.value;
  174. TapiObj.set_DialOut = g.edtOutsideLine.value;
  175. }
  176. function RetrieveTapi()
  177. {
  178. var fTapi = TapiObj.IsTAPIConfigured;
  179. var ilen = TapiObj.get_NumOfCountry;
  180. for (var i = 0; i < ilen; i++)
  181. {
  182. var oOption = g.document.createElement("OPTION");
  183. oOption.text = TapiObj.get_CountryNameForIndex(i);
  184. g.selCountry.add(oOption);
  185. }
  186. g.selCountry.selectedIndex = TapiObj.get_CountryIndex;
  187. //g.edtAreaCode.value = TapiObj.get_AreaCode;
  188. radioTouchTone.value = TapiObj.get_PhoneSystem ? true : false;
  189. g.edtCallWaiting.value = //(TapiObj.get_CallWaiting == "") ? TapiObj.get_CallWaiting :
  190. "*70";
  191. g.edtOutsideLine.value = TapiObj.get_DialOut;
  192. }
  193. function tapi_CallWaitingClicked()
  194. {
  195. if (radioCallWaiting[0].checked == true)
  196. {
  197. spanCallWaitingDisable.style.visibility = "visible";
  198. }
  199. else
  200. {
  201. spanCallWaitingDisable.style.visibility = "hidden";
  202. }
  203. }
  204. function tapi_OutsideLineClicked()
  205. {
  206. if (radioOutsideLine[0].checked == true)
  207. {
  208. spanOutsideLine.style.visibility = "visible";
  209. }
  210. else
  211. {
  212. spanOutsideLine.style.visibility = "hidden";
  213. }
  214. }
  215. // END tapi.htm
  216. // connect.htm
  217. function connect_LoadMe()
  218. {
  219. InitGlobals();
  220. InitButtons();
  221. setTimeout("DoDial()" , 40);
  222. }
  223. function DoDial()
  224. {
  225. g.spnDialing.style.color = 0x990000;
  226. g.spnConnecting.style.color = 0x999999;
  227. g.spnConnected.style.color = 0x999999;
  228. window.external.Dial("msobe.idp");
  229. }
  230. <!--REQUIRED FUNCTION PROTOTYPE :: DO NOT ALTER-->
  231. function OnDialing()
  232. {
  233. //"Dialing"
  234. }
  235. <!--REQUIRED FUNCTION PROTOTYPE :: DO NOT ALTER-->
  236. function OnConnecting()
  237. {
  238. //"Connecting"
  239. g.spnDialing.style.color = 0x999999;
  240. g.spnConnecting.style.color = 0x990000;
  241. g.spnConnected.style.color = 0x999999;
  242. }
  243. <!--REQUIRED FUNCTION PROTOTYPE :: DO NOT ALTER-->
  244. function OnDownloading()
  245. {
  246. //"Downloading"
  247. g.spnDialing.style.color = 0x999999;
  248. g.spnConnecting.style.color = 0x999999;
  249. g.spnConnected.style.color = 0x990000;
  250. }
  251. <!--REQUIRED FUNCTION PROTOTYPE :: DO NOT ALTER-->
  252. function OnDisconnect()
  253. {
  254. //"Disconnected"
  255. ;
  256. }
  257. <!--REQUIRED FUNCTION PROTOTYPE :: DO NOT ALTER-->
  258. function OnDialingError(derr)
  259. {
  260. //"dial error"
  261. window.external.Hangup();
  262. switch (derr)
  263. {
  264. case DERR_DIALTONE:
  265. g.navigate("error.htm");
  266. break;
  267. case DERR_BUSY:
  268. break;
  269. case DERR_SERVERBUSY:
  270. break;
  271. }
  272. }
  273. // END dial.htm
  274. // userinfo.htm
  275. function UserInfoLoadMe()
  276. {
  277. RetrieveUserInfo();
  278. }
  279. function StoreUserInfo()
  280. {
  281. InfoObj.set_FirstName = g.edt_FirstName.value;
  282. InfoObj.set_MiddleInitial = g.edt_MiddleInitial.value;
  283. InfoObj.set_LastName = g.edt_LastName.value;
  284. InfoObj.set_CompanyName = g.edt_CompanyName.value;
  285. InfoObj.set_Address = g.txt_Address.value;
  286. InfoObj.set_City = g.edt_City.value;
  287. InfoObj.set_State = g.sel_State.value;
  288. InfoObj.set_Zip = g.edt_Zip.value;
  289. InfoObj.set_PrimaryEmail = g.edt_PrimaryEmail.value;
  290. InfoObj.set_SecondaryEmail = g.edt_SecondaryEmail.value;
  291. InfoObj.set_AreaCode = g.edt_AreaCode.value;
  292. InfoObj.set_Prefix = g.edt_Prefix.value;
  293. InfoObj.set_Number = g.edt_Number.value;
  294. }
  295. function RetrieveUserInfo()
  296. {
  297. g.edt_FirstName.value = InfoObj.get_FirstName;
  298. g.edt_MiddleInitial.value = InfoObj.get_MiddleInitial;
  299. g.edt_LastName.value = InfoObj.get_LastName;
  300. g.edt_CompanyName.value = InfoObj.get_CompanyName;
  301. g.txt_Address.value = InfoObj.get_Address;
  302. g.edt_City.value = InfoObj.get_City;
  303. g.sel_State.value = InfoObj.get_State;
  304. g.edt_Zip.value = InfoObj.get_Zip;
  305. g.edt_PrimaryEmail.value = InfoObj.get_PrimaryEmail;
  306. g.edt_SecondaryEmail.value = InfoObj.get_SecondaryEmail;
  307. g.edt_AreaCode.value = InfoObj.get_AreaCode;
  308. g.edt_Prefix.value = InfoObj.get_Prefix;
  309. g.edt_Number.value = InfoObj.get_Number;
  310. }
  311. // END userinfo.htm
  312. // eula.htm
  313. function EulaLoadMe()
  314. {
  315. InitGlobals();
  316. EulaObj = new Object;
  317. EulaObj = window.external.Eula;
  318. if (StatusObj.get_EULACompleted)
  319. {
  320. RetrieveEula();
  321. }
  322. else
  323. {
  324. g.btnNext.disabled = true;
  325. }
  326. InitButtons();
  327. }
  328. function EulaRadioClicked(fAccept)
  329. {
  330. g.btnNext.disabled = false;
  331. g.btnNext.src = g_strPrefix + "images/rhtdef.gif";
  332. g.btnNextText.style.color = "black";
  333. StoreEula();
  334. }
  335. function StoreEula()
  336. {
  337. EulaObj.set_EULAAcceptance = (radioEULA(0).checked == true) ? true : false;
  338. }
  339. function RetrieveEula()
  340. {
  341. Agreement.value = EulaObj.get_EULAAcceptance;
  342. }
  343. // END eula.htm
  344. // regkbcmt.htm
  345. function RegKBCmt_LoadMe()
  346. {
  347. InitButtons();
  348. }
  349. // END regkbcmt.htm
  350. // regkb.htm
  351. function RegKBLoadMe()
  352. {
  353. InitGlobals();
  354. LangObj = new Object;
  355. LangObj = window.external.Language;
  356. InitButtons();
  357. RetrieveRegKB();
  358. }
  359. function StoreRegKB()
  360. {
  361. LangObj.set_RegionIndex = g.selRegion.selectedIndex;
  362. LangObj.get_KeyboardLayoutIndex = g.selKeyboard.selectedIndex;
  363. }
  364. function RetrieveRegKB()
  365. {
  366. var ilen = LangObj.get_NumOfRegions;
  367. for (var i = 0; i < ilen; i++)
  368. {
  369. var oOption = g.document.createElement("OPTION");
  370. oOption.text = LangObj.get_RegionName(i);
  371. g.selRegion.add(oOption);
  372. }
  373. g.selRegion.selectedIndex = LangObj.get_RegionIndex;
  374. ilen = LangObj.get_NumOfKeyboardLayouts;
  375. for (i = 0; i < ilen; i++)
  376. {
  377. var oOption = g.document.createElement("OPTION");
  378. oOption.text = LangObj.get_KeyboardLayoutName(i);
  379. g.selKeyboard.add(oOption);
  380. }
  381. g.selKeyboard.selectedIndex = LangObj.get_KeyboardLayoutIndex;
  382. }
  383. // END regkb.htm
  384. // badpid.htm
  385. function badpid_LoadMe()
  386. {
  387. InitGlobals();
  388. InitButtons();
  389. }
  390. // pid.htm
  391. function PID_LoadMe()
  392. {
  393. InitGlobals();
  394. PidObj = new Object;
  395. PidObj = window.external.ProductID;
  396. RetrievePid();
  397. g.btnNext.disabled = false;
  398. InitButtons();
  399. PID_CheckLength();
  400. }
  401. function PID_CheckLength()
  402. {
  403. var iLength = 0;
  404. for (iElement = 0; iElement < 5; iElement++)
  405. {
  406. iLength += g.edtProductKey[iElement].value.length;
  407. if (iLength < 5 * iElement)
  408. break;
  409. }
  410. if (iLength == 25)
  411. {
  412. g.btnNext.disabled = false;
  413. g.btnNext.src = g_strPrefix + "../images/rhtdef.gif";
  414. g.btnNextText.style.color= "black";
  415. }
  416. else
  417. {
  418. g.btnNext.disabled = true;
  419. g.btnNext.src = g_strPrefix + "../Images/rhtdsld.gif";
  420. g.btnNextText.style.color= "gray";
  421. }
  422. }
  423. function RetrievePid()
  424. {
  425. // retrieves the pid if avialable.
  426. var strPid = PidObj.get_PID();
  427. // if there is no PID then we set the
  428. // focus to the first field
  429. if (strPid.length == 0)
  430. {
  431. g.edtProductKey[0].focus();
  432. }
  433. // else we populate the fields with the
  434. // sections of the PID and then put the
  435. // focus onto the next button for validation.
  436. else
  437. {
  438. for(i = 0; i < 5; i++)
  439. {
  440. g.edtProductKey[i].value = strPid.substr(i * 5, 5);
  441. }
  442. g.btnNext.focus();
  443. }
  444. }
  445. function ValidatePid()
  446. {
  447. var strPid = "";
  448. for(i = 0; i < 5; i++)
  449. {
  450. strPid += g.edtProductKey[i].value;
  451. }
  452. return PidObj.ValidatePID(strPid);
  453. }
  454. function StorePid()
  455. {
  456. var strPid = "";
  457. for(i = 0; i < 5; i++)
  458. {
  459. strPid += g.edtProductKey[i].value;
  460. }
  461. PidObj.set_PID(strPid);
  462. StatusObj.set_PIDCompleted = true;
  463. }
  464. function ProductIDKeyPress()
  465. {
  466. // if the length is 5 then we want to move the focus
  467. // to the next field and also save the input to the
  468. // next field
  469. if (g.event.srcElement.value.length == 5)
  470. {
  471. // find the index at which we are.
  472. for (i = 0; i < 5; i++)
  473. {
  474. // find which index we are so we
  475. // know which one to move to next
  476. if (g.edtProductKey[i] == g.event.srcElement)
  477. {
  478. // if we are in the last field move to the next button
  479. // else move to the key code to the next field and don't
  480. // put the value into the current field
  481. if (i == 4)
  482. {
  483. g.btnNext.focus();
  484. }
  485. else
  486. {
  487. g.edtProductKey[i+1].value += String.fromCharCode(g.event.keyCode);
  488. }
  489. g.event.returnValue = false;
  490. break;
  491. }
  492. }
  493. }
  494. }
  495. function ProductIDKeyUp()
  496. {
  497. PID_CheckLength();
  498. // only need to do move forward
  499. // or backwards if length is 0 or 5
  500. if ((g.event.srcElement.value.length == 5) ||
  501. (g.event.srcElement.value.length == 0))
  502. {
  503. for (i = 0; i < 5; i++)
  504. {
  505. // find which index we are so we
  506. // know which one to move to next
  507. if (g.edtProductKey[i] == g.event.srcElement)
  508. {
  509. // if we maxed the length of the field then
  510. // move forward
  511. if (g.event.srcElement.value.length == 5)
  512. {
  513. // if we are in the last field move to the next button
  514. // else move to the next productID field
  515. if (i == 4)
  516. {
  517. g.btnNext.focus();
  518. }
  519. else
  520. {
  521. g.edtProductKey[i+1].focus();
  522. }
  523. }
  524. // if we have not data in the field
  525. // then we most have deleted the contents
  526. else // length = 0
  527. {
  528. // only need to move the focus if we
  529. // are not in the first field.
  530. if (i != 0)
  531. {
  532. g.edtProductKey[i-1].focus();
  533. }
  534. }
  535. break;
  536. }
  537. }
  538. }
  539. }
  540. // END pid.htm
  541. // error.htm
  542. function Error_LoadMe()
  543. {
  544. InitGlobals();
  545. InitButtons();
  546. }
  547. // END error.htm
  548. // ispsgnup.htm
  549. // END ispsgnup.htm
  550. // speedy2.htm
  551. // END speedy2.htm
  552. // speedy3.htm
  553. // END speedy3.htm
  554. // mouse.htm
  555. function mouse_LoadMe()
  556. {
  557. InitGlobals("../../");
  558. InitButtons();
  559. }
  560. // END mouse.htm
  561. // oemhw.htm
  562. function oemhw_LoadMe()
  563. {
  564. btnNext.disabled = true;
  565. InitButtons("../");
  566. }
  567. function oemhw_HearSoundClicked()
  568. {
  569. if (event.srcElement == radioHearSound[0])
  570. {
  571. radioHearSound[0].checked = true;
  572. radioHearSound[1].checked = false;
  573. btnNext.disabled = false;
  574. InitButtons();
  575. }
  576. else if (event.srcElement == radioHearSound[1])
  577. {
  578. radioHearSound[0].checked = false;
  579. radioHearSound[1].checked = true;
  580. btnNext.disabled = false;
  581. InitButtons();
  582. }
  583. }
  584. // END oemhw.htm
  585. // oemreg.htm
  586. function oemreg_LoadMe()
  587. {
  588. InitGlobals("../../");
  589. g.edt_FirstName.value = InfoObj.get_FirstName();
  590. g.edt_MiddleInitial.value = InfoObj.get_MiddleInitial();
  591. g.edt_LastName.value = InfoObjt.get_LastName();
  592. InitButtons();
  593. }
  594. // END oemreg.htm
  595. // oemlegal.htm
  596. function oemlegal_LoadMe()
  597. {
  598. InitGlobals("../../");
  599. InitButtons();
  600. }
  601. // END oemlegal.htm
  602. // oemadd.htm
  603. // END oemadd.htm
  604. // msneula.htm
  605. function msneula_LoadMe()
  606. {
  607. InitGlobals();
  608. g.btnNext.disabled = false;
  609. InitButtons();
  610. }
  611. // END msneula.htm
  612. // msnsign.htm
  613. function msnsign_LoadMe()
  614. {
  615. InitGlobals();
  616. InitButtons();
  617. }
  618. function msnsign_SignupWishClicked()
  619. {
  620. for (iElement = 0; iElement < 4; iElement++)
  621. {
  622. radioSignupWish[iElement].checked = false;
  623. }
  624. event.srcElement.checked = true;
  625. }
  626. // END msnsign.htm
  627. // msninfo.htm
  628. function msninfo_LoadMe()
  629. {
  630. InitGlobals();
  631. g.edt_FirstName.value = InfoObj.get_FirstName();
  632. g.edt_MiddleInitial.value = InfoObj.get_MiddleInitial();
  633. g.edt_LastName.value = InfoObj.get_LastName();
  634. btnNext.disabled = false;
  635. InitButtons();
  636. }
  637. // END msninfo.htm
  638. // msnidpss.htm
  639. function msnidpss_LoadMe()
  640. {
  641. InitGlobals();
  642. g.btnNext.disabled = false;
  643. InitButtons();
  644. }
  645. function msnidpss_NameSelectionClicked()
  646. {
  647. for (iElement = 0; iElement < 4; iElement++)
  648. {
  649. radioNameSelection[iElement].checked = false;
  650. }
  651. event.srcElement.checked = true;
  652. }
  653. // END msnidpss.htm
  654. // msnconset.htm
  655. function msnconset_LoadMe()
  656. {
  657. InitGlobals();
  658. InitButtons();
  659. }
  660. // END msnconset.htm
  661. // msnpymnt.htm
  662. function msnpymnt_LoadMe()
  663. {
  664. InitGlobals();
  665. g.btnNext.disabled = false;
  666. InitButtons();
  667. }
  668. // END msnpymnt.htm
  669. // passsign.htm
  670. function passsign_LoadMe()
  671. {
  672. InitGlobals();
  673. InitButtons();
  674. }
  675. function passsign_WantPassportClicked()
  676. {
  677. if (event.srcElement == radioWantPassport[0])
  678. {
  679. radioWantPassport[0].checked = true;
  680. radioWantPassport[1].checked = false;
  681. }
  682. else
  683. {
  684. radioWantPassport[0].checked = false;
  685. radioWantPassport[1].checked = true;
  686. }
  687. }
  688. // END passsign.htm
  689. // passact.htm
  690. // END passact.htm
  691. // passreg.htm
  692. function passreg_LoadMe()
  693. {
  694. InitGlobals();
  695. g.edt_FirstName.value = InfoObj.get_FirstName();
  696. g.edt_MiddleInitial.value = InfoObj.get_MiddleInitial();
  697. g.edt_LastName.value = InfoObj.get_LastName();
  698. InitButtons();
  699. }
  700. // END passreg.htm
  701. // register.htm
  702. function register_LoadMe()
  703. {
  704. InitGlobals();
  705. g.edt_FirstName.value = InfoObj.get_FirstName();
  706. g.edt_MiddleInitial.value = InfoObj.get_MiddleInitial();
  707. g.edt_LastName.value = InfoObj.get_LastName();
  708. InitButtons();
  709. }
  710. // END register.htm
  711. // congrats.htm
  712. function congrats_LoadMe()
  713. {
  714. InitGlobals();
  715. InitButtons();
  716. }
  717. function congrats_AccessInternetClicked()
  718. {
  719. if (event.srcElement == radioAccessInternet[0])
  720. {
  721. radioAccessInternet[0].checked = true;
  722. radioAccessInternet[1].checked = false;
  723. }
  724. else
  725. {
  726. radioAccessInternet[0].checked = false;
  727. radioAccessInternet[1].checked = true;
  728. }
  729. }
  730. // END congrats.htm
  731. // eulawarn.htm
  732. // END eulawarn.htm
  733. // installd.htm
  734. function installd_LoadMe()
  735. {
  736. InitGlobals();
  737. InitButtons();
  738. }
  739. // END installd.htm
  740. // usemodem.htm
  741. function usemodem_LoadMe()
  742. {
  743. InitGlobals();
  744. InitButtons();
  745. }
  746. // END usemodem.htm
  747. // MISC Functions
  748. // Function: DoOfflineOnlineModeFromStart
  749. // Description: picks which direction to go based
  750. // on OEM decision in OOBEWiz and if Modem Available
  751. // if either fail then we do offline navigation by
  752. // calling DoOffline.
  753. //
  754. function DoOfflineOnlineModeFromStart()
  755. {
  756. // online navigation if successful
  757. // else offline navigation
  758. // TODO: Needs to be dealt with
  759. if ( 1/*need to get OOBEwiz default-OnlineMode */ && window.external.CheckDialReady() == ERR_COMM_NO_ERROR)
  760. {
  761. g.navigate("tapi.htm");
  762. }
  763. else
  764. {
  765. g.navigate(".." + OfflineStart());
  766. }
  767. }
  768. // Function: OfflineStart
  769. // Description: We want to start offline mode.
  770. // Figure out which page to start at.
  771. //
  772. function OfflineStart()
  773. {
  774. if (!StatusObj.get_EULACompleted)
  775. {
  776. return "/setup/eula.htm";
  777. }
  778. else if (!StatusObj.get_PIDCompleted)
  779. {
  780. return "/setup/pid.htm";
  781. }
  782. else if (window.external.CheckDialReady == ERR_COMM_NOMODEM)
  783. {
  784. return "/setup/installd.htm";
  785. }
  786. else if (DirObj.get_ISPSignup.toUpperCase != "MSN")
  787. {
  788. return "/html/ispsgnup/ispsgnup.htm";
  789. }
  790. else if (StatusObj.get_ISPSignupCompleted)
  791. {
  792. return "/setup/congrats.htm";
  793. }
  794. else
  795. {
  796. return "/setup/installd.htm";
  797. }
  798. }
  799. // Function: GoMouseTutorial
  800. // Description: Sees if we already did the mouse
  801. // tutorial if not then we see if there is a
  802. // mouse tutorial to do then if there is one
  803. // we check to see if it is an .exe or not
  804. // if not we navigate to the page else we
  805. // start a process
  806. //
  807. function GoMouseTutorial()
  808. {
  809. var bReturnValue = false;
  810. if (!StatusObj.get_MouseTutorCompleted())
  811. {
  812. // get mouse tutorial string
  813. var strMouseTutorial = DirObj.get_DoMouseTutorial();
  814. if (strMouseTutorial.length != 0)
  815. {
  816. /* if .exe in mouse string then execute that app
  817. else navigate to the file
  818. */
  819. // TODO: check to see if exe and create process
  820. if (0)
  821. {
  822. // need to check if exe and execute else navigate
  823. }
  824. else
  825. {
  826. g.navigate("../html/mouse/" + strMouseTutorial);
  827. }
  828. bReturnValue = true;
  829. }
  830. }
  831. // return if we navigated to the mouse tutorial or not
  832. return bReturnValue;
  833. }
  834. // Function: GoRegionalKeyboard
  835. // Description: Sees if we already did the
  836. // regional/keyboard settings if not
  837. // we check to see if we should if so then
  838. // we navigate to the regional settings page.
  839. //
  840. function GoRegionalKeyboard()
  841. {
  842. var bReturnValue = false;
  843. if (!StatusObj.get_LanguageCompleted())
  844. {
  845. if (DirObj.get_DoRegionalKeyboard() == 1)
  846. {
  847. g.navigate("regkb.htm");
  848. bReturnValue = true;
  849. }
  850. }
  851. // return if we navigated to the page or not.
  852. return bReturnValue;
  853. }
  854. // Function: GoOEMHardwareCheck
  855. // Description: Sees if we already did the
  856. // OEM HardwareCheck if not we see if we
  857. // should do the OEM hardware check. if we
  858. // should do the check we navigate to the page
  859. //
  860. function GoOEMHardwareCheck()
  861. {
  862. var bReturnValue = false;
  863. // if (!StatusObj.get_OEMHWCompleted())
  864. {
  865. if (DirObj.get_DoOEMHardwareCheck() == 1)
  866. {
  867. g.navigate("../html/oemhw/oemhw.htm");
  868. bReturnValue = true;
  869. }
  870. }
  871. // return if we navigated to the page or not.
  872. return bReturnValue;
  873. }
  874. // Page Navigation
  875. function GoCancel(ckpt)
  876. {
  877. if (g.spanRestore != null)
  878. {
  879. g.btnCancel.src = g_strPrefix + "images/lftclkw.gif";
  880. }
  881. else
  882. {
  883. g.btnCancel.src = g_strPrefix + "images/clicked.gif";
  884. }
  885. switch (ckpt)
  886. {
  887. case CKPT_TAPI:
  888. g.navigate(".." + OfflineStart());
  889. break;
  890. case CKPT_CONNECT:
  891. window.external.Hangup();
  892. g.navigate("usemodem.htm");
  893. break;
  894. case CKPT_MODEMCANCEL:
  895. g.navigate(".." + OfflineStart());
  896. break;
  897. case CKPT_MSNINTRO:
  898. window.external.Hangup();
  899. g.navigate(".." + OfflineStart());
  900. break;
  901. case CKPT_MSNINFO:
  902. window.external.Hangup();
  903. g.navigate(".." + OfflineStart());
  904. break;
  905. case CKPT_MSNPAYMENT:
  906. break;
  907. case CKPT_PASSSIGN:
  908. break;
  909. case CKPT_PASSPORT:
  910. break;
  911. case CKPT_REGISTER:
  912. break;
  913. }
  914. }
  915. function GoRestore(ckpt)
  916. {
  917. if (g.spanCancel != null)
  918. {
  919. g.btnRestore.src = g_strPrefix + "images/rhtclkw.gif";
  920. }
  921. else
  922. {
  923. g.btnRestore.src = g_strPrefix + "images/clicked.gif";
  924. }
  925. switch (ckpt)
  926. {
  927. case CKPT_OEMISP1:
  928. alert("need to navigate");
  929. break;
  930. }
  931. }
  932. function GoBack(ckpt)
  933. {
  934. if (g.spanNext != null)
  935. {
  936. g.btnBack.src = g_strPrefix + "images/lftclk.gif";
  937. }
  938. else
  939. {
  940. g.btnBack.src = g_strPrefix + "images/clicked.gif";
  941. }
  942. switch (ckpt)
  943. {
  944. case CKPT_TAPI:
  945. StoreTapi();
  946. g.navigate("start.htm");
  947. break;
  948. case CKPT_MOUSE:
  949. g.navigate("../../setup/start.htm");
  950. break;
  951. case CKPT_REGKB:
  952. // go back to start since Mouse has already been completed.
  953. g.navigate("../../setup/start.htm");
  954. break;
  955. case CKPT_OEMHW:
  956. // go back to start since RegKB and Mouse have already been completed.
  957. g.navigate("../../setup/start.htm");
  958. break;
  959. case CKPT_USERINFO:
  960. StoreUserInfo();
  961. g.navigate("regkb.htm");
  962. break;
  963. case CKPT_EULA:
  964. g.navigate("start.htm");
  965. break;
  966. case CKPT_MSNINTRO:
  967. window.external.Hangup();
  968. g.navigate("../setup/tapi.htm");
  969. break;
  970. case CKPT_WINMSNEULA:
  971. break;
  972. case CKPT_IAASSIGNED:
  973. break;
  974. case CKPT_PASSPORT:
  975. break;
  976. case CKPT_MSNPORTAL:
  977. break;
  978. case CKPT_PID:
  979. g.navigate("eula.htm");
  980. break;
  981. case CKPT_OEMISP1:
  982. g.navigate("pid.htm");
  983. break;
  984. case CKPT_OEMISP2:
  985. g.navigate("speedy.htm");
  986. break;
  987. case CKPT_OEMISP3:
  988. g.navigate("speedy2.htm");
  989. break;
  990. case CKPT_OEMREG:
  991. break;
  992. case CKPT_INSTALLED:
  993. break;
  994. case CKPT_CONGRATS:
  995. g.navigate("pid.htm");
  996. break;
  997. case CKPT_MODEMCANCEL:
  998. window.navigate("tapi.htm");
  999. break;
  1000. case CKPT_ERROR:
  1001. break;
  1002. case CKPT_REGKBCOMMIT:
  1003. break;
  1004. case CKPT_BADPID:
  1005. break;
  1006. case CKPT_MSNINFO:
  1007. break;
  1008. case CKPT_MSNIDPASS:
  1009. break;
  1010. case CKPT_MSNCONSET:
  1011. break;
  1012. case CKPT_MSNPAYMENT:
  1013. break;
  1014. case CKPT_PRIVACYGUARANTEE:
  1015. break;
  1016. case CKPT_PASSSIGN:
  1017. break;
  1018. case CKPT_PASSPORT:
  1019. break;
  1020. case CKPT_REGISTER:
  1021. break;
  1022. default:
  1023. g.navigate(ckpt);
  1024. break;
  1025. }
  1026. }
  1027. function GoNext(ckpt, oobePath)
  1028. {
  1029. if (g.spanBack != null)
  1030. {
  1031. g.btnNext.src = g_strPrefix + "images/rhtclk.gif";
  1032. }
  1033. else
  1034. {
  1035. g.btnNext.src = g_strPrefix + "images/clicked.gif";
  1036. }
  1037. switch (ckpt)
  1038. {
  1039. case CKPT_START:
  1040. // Store user name values into registry for later use.
  1041. InfoObj.set_FirstName = g.edt_FirstName.value;
  1042. InfoObj.set_MiddleInitial = g.edt_MiddleName.value;
  1043. InfoObj.set_LastName = g.edt_LastName.value;
  1044. // if we haven't done the mouse tutor we do that
  1045. // else we try the regional settings
  1046. // else we try the OEM hardware check
  1047. // else we go do Online/Offline Registration
  1048. if (GoMouseTutorial())
  1049. ; // do nothing we already navigated
  1050. else if (GoRegionalKeyboard())
  1051. ; // do nothing we already navigated
  1052. else if (GoOEMHardwareCheck())
  1053. ; // do nothing we already navigated
  1054. else
  1055. DoOfflineOnlineModeFromStart();
  1056. break;
  1057. case CKPT_TAPI:
  1058. StoreTapi();
  1059. g.navigate("connect.htm");
  1060. break;
  1061. case CKPT_DIALTONE:
  1062. g.navigate("connect.htm");
  1063. break;
  1064. case CKPT_MOUSE:
  1065. // we completed the mouse tutor so mark it
  1066. StatusObj.set_MouseTutorCompleted();
  1067. // if we haven't done the regional settings we do it
  1068. // else we try the OEM hardware check
  1069. // else we go do Online/Offline Registration
  1070. if (!GoRegionalKeyboard())
  1071. ; // do nothing we already navigated
  1072. else if (!GoOEMHardwareCheck())
  1073. ; // do nothing we already navigated
  1074. else
  1075. DoOnlineOfflineMode();
  1076. break;
  1077. case CKPT_REGKB:
  1078. // we finished the REGKB so we set it as done.
  1079. StatusObj.set_LanguageCompleted();
  1080. StoreRegKB();
  1081. if (g.selRegion.selectedIndex != LangObj.get_RegionIndex)
  1082. {
  1083. window.external.shutdown();
  1084. }
  1085. else
  1086. {
  1087. // if we haven't done the OEM hardware check we do it
  1088. // else we go do Online/Offline Registration
  1089. if (!GoOEMHardwareCheck())
  1090. ; // do nothing we already navigated
  1091. else
  1092. DoOnlineOfflineMode();
  1093. }
  1094. break;
  1095. case CKPT_OEMHW:
  1096. // we finished the OEM Hardware check so we set it as done.
  1097. StatusObj.set_OEMHWCompleted();
  1098. // then we go do Online/Offline Registration.
  1099. DoOnlineOfflineMode();
  1100. break;
  1101. case CKPT_USERINFO:
  1102. StoreUserInfo();
  1103. g.navigate("eula.htm");
  1104. /*
  1105. if (window.parent.g_bHasPassport == true)
  1106. {
  1107. alert("Post User data to MSDATA\n" +
  1108. "Stamp USER.EXE and post to Registry\n" +
  1109. "Disconnect\n" +
  1110. "Navigate to OFFLINE MODE\n");
  1111. }
  1112. else if (window.parent.g_bOEMRegister == true)
  1113. {
  1114. alert("OEM add'l user info");
  1115. alert("Post to OEM");
  1116. if (window.parent.g_bWantPassport == true)
  1117. {
  1118. g.navigate("passact.htm");
  1119. }
  1120. else
  1121. {
  1122. alert("Stamp USER.EXE and post to Registry");
  1123. alert("Disconnect");
  1124. alert("Navigate to OFFLINE MODE");
  1125. }
  1126. }
  1127. else if (window.parent.g_bWantPassport == true)
  1128. {
  1129. g.navigate("passact.htm");
  1130. }
  1131. else
  1132. {
  1133. alert("Stamp USER.EXE and post to Registry");
  1134. alert("Disconnect");
  1135. alert("Navigate to OFFLINE MODE");
  1136. }
  1137. */
  1138. break;
  1139. case CKPT_EULA:
  1140. var strDialog = "resizeable:no; scrollbars:no; status:no; "
  1141. + "dialogHeight:200px; dialogWidth:450px; border:thick; center:yes; help:no; maximize:no; minimize:no; ";
  1142. if (radioEULA(0).checked == true)
  1143. {
  1144. StatusObj.set_EULACompleted = true;
  1145. g.navigate(".." + OfflineStart());
  1146. }
  1147. else if (window.showModalDialog("eulawarn.htm", "EULAWarn", strDialog))
  1148. {
  1149. window.external.PowerDown();
  1150. }
  1151. break;
  1152. case CKPT_PID:
  1153. if (ValidatePid())
  1154. {
  1155. StorePid();
  1156. g.navigate(".." + OfflineStart());
  1157. }
  1158. else
  1159. {
  1160. alert("You must enter a valid Product Key for Windows to continue");
  1161. }
  1162. break;
  1163. case CKPT_OEMISP1:
  1164. g.navigate("speedy2.htm");
  1165. break;
  1166. case CKPT_OEMISP2:
  1167. g.navigate("speedy3.htm");
  1168. break;
  1169. case CKPT_OEMISP3:
  1170. g.navigate("congrats.htm");
  1171. break;
  1172. case CKPT_CONGRATS:
  1173. window.external.Finish();
  1174. break;
  1175. case CKPT_MSNINTRO:
  1176. g.navigate("msneula.htm");
  1177. break;
  1178. case CKPT_WINMSNEULA:
  1179. window.external.Hangup();
  1180. g.navigate(".." + OfflineStart());
  1181. break;
  1182. case CKPT_IAASSIGNED:
  1183. break;
  1184. case CKPT_PASSPORT:
  1185. break;
  1186. case CKPT_MSNPORTAL:
  1187. break;
  1188. case CKPT_OEMREG:
  1189. break;
  1190. case CKPT_INSTALLED:
  1191. break;
  1192. case CKPT_ERROR:
  1193. break;
  1194. case CKPT_REGKBCOMMIT:
  1195. break;
  1196. case CKPT_BADPID:
  1197. break;
  1198. case CKPT_MSNINFO:
  1199. break;
  1200. case CKPT_MSNIDPASS:
  1201. break;
  1202. case CKPT_MSNCONSET:
  1203. break;
  1204. case CKPT_MSNPAYMENT:
  1205. break;
  1206. case CKPT_PRIVACYGUARANTEE:
  1207. break;
  1208. case CKPT_PASSSIGN:
  1209. break;
  1210. case CKPT_PASSPORT:
  1211. break;
  1212. case CKPT_REGISTER:
  1213. break;
  1214. default:
  1215. g.navigate(ckpt);
  1216. break;
  1217. }
  1218. }
  1219. // END Page Navigation
  1220. // Button Event Handlers and Initialization
  1221. // Function: InitGlobals
  1222. // Description: Sets up globals to point to buttons
  1223. // Since the buttons exist on the child frame,
  1224. // we want to have quick access to them without
  1225. // going through the collections.
  1226. // WARNING: Call this function at the top of XXX_LoadMe()
  1227. //
  1228. function InitGlobals()
  1229. {
  1230. g = document.frames("msoobeMain");
  1231. g_strPrefix = (arguments[0] != null) ? arguments[0] : "../";
  1232. }
  1233. function InitButtons()
  1234. {
  1235. InitPairedButton(g.spanNext, g.btnNext, g.btnNextText, "images/rhtdef.gif", "images/rhtdsld.gif",
  1236. g.spanBack, "backButton", "backButtonText");
  1237. InitPairedButton(g.spanBack, g.btnBack, g.btnBackText, "images/lftdef.gif", "images/lftdsld.gif",
  1238. g.spanNext, "backButton", "backButtonText");
  1239. InitPairedButton(g.spanRestore, g.btnRestore, g.btnRestoreText, "images/rhtdefw.gif", "images/rhtdsldw.gif",
  1240. g.spanCancel, "cancelButton", "cancelButtonText");
  1241. InitPairedButton(g.spanCancel, g.btnCancel, g.btnCancelText, "images/rhtdefw.gif", "images/rhtdsldw.gif",
  1242. g.spanRestore, "restoreButton", "restoreButtonText");
  1243. }
  1244. function InitPairedButton(span, btn, btnText, img, imgDisabled,
  1245. span2, btnClass, btnTextClass)
  1246. {
  1247. if (span != null)
  1248. {
  1249. if (span2 == null)
  1250. {
  1251. btn.className = btnClass;
  1252. btnText.className = btnTextClass;
  1253. btnText.style.textAlign="center";
  1254. btnText.style.width = "105px";
  1255. btnText.style.left = btn.style.left;
  1256. }
  1257. if (btn.disabled == null || !btn.disabled)
  1258. {
  1259. if (span2 == null)
  1260. {
  1261. btn.src = g_strPrefix + "images/default.gif";
  1262. }
  1263. else
  1264. {
  1265. btn.src = g_strPrefix + img;
  1266. }
  1267. btnText.style.color= "black";
  1268. }
  1269. else
  1270. {
  1271. if (span2 == null)
  1272. {
  1273. btn.src = g_strPrefix + "images/disabled.gif";
  1274. }
  1275. else
  1276. {
  1277. btn.src = g_strPrefix + imgDisabled;
  1278. }
  1279. btnText.style.color= "gray";
  1280. }
  1281. span.onmouseover = HoverOnButton;
  1282. span.onmouseout = HoverOffButton;
  1283. }
  1284. }
  1285. ///////////////////////////////////////////////////////////
  1286. // Function: HoverOnButton
  1287. // Description: This function is attached to a onmouseover
  1288. // event for a button span. We use the event source to
  1289. // determine which button it occured on and change that
  1290. // button to it's higlighted or hover state.
  1291. //
  1292. function HoverOnButton()
  1293. {
  1294. switch (g.event.srcElement)
  1295. {
  1296. case g.btnCancel:
  1297. case g.btnCancelText:
  1298. HoverOnPairedButton(g.btnCancel, g.btnCancelText, "images/lfthvr.gif", g.btnRestore);
  1299. break;
  1300. case g.btnRestore:
  1301. case g.btnRestoreText:
  1302. HoverOnPairedButton(g.btnRestore, g.btnRestoreText, "images/rhthvrw.gif", g.btnCancel);
  1303. break;
  1304. case g.btnBack:
  1305. case g.btnBackText:
  1306. HoverOnPairedButton(g.btnBack, g.btnBackText, "images/lfthvr.gif", g.btnNext);
  1307. break;
  1308. case g.btnNext:
  1309. case g.btnNextText:
  1310. HoverOnPairedButton(g.btnNext, g.btnNextText, "images/rhthvr.gif", g.btnBack);
  1311. break;
  1312. }
  1313. }
  1314. function HoverOnPairedButton(btn, btnText, img, btn2)
  1315. {
  1316. if (btn.disabled == null || !btn.disabled)
  1317. {
  1318. if (g.event.fromElement != btn && g.event.fromElement != btnText)
  1319. {
  1320. if (btn2 == null)
  1321. {
  1322. btn.src = g_strPrefix + "images/hover.gif";
  1323. }
  1324. else
  1325. {
  1326. btn.src = g_strPrefix + img;
  1327. }
  1328. btnText.style.fontWeight = "bold";
  1329. btnText.style.color = "yellow";
  1330. }
  1331. }
  1332. }
  1333. ///////////////////////////////////////////////////////////
  1334. // Function: HoverOffButton
  1335. // Description: This function is attached to a onmouseout
  1336. // event for a button span. We use the event source to
  1337. // determine which button it occured on and change that
  1338. // button back to it's normal state.
  1339. //
  1340. function HoverOffButton()
  1341. {
  1342. switch (g.event.srcElement)
  1343. {
  1344. case g.btnCancel:
  1345. case g.btnCancelText:
  1346. HoverOffPairedButton(g.btnCancel, g.btnCancelText, "images/lftdefw.gif", g.btnRestore);
  1347. break;
  1348. case g.btnRestore:
  1349. case g.btnRestoreText:
  1350. HoverOffPairedButton(g.btnRestore, g.btnRestoreText, "images/rhtdefw.gif", g.btnCancel);
  1351. break;
  1352. case g.btnBack:
  1353. case g.btnBackText:
  1354. HoverOffPairedButton(g.btnBack, g.btnBackText, "images/lftdef.gif", g.btnNext);
  1355. break;
  1356. case g.btnNext:
  1357. case g.btnNextText:
  1358. HoverOffPairedButton(g.btnNext, g.btnNextText, "images/rhtdef.gif", g.btnBack);
  1359. break;
  1360. }
  1361. }
  1362. function HoverOffPairedButton(btn, btnText, img, btn2)
  1363. {
  1364. if (btn.disabled == null || !btn.disabled)
  1365. {
  1366. if (g.event.toElement != btn && g.event.toElement != btnText)
  1367. {
  1368. if (btn2 == null)
  1369. {
  1370. btn.src = g_strPrefix + "images/default.gif";
  1371. }
  1372. else
  1373. {
  1374. btn.src = g_strPrefix + img;
  1375. }
  1376. btnText.style.fontWeight = "normal";
  1377. btnText.style.color = "black";
  1378. }
  1379. }
  1380. }
  1381. // END Button Event Handlers and Initialization
  1382. </script>
  1383. </HEAD>
  1384. <FRAMESET FRAMEBORDER=no COLS="100%" ROWS="100%">
  1385. <FRAME NAME="msoobeMain" SRC="setup/start.htm" FRAMEBORDER=no SCROLLING=no>
  1386. </FRAMESET>
  1387. </HTML>