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.

6845 lines
197 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. <LINK REL="stylesheet" TYPE="text/css" HREF="setup\oobestyl.css">
  6. <!-- Begin Agent Specific Code -->
  7. <!-- The majority of the Agent code is in AgtCore.js -->
  8. <!-- The AgtXXXX.js files contain all of the script -->
  9. <!-- code that needs to be localized. -->
  10. <!-- NOTE: Agent is not initialized until the first -->
  11. <!-- time someone clicks on the Assistant image. -->
  12. <script language=jscript src="AgtCore.js"></script>
  13. <script language=jscript src="AgtScrpt.js"></script>
  14. <!-- Agent Event Handler Declarations -->
  15. <script language=jscript for=Agent event="Command(userInput)")>
  16. Agent_OnCommand(userInput);
  17. </script>
  18. <script language=jscript for=Agent event="Hide(characterID)">
  19. Agent_OnHide(characterID);
  20. </script>
  21. <script language=jscript for=Agent event="IdleStart(characterID)">
  22. Agent_OnIdleStart(characterID);
  23. </script>
  24. <script language=jscript for=Agent event="IdleComplete(characterID)">
  25. Agent_OnIdleComplete(characterID);
  26. </script>
  27. <script language=jscript for=Agent event="Bookmark(id)">
  28. Agent_OnBookmark(id);
  29. </script>
  30. <script language=jscript for=Agent event="Click(characterID, button, shift, x, y)">
  31. Agent_OnClick(characterID, button, shift, x, y);
  32. </script>
  33. <script language=jscript for=Agent event="DragComplete(characterID, button, shift, x, y)">
  34. Agent_OnDragComplete(characterID, button, shift, x, y);
  35. </script>
  36. <script language=jscript for=Agent event="RequestComplete(request)">
  37. Agent_OnRequestComplete(request);
  38. </script>
  39. <!-- End Agent Specific Code -->
  40. <!-- Windows Media Player sends this event upon any error it encounters -->
  41. <script language=jscript for=IntroAnimation event="error()">
  42. if (IntroAnimation.playState!=3)
  43. {
  44. VideoGoNext('Error');
  45. }
  46. </Script>
  47. <!-- Windows Media Player sends this event upon any changes in the play state -->
  48. <script language=jscript for=IntroAnimation event="PlayStateChange(bResult)">
  49. if (bResult==3)
  50. {
  51. trace("PlayStateChange " + bResult);
  52. try
  53. {
  54. IntroAnimation.fullscreen = "true";
  55. }
  56. catch(err)
  57. {
  58. var temp = "EXCEPTION THROWN: WMP control failed to go to full screen.";
  59. temp += "\rerror name: " + err.name;
  60. temp += "\rmessage: " + err.message;
  61. temp += "\rnumber: " + err.number;
  62. temp += "\rdescription: " + err.description;
  63. trace(temp);
  64. }
  65. g_fHasPlayed=true;
  66. }
  67. else if ( g_fHasPlayed || (bResult==8) )
  68. {
  69. trace("PlayStateChange " + bResult);
  70. VideoGoNext('PlayStateChanged');
  71. }
  72. </script>
  73. <script language=jscript src="mousetut.js"></script>
  74. <script language=jscript src="oobeutil.js"></script>
  75. <script language=jscript src="migrate.js"></script>
  76. <script language=jscript src="dialmgr.js"></script>
  77. <script language=jscript src="error.js"></script>
  78. <script language=jscript src="icsmgr.js"></script>
  79. <script language=jscript src="isptype.js"></script>
  80. <script language=jscript src="iconnect.js"></script>
  81. <script language=jscript src="dslmain.js"></script>
  82. <script language=jscript src="sconnect.js"></script>
  83. <script language=jscript>
  84. // This is intended to hold all the script needed
  85. // in the default & offline OOBE HTML pages.
  86. //
  87. // We want to separate the layout (HTML) from the script.
  88. // At the same time, it's helpful to have all the code
  89. // in one place to make it easier to understand the flow
  90. // from page to page.
  91. var APP_OOBE_MODE = 0;
  92. var APP_MSN_MODE = 4;
  93. var APP_DESKTOP_MODE = 2;
  94. // Windows Media Player variable
  95. var g_fHasPlayed = false;
  96. var g_VideoEvent = null;
  97. // Status location constants
  98. var STATUS_ISP = 0; // Do either MSN or local OEM offer
  99. var STATUS_PRECONFIG = 1; // Do the pre-configured OEM INS file
  100. var STATUS_NONE = 2; // Don't do any ISP offer
  101. var STATUS_OFF = 3; // Don't connect to the Internet
  102. var STATUS_MAX = 4;
  103. // var SNDX_WELCOME = 0;
  104. var SNDX_MSN_ISP = 1;
  105. var SNDX_MSN_REG = 2;
  106. var SNDX_MSN_FINISH = 3;
  107. var SNDX_OEM_REG = 1;
  108. var SNDX_OEM_ISP = 2;
  109. var SNDX_OEM_FINISH = 3;
  110. var SNDX_NONE_REG = 1;
  111. var SNDX_NONE_FINISH = 2;
  112. var SNDX_OFF_EULA = 1;
  113. var SNDX_OFF_PID = 2;
  114. var SNDX_OFF_FINISH = 3;
  115. // OLD STATUS PANE FOR B1
  116. // var SNDX_WELCOME = 0;
  117. // var SNDX_HW1 = 1;
  118. // var SNDX_HW2 = 2;
  119. // var SNDX_HW3 = 3;
  120. // var SNDX_LEGAL1 = 4;
  121. // var SNDX_LEGAL2 = 5;
  122. // var SNDX_REG1 = 6;
  123. // var SNDX_REG2 = 7;
  124. // var SNDX_ISP = 8;
  125. // var SNDX_FINI = 9;
  126. // For the new status pane, don't allow half way status
  127. var SNDX_WELCOME = 0;
  128. var SNDX_HW = 1;
  129. var SNDX_LEGAL = 2;
  130. var SNDX_REG = 3;
  131. var SNDX_ISP = 4;
  132. var SNDX_IDENTITIES = 5;
  133. var SNDX_FINI = 6;
  134. // holds non-checkpoint next navigation
  135. var g_SimpleNavMap = null;
  136. ///////////////////////////////////////////////////////////////////////////////
  137. // CheckPoint
  138. //
  139. // Constructor for CheckPoint object.
  140. //
  141. ///////////////////////////////////////////////////////////////////////////////
  142. function CheckPoint(strURL, i1, i2, i3, i4)
  143. {
  144. this.strURL = strURL;
  145. this.rgindex = new Array(STATUS_MAX);
  146. this.rgindex[STATUS_ISP] = i1;
  147. this.rgindex[STATUS_PRECONFIG] = i2;
  148. this.rgindex[STATUS_NONE] = i3;
  149. this.rgindex[STATUS_OFF] = i4;
  150. }
  151. var curCKPT = 1;
  152. var CKPT_ANIMATION = curCKPT++;
  153. var CKPT_HWCHK = curCKPT++;
  154. var CKPT_WELCOME = curCKPT++;
  155. var CKPT_MOUSETUT1 = curCKPT++;
  156. var CKPT_IMETUTORIAL = curCKPT++;
  157. var CKPT_OEMHW = curCKPT++;
  158. var CKPT_REGION_KEYBD = curCKPT++;
  159. var CKPT_REGKB_COMMIT = curCKPT++;
  160. var CKPT_TIMEZONE = curCKPT++;
  161. var CKPT_EULA = curCKPT++;
  162. var CKPT_EULA_DECLINE = curCKPT++;
  163. var CKPT_PRODUCTKEY = curCKPT++;
  164. var CKPT_BADPRODUCTKEY = curCKPT++;
  165. var CKPT_COMPNAME = curCKPT++;
  166. var CKPT_SECPASS = curCKPT++;
  167. var CKPT_JNDOMAIN = curCKPT++;
  168. var CKPT_ICSCHOICE = curCKPT++;
  169. var CKPT_HOMENETWIZPROMPT = curCKPT++;
  170. var CKPT_DSLMAIN = curCKPT++;
  171. var CKPT_DSLPPPOE = curCKPT++;
  172. var CKPT_DSLBROADBAND = curCKPT++;
  173. var CKPT_CONGRATS = curCKPT++;
  174. var CKPT_ACTIVATION = curCKPT++;
  175. var CKPT_REGISTER1 = curCKPT++;
  176. var CKPT_REGISTER3 = curCKPT++;
  177. var CKPT_ACT_MSG = curCKPT++;
  178. var CKPT_ICONN = curCKPT++;
  179. var CKPT_ISPSIGNUP = curCKPT++;
  180. var CKPT_MIGLIST = curCKPT++;
  181. var CKPT_ISPDIAL = curCKPT++;
  182. var CKPT_REFDIAL = curCKPT++;
  183. var CKPT_MIGDIAL = curCKPT++;
  184. var CKPT_REGDIAL = curCKPT++;
  185. var CKPT_ISPTYPE = curCKPT++;
  186. var CKPT_ICONNECT = curCKPT++;
  187. var CKPT_SCONNECT = curCKPT++;
  188. var CKPT_OEMISP = curCKPT++;
  189. var CKPT_OEMCUST = curCKPT++;
  190. var CKPT_IDENTITIES2 = curCKPT++;
  191. var CKPT_DONE = curCKPT++;
  192. var CKPT_MAX = curCKPT; // ALWAYS set this to be the biggest value!
  193. var dnCKPT = new Array(CKPT_MAX);
  194. // Checkpoint breadcrumbs
  195. var g_CurrentCKPT = null;
  196. var g_DialCKPT = null;
  197. var HKEY_LOCAL_MACHINE = 0x80000002;
  198. var REGISTERED_OWNER_KEY = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
  199. var REGISTERED_OWNER_VALUE = "RegisteredOwner";
  200. var OOBE_MAIN_REG_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OOBE";
  201. var CLSID_FLASH_PLAYER = "{D27CDB6E-AE6D-11cf-96B8-444553540000}";
  202. var PROGID_FLASH_PLAYER = "ShockwaveFlash.ShockwaveFlash";
  203. var CKPT_REG_KEY = "\\CKPT";
  204. var TOS_REG_VALUE = "TopOfStack";
  205. // Preferred connection registry settings
  206. var PREFCONN_REG_VALUE = "PreferredConnection";
  207. var POWERDOWN_SHUTDOWN = 0;
  208. var POWERDOWN_REBOOT = 1;
  209. // CheckDialReady errors
  210. var ERR_COMM_NO_ERROR = 0;
  211. var ERR_COMM_OOBE_COMP_MISSING = 1;
  212. var ERR_COMM_UNKNOWN = 2; // Unknown error, check input parameters
  213. var ERR_COMM_NOMODEM = 3; // There is no modem installed
  214. var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
  215. var ERR_COMM_ISDN = 5;
  216. var ERR_COMM_PHONE_AND_ISDN = 6;
  217. // Dialing errors. Look at raserror.h for details
  218. var DERR_DIALTONE = 680;
  219. var DERR_BUSY = 676;
  220. var DERR_VOICEANSWER = 677;
  221. var DERR_NOANSWER = 678;
  222. var DERR_NO_CARRIER = 679;
  223. var DERR_HARDWARE_FAILURE = 630; // modem turned off
  224. var DERR_PORT_ALREADY_OPEN = 602; // procomm/hypertrm/RAS has COM port
  225. var DERR_PORT_OR_DEVICE = 692; // got this when hypertrm had the device open -- jmazner
  226. var DERR_PPP_TIMEOUT = 718;
  227. var DERR_REMOTE_DISCONNECT = 629; // Connection interrupted
  228. // Types of dialing using ISP files. e.g. Dial to registration, ISP, referral server
  229. var CONNECTED_REFFERAL = 1
  230. var CONNECTED_ISP_SIGNUP = 2
  231. var CONNECTED_ISP_MIGRATE = 3
  232. var CONNECTED_REGISTRATION = 4
  233. // Computer name page return codes
  234. //
  235. var COMPNAME_SUCCESS = 0;
  236. var COMPNAME_INVALIDNAME = 1;
  237. // Finish errors
  238. //
  239. // These MUST be kept in sync with the values in MSOBMAIN.H.
  240. //
  241. var FINISH_OK = 0x00000000;
  242. var FINISH_REBOOT = 0x00000001;
  243. var FINISH_BAD_PID = 0x00000002;
  244. var FINISH_BAD_EULA = 0x00000004;
  245. var FINISH_BAD_STAMP = 0x00000008;
  246. // Net Join Status
  247. //
  248. // These MUST be kept in sync with the values in MSOBMAIN.H.
  249. //
  250. var JOIN_STATUS_UNKNOWN = 0;
  251. var JOIN_STATUS_UNJOINED = 1;
  252. var JOIN_STATUS_WORKGROUP = 2;
  253. var JOIN_STATUS_DOMAIN = 3;
  254. // Language reboot return codes
  255. var LANGUAGE_REBOOT_NEVER = 0;
  256. var LANGUAGE_REBOOT_NOW = 1;
  257. var LANGUAGE_REBOOT_END = 2;
  258. // Dictionary compare modes
  259. var COMPAREMODE_BINARY = 0;
  260. var COMPAREMODE_TEXT = 1;
  261. // on-the-fly button hiding
  262. var HIDE_BACK = 0x0001;
  263. var HIDE_NEXT = 0x0002;
  264. var HIDE_CANCEL = 0x0004;
  265. var HIDE_RESTORE = 0x0008;
  266. // keycode consts
  267. var KeyEsc = 0x1B;
  268. var KeyEnter = 0xD;
  269. var KeyBackSpc = 0x8;
  270. var KeyDelete = 0x2E;
  271. var KeyTab = 0x9;
  272. var KeyDwnArrow = 0x28;
  273. var KeyUpArrow = 0x26;
  274. var KeyLeftArrow = 0x25;
  275. var KeyRightArrow = 0x27;
  276. // BUGBUG temp GUIDs
  277. var NOLAUNCHISPSIGNUP = "{C37D92A5-CA34-11d2-B71C-00C04F794977}";
  278. var MSNCOMPLETED = "{1C0A22F2-CB6B-11d2-B544-00A0C949DA70}";
  279. var LANGUAGECOMPLETED = "{F744DA40-617C-11D3-8B99-00A0C91E7F3C}";
  280. var MS_REGISTRATION = "{1C956940-8617-11D3-8B99-00A0C91E7F3C}";
  281. var OEM_REGISTRATION = "{ECD24360-B210-11D3-8B99-00A0C91E7F3C}";
  282. // window.external object caches
  283. var TapiObj = null;
  284. var InfoObj = null;
  285. var EulaObj = null;
  286. var LangObj = null;
  287. var PidObj = null;
  288. var StatusObj = null;
  289. var DirObj = null;
  290. var ApiObj = null;
  291. var SysClockObj = null;
  292. var RegisterObj = null;
  293. var FileSystemObj = null;
  294. var g_Identities2_OK;
  295. // Localizeable strings for username.htm "Personalize your copy of Windows"
  296. var L_Blank_Text = "";
  297. var L_Administrator_Text = "ADMINISTRATOR";
  298. var L_Guest_Text = "GUEST";
  299. // general globals and status
  300. var g_strISPFile = "";
  301. var g_bStartup;
  302. var g_LastButtonText = null;
  303. var g_FirstFocusElement = null;
  304. var g = null;
  305. var g_SpecialChars = ".'-` ";
  306. var g_OOBEDir = "file://" + window.external.API.get_SystemDirectory() + "\\oobe\\";
  307. var g_OOBEDirPath = window.external.API.get_SystemDirectory() + "\\oobe\\";
  308. var g_bRedial = false;
  309. var g_LineProblem = 0;
  310. var g_bFirstServerError = true;
  311. var g_status = STATUS_OFF;
  312. var g_ServerErrorCount = 0;
  313. var g_IMEExists = false;
  314. var g_OEMAddBackURL = "";
  315. var g_DialingAvailableInCountry = true;
  316. var g_ModalDialogUp = false;
  317. var bKeyboardPresent = true;
  318. var bMousePresent = true;
  319. var g_OEMNameStr = window.external.Signup.get_OEMName();
  320. var g_bTapiDone = false;
  321. var g_CompNameChangeComplete = false;
  322. var g_fFirewallRequired = false;
  323. var g_bIsSetupUpgrade = false;
  324. var g_bInHighScreenRes = false;
  325. // We use the DisplayIcsCongratsPage so that we wont come back
  326. // to the congratulations page after passing it.
  327. var DisplayIcsCongratsPage = true;
  328. // We use g_DidWePassWelcomePage so that the users will not see the mouse tutorial
  329. // again if the users clicked next on the welcome page and then back again. This variable is set to true in the GoNext function.
  330. var g_DidWePassWelcomePage = false;
  331. // Mandatory Initialization Code
  332. if (null == FileSystemObj) {
  333. FileSystemObj = new ActiveXObject("Scripting.FileSystemObject");
  334. }
  335. if (null == ApiObj)
  336. {
  337. ApiObj = new Object;
  338. ApiObj = window.external.API;
  339. }
  340. if (null == StatusObj)
  341. {
  342. StatusObj = new Object;
  343. StatusObj = window.external.Status;
  344. }
  345. if (null == DirObj)
  346. {
  347. DirObj = new Object;
  348. DirObj = window.external.Directions;
  349. }
  350. if (null == InfoObj)
  351. {
  352. InfoObj = new Object;
  353. InfoObj = window.external.UserInfo;
  354. }
  355. if (null == TapiObj)
  356. {
  357. TapiObj = new Object;
  358. TapiObj = window.external.Tapi;
  359. }
  360. if (null == RegisterObj)
  361. {
  362. RegisterObj = new Object;
  363. RegisterObj = window.external.Register;
  364. }
  365. if (null == SysClockObj)
  366. {
  367. SysClockObj = new Object;
  368. SysClockObj = window.external.SystemClock;
  369. SysClockObj.Init();
  370. }
  371. if (null == LangObj)
  372. {
  373. LangObj = new Object;
  374. LangObj = window.external.Language;
  375. }
  376. // END Initialization Code
  377. // another global, need DirObj first though
  378. var g_AgentDisabled = (DirObj.get_AgentDisabled() || DirObj.get_IntroOnly());
  379. var L_ContStr_Text="To continue, click";
  380. var L_NextStr_Text="Next";
  381. var L_Period_Text=".";
  382. var L_ClickNextLocStr_Text=""; // for localizers to add stuff without affecting L_Period_Text
  383. var L_NextStrTopPercent_Text="83%";
  384. var L_ClickNextStrTopPercent800_Text="78%";
  385. var L_ClickNextStrTopPercent1024_Text="84%";
  386. var L_ClickNextStrLeftPercent_Text="30%";
  387. var g_ClickNextStr = "&nbsp;"
  388. var g_ClickNextStrWelcome = "";
  389. // Set up labelS for various getting connected Congratulations.
  390. var L_ConnectedDefaultHeading_Text = "Congratulations";
  391. var L_ConnectedNoInternetHeading_Text = "Could not find the Internet";
  392. var L_ConnectedDefault_Text = "You are now connected to the Internet.";
  393. var L_ConnectedViaICS_Text = "You are now connected to the Internet using ICS connection.";
  394. var L_ConnectedViaDSLCable_Text = "You are now connected to the Internet via your DSL/Cable connection.";
  395. var L_ConnectedViaLAN_Text = "You are now connected to the Internet using your LAN connection.";
  396. var L_ConnectedNoInternet_Text = "Windows was not able to connect to the Internet using your network hardware. You can connect to the Internet later by clicking the Start button, then click <B>Internet</B>. Please click the <B>Next</B> button below to continue setting up Windows.";
  397. var g_Congrats_Type_Heading = L_ConnectedDefaultHeading_Text;
  398. var g_Congrats_Type = L_ConnectedDefault_Text;
  399. ///////////////////////////////////////////////////////////////////////////////
  400. // logError
  401. //
  402. // Log information from an error object. trace will send the info to
  403. // setuplog.txt and the debugger. If
  404. // HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\OOBE\MsDebug=DWORD:1
  405. // an alert will be displayed as well.
  406. //
  407. ///////////////////////////////////////////////////////////////////////////////
  408. function logError(funcName, errObj)
  409. {
  410. trace( "Exception in " + funcName
  411. + " (" + errObj.number.toString(16) + ") "
  412. + errObj.description + "\n"
  413. );
  414. if (true == DebugObj.get_MsDebugMode())
  415. {
  416. alert("OOBE ERROR\n"
  417. + "\n Function: " + funcName
  418. + "\n Error: " + errObj.number.toString(16)
  419. + "\nDescription: " + errObj.description
  420. );
  421. }
  422. }
  423. var g_ip_regex = /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/
  424. function validate_ip_addr(ip_addr)
  425. {
  426. ip_re = new RegExp(g_ip_regex);
  427. if (! ip_re.test(ip_addr))
  428. {
  429. return false;
  430. }
  431. ip_a = parseInt(RegExp.$1);
  432. ip_b = parseInt(RegExp.$2);
  433. ip_c = parseInt(RegExp.$3);
  434. ip_d = parseInt(RegExp.$4);
  435. if ( (ip_a < 1 || ip_a > 223)
  436. || (ip_b < 0 || ip_b > 255)
  437. || (ip_c < 0 || ip_c > 255)
  438. || (ip_d < 0 || ip_d > 255)
  439. )
  440. {
  441. return false;
  442. }
  443. else
  444. {
  445. return true;
  446. }
  447. } // validate_ip_addr
  448. function validate_subnet_mask(subnet_mask)
  449. {
  450. ip_re = new RegExp(g_ip_regex);
  451. if (! ip_re.test(subnet_mask))
  452. {
  453. return false;
  454. }
  455. else
  456. {
  457. return true;
  458. }
  459. } // validate_subnet_mask
  460. ///////////////////////////////////////////////////////////////////////////////
  461. // IMETut1.htm
  462. ///////////////////////////////////////////////////////////////////////////////
  463. ///////////////////////////////////////////////////////////////////////////////
  464. // imetut_LoadMe
  465. //
  466. // onload event handler for IMETut1.htm.
  467. //
  468. ///////////////////////////////////////////////////////////////////////////////
  469. function imetut_LoadMe()
  470. {
  471. InitFrameRef();
  472. g_FirstFocusElement = g.btnNextText;
  473. if (1 != DirObj.get_DoRegionalKeyboard())
  474. HideButtons(HIDE_BACK);
  475. InitNewButtons();
  476. g_FirstFocusElement.focus();
  477. }
  478. ///////////////////////////////////////////////////////////////////////////////
  479. // welcome.htm
  480. ///////////////////////////////////////////////////////////////////////////////
  481. ///////////////////////////////////////////////////////////////////////////////
  482. // Start_OnKeyPress
  483. //
  484. // onkeypress handler for welcome.htm
  485. //
  486. // Treats the Enter key like the Next button. Filters out invalid keys.
  487. //
  488. ///////////////////////////////////////////////////////////////////////////////
  489. function Start_OnKeyPress()
  490. {
  491. try
  492. {
  493. if (g.event == null)
  494. return;
  495. }
  496. catch(e)
  497. {
  498. return;
  499. }
  500. // Treat the enter key like the next button
  501. if ((g.event.keyCode == KeyEnter) && (g.btnNext.disabled == false))
  502. {
  503. GoNext();
  504. }
  505. else
  506. {
  507. KeyPressIsValid();
  508. }
  509. }
  510. ///////////////////////////////////////////////////////////////////////////////
  511. // CompName.htm
  512. ///////////////////////////////////////////////////////////////////////////////
  513. var g_ComputerDescription = null;
  514. // Function: CompName_LoadMe
  515. // Description: This function is called after CompName.htm is loaded to
  516. // initialize display and state.
  517. //
  518. function CompName_LoadMe()
  519. {
  520. InitFrameRef();
  521. if (null != g.lblCompName)
  522. {
  523. g.lblCompName.className = "text-primary";
  524. }
  525. if (null != g.lblCompDesc)
  526. {
  527. g.lblCompDesc.className = "text-primary";
  528. }
  529. if (null != g.txtCompName)
  530. {
  531. g.txtCompName.value = ApiObj.get_ComputerName( );
  532. g_FirstFocusElement = g.txtCompName;
  533. g_FirstFocusElement.select();
  534. }
  535. else
  536. {
  537. g_FirstFocusElement = g.btnNext;
  538. }
  539. // Make sure the Computername edit field is enabled
  540. g.txtCompName.style.backgroundColor='#ffffff';
  541. g.txtCompName.disabled=false;
  542. g.txtCompDesc.style.backgroundColor='#ffffff';
  543. g.txtCompDesc.disabled=false;
  544. g_FirstFocusElement.focus();
  545. InitNewButtons();
  546. }
  547. // Function: CompName_OnNext
  548. // Description: Determines whether the name the user has entered is different
  549. // from the current system name. If it is, the new system name is saved and
  550. // true is returned indicating that the system needs to be rebooted.
  551. //
  552. function CompName_OnNext()
  553. {
  554. if (ApiObj.ValidateComputername(g.txtCompName.value))
  555. {
  556. if (null != g.lblCompName)
  557. {
  558. g.lblCompName.className = "text-primary";
  559. }
  560. if (ApiObj.get_ComputerName() != g.txtCompName.value)
  561. {
  562. ApiObj.set_ComputerName(g.txtCompName.value);
  563. // tell oobe that the user change the name.
  564. window.external.ComputerNameDifferent();
  565. PopCKPT(CKPT_COMPNAME);
  566. PushCKPT(CKPT_SECPASS);
  567. }
  568. // Disable the Computername edit field
  569. g.txtCompName.style.backgroundColor='#dddddd';
  570. g.txtCompName.disabled=true;
  571. g.txtCompDesc.style.backgroundColor='#dddddd';
  572. g.txtCompDesc.disabled=true;
  573. g_ComputerDescription = g.txtCompDesc.value;
  574. // Give the system some time to paint and then call the function
  575. // which start the process as a thread.
  576. //
  577. window.setTimeout("CompName_ChangeComplete(true);",50);
  578. return COMPNAME_SUCCESS;
  579. }
  580. else
  581. {
  582. if (null != g.lblCompName)
  583. {
  584. g.lblCompName.className = "text-error";
  585. }
  586. if (null != g.txtCompName)
  587. {
  588. g_FirstFocusElement = g.txtCompName;
  589. }
  590. if (null != g.btnNext)
  591. {
  592. g.btnNext.disabled=false;
  593. }
  594. if (null != g.btnBack)
  595. {
  596. g.btnBack.disabled=false;
  597. }
  598. if (null != g.btnSkip)
  599. {
  600. g.btnSkip.disabled=false;
  601. }
  602. g.lblCompNameError.style.display = "inline";
  603. g.spnCompName_Primary21.className = "text-error";
  604. InitNewButtons();
  605. if (null != g_FirstFocusElement)
  606. {
  607. g_FirstFocusElement.focus();
  608. }
  609. return COMPNAME_INVALIDNAME;
  610. }
  611. }
  612. function ServicesStartedDone()
  613. {
  614. g.document.body.style.cursor = "default";
  615. // Remove this page from the checkpoint history. WinLogon will
  616. // have started services dependent on the computer name so we don't
  617. // want to let the user change it again.
  618. //
  619. PopCKPT(CKPT_COMPNAME);
  620. // Update the status menu, need to do this after the services are started
  621. InitStatusMenu();
  622. GoNavigate(CKPT_SECPASS);
  623. }
  624. // Function: CompName_ChangeComplete
  625. // Description: Notifies msobmain that the computer name change is complete and
  626. // initializes the status menu.
  627. //
  628. // This is code common to all cases where the computer name page is skipped.
  629. //
  630. function CompName_ChangeComplete(Thread)
  631. {
  632. if (g_CompNameChangeComplete) return;
  633. g_CompNameChangeComplete = true;
  634. if (! window.external.get_RetailOOBE())
  635. {
  636. if (g_ComputerDescription)
  637. {
  638. ApiObj.set_ComputerDesc(g_ComputerDescription);
  639. }
  640. window.external.ComputerNameChangeComplete(Thread);
  641. }
  642. if (!Thread)
  643. {
  644. // since this is sync call do this here. In the async case it is done
  645. // in the function which is called when the thread finishes. ServicesStartedDone
  646. //
  647. // Update the status menu, need to do this after the services are started
  648. InitStatusMenu();
  649. }
  650. }
  651. ///////////////////////////////////////////////////////////////////////////////
  652. // Welcome.htm
  653. ///////////////////////////////////////////////////////////////////////////////
  654. // Function: Start_LoadMe
  655. // Description: This function is called after start.htm is
  656. // loaded. we then initialize Items on the page.
  657. // we also populate the edits with any values already
  658. // found in the registry.
  659. //
  660. function Start_LoadMe()
  661. {
  662. InitFrameRef();
  663. g_FirstFocusElement = g.btnNext;
  664. g.btnNext.disabled = false;
  665. var strOEMName = g_OEMNameStr;
  666. var FirstName=window.external.UserInfo.get_FirstName();
  667. var LastName=window.external.UserInfo.get_LastName();
  668. var NameStr = "";
  669. if((FirstName.length>0) || (LastName.length>0)) {
  670. // get the right # of spaces b/w words
  671. // The name formed here should be done the same was as the owner name in
  672. // Save_Registered_owner.
  673. if(FirstName!=null) {
  674. NameStr=FirstName;
  675. }
  676. if(LastName!=null && LastName!="") {
  677. if(NameStr!="") {
  678. var L_UserFullName_Text = "%1 %2";
  679. NameStr = ApiObj.FormatMessage(L_UserFullName_Text, NameStr, LastName);
  680. } else {
  681. NameStr=LastName;
  682. }
  683. }
  684. }
  685. if (!window.external.get_RetailOOBE())
  686. {
  687. if (strOEMName.length != 0)
  688. {
  689. if (NameStr != "")
  690. {
  691. var L_NameAndOEM_Text = "Welcome %1, thank you for purchasing this computer from %2 featuring Microsoft Windows XP.";
  692. g.welcome_namestr.innerText = ApiObj.FormatMessage(L_NameAndOEM_Text, NameStr, strOEMName);
  693. }
  694. else
  695. {
  696. var L_OEM_Text = "Thank you for purchasing this computer from %1 featuring Microsoft Windows XP.";
  697. g.welcome_namestr.innerText = ApiObj.FormatMessage(L_OEM_Text, strOEMName);
  698. }
  699. }
  700. else // No OEM name
  701. {
  702. if (NameStr != "")
  703. {
  704. var L_NameAndGen_Text = "Welcome %1, thank you for purchasing this computer featuring Microsoft Windows XP.";
  705. g.welcome_namestr.innerText = ApiObj.FormatMessage(L_NameAndGen_Text, NameStr);
  706. }
  707. else
  708. {
  709. var L_Gen_Text = "Thank you for purchasing this computer featuring Microsoft Windows XP.";
  710. g.welcome_namestr.innerText = L_Gen_Text;
  711. }
  712. }
  713. }
  714. else // Retail
  715. {
  716. if (NameStr != "")
  717. {
  718. var L_NameAndXP_Text = "Welcome %1, thank you for purchasing Microsoft Windows XP.";
  719. g.welcome_namestr.innerText = ApiObj.FormatMessage(L_NameAndXP_Text, NameStr);
  720. }
  721. }
  722. g.WelcomePageText.style.display="inline";
  723. InitNewButtons();
  724. if (DirObj.get_DoWelcomeFadeIn())
  725. {
  726. // this entire 'junkspan' sequence is done so that the necessary DLL's for blendtrans
  727. //(ddraw.dll/ddrawex.dll/dxtmsft.dll/dxtrans.dll/atl.dll) are preloaded before the
  728. // real blend is done after the movie
  729. junkspan.style.filter="blendTrans(duration=10.0)"; // 10.0 is junk placeholder
  730. junkspan.filters[0].duration=0.1;
  731. junkspan.filters[0].enabled=true;
  732. junkspan.filters[0].Apply();
  733. junkspan.style.backgroundColor="red";
  734. junkspan.style.display="inline";
  735. junkspan.filters[0].Play();
  736. junkspan.style.display="none";
  737. junkspan.filters[0].enabled=false;
  738. junkspan.style.filter=null;
  739. // transition still not visible on direct boot, too much disk activity
  740. // 7 seconds appears to be visible. may need to fine tune that 4.5 number.
  741. // want to consider machine speed as well, longer number may be too long
  742. // for slow machine? (or you may need longer, since it takes longer to load?)
  743. // want fast machine to work well
  744. RunWelcomeFadeIn(3.0);
  745. }
  746. else
  747. {
  748. g_FirstFocusElement.focus();
  749. window.setTimeout("Agent_Activate('Welcome');",1000);
  750. }
  751. }
  752. function RunWelcomeFadeIn(duration)
  753. {
  754. OOBEDocBody.style.cursor = "wait";
  755. if (ScreenFrame.style.display != "none")
  756. {
  757. // need to turn off so fade transition is visible
  758. // needed if nav'ing from USB pages
  759. ScreenFrame.style.display = "none";
  760. }
  761. ScreenFrame.style.filter="blendTrans(duration=10.0)"; // 10.0 is junk placeholder
  762. ScreenFrame.filters[0].duration=duration;
  763. ScreenFrame.filters[0].enabled=true;
  764. ScreenFrame.onfilterchange=DisableScreenTransition;
  765. ScreenFrame.filters[0].Apply();
  766. ScreenFrame.style.display = "inline";
  767. ScreenFrame.filters[0].Play();
  768. }
  769. function DisableScreenTransition()
  770. {
  771. // called when transition completed
  772. OOBEDocBody.style.cursor = "default";
  773. ScreenFrame.filters[0].enabled=false;
  774. ScreenFrame.style.filter=null;
  775. g_FirstFocusElement.focus();
  776. window.setTimeout("Agent_Activate('Welcome');",1000);
  777. }
  778. // Function: Start_CheckEdits
  779. // Description: This function is called everytime an OnClick
  780. // event fires on the page. This is done so if the user
  781. // loses focus from one of the edits we can push them
  782. // in the right direction and hint them along the way
  783. // Or if all elements are filled then we enabled
  784. // the next button or if any value is 0 then we
  785. // disable the next button
  786. //
  787. function Start_CheckEdits()
  788. {
  789. try
  790. {
  791. if (g.event == null)
  792. return;
  793. }
  794. catch(e)
  795. {
  796. return;
  797. }
  798. if ((g.event.srcElement != g.edt_FirstName) &&
  799. (g.event.srcElement != g.edt_LastName))
  800. {
  801. Start_CheckEnableNextButton();
  802. }
  803. }
  804. // Function: Start_CheckEnableNextButton
  805. // Description: This function is called everytime a keyup
  806. // event fires on a edit box for first, middle, or last
  807. // name. We then see if we should enable or disable the
  808. // next button based on if every field has a value.
  809. // First || Last
  810. //
  811. function Start_CheckEnableNextButton()
  812. {
  813. try
  814. {
  815. if (g.event == null)
  816. return;
  817. }
  818. catch(e)
  819. {
  820. return;
  821. }
  822. if (Start_CheckLengthRequirement() &&
  823. Start_CheckLengthNotEqualSpaces())
  824. {
  825. g.btnNext.disabled = false;
  826. }
  827. else
  828. {
  829. g.btnNext.disabled = true;
  830. }
  831. InitNewButtons();
  832. }
  833. function Start_CheckLengthRequirement()
  834. {
  835. if ((g.edt_FirstName.value.length != 0) ||
  836. (g.edt_LastName.value.length != 0))
  837. return true;
  838. else
  839. return false;
  840. }
  841. function Start_CheckLengthNotEqualSpaces()
  842. {
  843. if ((g.edt_FirstName.value.length != NumberOfSpaces(g.edt_FirstName.value)) ||
  844. (g.edt_LastName.value.length != NumberOfSpaces(g.edt_LastName.value)))
  845. return true;
  846. else
  847. return false;
  848. }
  849. // END welcome.htm
  850. // activate.htm //////
  851. function ActivationRadioClicked()
  852. {
  853. // if they click on either button, enable the Next button
  854. if(g.btnNext.disabled && (g.rb_act_1.checked || g.rb_act_2.checked))
  855. {
  856. g.btnNext.onmouseover = HandleNextButtonMouseOver;
  857. g.btnNext.onmouseout = HandleNextButtonMouseOut;
  858. g.btnNext.onmousedown = HandleNextButtonMouseDown;
  859. g.btnNext.className="newbuttonsNext";
  860. g.btnNext.disabled = false;
  861. g.btnNext.onclick = GoNext;
  862. g.btnNext.focus();
  863. }
  864. }
  865. function Activation_LoadMe()
  866. {
  867. InitFrameRef();
  868. if (!(g.rb_act_1.checked || g.rb_act_2.checked))
  869. g.btnNext.disabled = true;
  870. var numberdaysleft = "";
  871. try
  872. {
  873. numberdaysleft = window.external.GetActivationDaysLeft();
  874. }
  875. catch(e)
  876. {
  877. numberdaysleft = "0";
  878. }
  879. g.Number_Days_Left1.innerText = numberdaysleft;
  880. InitNewButtons();
  881. g_FirstFocusElement = g.rb_txt1;
  882. g_FirstFocusElement.focus();
  883. }
  884. // acterror.htm ////
  885. function acterror_LoadMe()
  886. {
  887. InitFrameRef();
  888. var L_ActerrorTitle1_Text = "Thank you";
  889. var L_ActerrorDescr1_Text = "Windows has been activated.";
  890. var L_ActerrorTitle2_Text = "Online activation could not be completed";
  891. var L_ActerrorDescr2_Text = "The product key being used to activate this copy of Windows has exceeded the maximum number of allowed activations. This can occur if the product key has been used to activate a different computer.";
  892. var numberdaysleft = "";
  893. try
  894. {
  895. numberdaysleft = window.external.GetActivationDaysLeft();
  896. }
  897. catch(e)
  898. {
  899. numberdaysleft = "0";
  900. }
  901. g.acterror_s1.style.visibility="visible"; // Default Title: "Our online activation center could not be reached"
  902. if (g_ActivationStatus == ERR_ACT_SUCCESS)
  903. {
  904. // Change to title1 and description1
  905. g.acterror_s1.innerText = L_ActerrorTitle1_Text;
  906. g.acterror_description.innerHTML = L_ActerrorDescr1_Text;
  907. g.acterror_description.style.display="inline";
  908. g.acterror_carriagereturn.style.display="inline";
  909. }
  910. else if (g_ActivationStatus == ERR_ACT_USED_PID)
  911. {
  912. // Change to title2 and description2
  913. g.acterror_s1.innerText = L_ActerrorTitle2_Text;
  914. g.acterror_description.innerHTML = L_ActerrorDescr2_Text;
  915. g.acterror_description.style.display="inline";
  916. g.acterror_carriagereturn.style.display="inline";
  917. g.acterror_description2.style.display="inline";
  918. g.Number_Days_Left2a.innerText = numberdaysleft;
  919. g.Number_Days_Left2b.innerText = numberdaysleft;
  920. }
  921. else
  922. {
  923. g.acterror_description3.style.display="inline";
  924. g.Number_Days_Left3a.innerText = numberdaysleft;
  925. g.Number_Days_Left3b.innerText = numberdaysleft;
  926. }
  927. InitNewButtons();
  928. g_FirstFocusElement = g.btnNext;
  929. g_FirstFocusElement.focus();
  930. }
  931. // reg1.htm ////
  932. function Reg1EnableNextButton()
  933. {
  934. g.btnNext.onmouseover = HandleNextButtonMouseOver;
  935. g.btnNext.onmouseout = HandleNextButtonMouseOut;
  936. g.btnNext.onmousedown = HandleNextButtonMouseDown;
  937. g.btnNext.className="newbuttonsNext";
  938. g.btnNext.disabled = false;
  939. g.btnNext.onclick = GoNext;
  940. g.btnNext.focus();
  941. }
  942. function Reg1RadioClicked()
  943. {
  944. if (g.btnNext.disabled)
  945. {
  946. if (g_OEMRadioDisplayed && g_fRegWithMS)
  947. {
  948. if((g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked) && (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked))
  949. Reg1EnableNextButton();
  950. }
  951. else
  952. {
  953. Reg1EnableNextButton();
  954. }
  955. }
  956. }
  957. var g_Reg1PostToMSSelectDone = false;
  958. var g_Reg1PostToOEMSelectDone = false;
  959. function Reg1SaveRadioState()
  960. {
  961. if (g_fRegWithMS)
  962. {
  963. g_Reg1PostToMSSelectDone = true;
  964. if (g.rb_reg_ms_yes.checked)
  965. g_PostToMSValueHolder = true;
  966. else if (g.rb_reg_ms_no.checked)
  967. g_PostToMSValueHolder = false;
  968. else
  969. g_Reg1PostToMSSelectDone = false;
  970. }
  971. else
  972. {
  973. g_PostToMSValueHolder = false;
  974. }
  975. if (g_OEMRadioDisplayed)
  976. {
  977. g_Reg1PostToOEMSelectDone = true;
  978. if (g.rb_reg_oem_yes.checked)
  979. g_PostToOEMValueHolder=true;
  980. else if (g.rb_reg_oem_no.checked)
  981. g_PostToOEMValueHolder=false;
  982. else
  983. g_Reg1PostToOEMSelectDone = false;
  984. }
  985. else
  986. {
  987. g_PostToOEMValueHolder=false;
  988. }
  989. }
  990. var g_fRegWithMS = true;
  991. var g_OEMRadioDisplayed = false;
  992. function Reg1_LoadMe()
  993. {
  994. var L_Title1_Text = "Ready to register with %1?";
  995. var L_Title2_Text = "Ready to register with %1 and %2?";
  996. var L_Intro1_Text = "Register online with %1, and we'll notify you of new products, product updates, events, promotions, and special offers that you may be interested in. <b>Registration is optional.</b>";
  997. var L_Intro2_Text = "Register online with %1 and %2, and we'll notify you of new products, product updates, events, promotions, and special offers that you may be interested in. <b>Registration is optional.</b>";
  998. var L_Question_Text = "Are you ready to register online with %1?";
  999. var L_Answer_Text = "Y<u>e</u>s, I'd like to register with %1 now";
  1000. var L_Privacy_Text = "Show me <a TABINDEX=6 id='txtOEMReglink' style='text-decoration:underline;' href='javascript:window.parent.navigatetoPrivacy();'>the %1&nbsp;Registration Privacy Statement</a>.";
  1001. InitFrameRef();
  1002. g.OEMRow1.style.display="none";
  1003. g.OEMRow2.style.display="none";
  1004. g.OEMRow3.style.display="none";
  1005. g.MSRow1.style.display="none";
  1006. g.MSRow2.style.display="none";
  1007. g.MSRow3.style.display="none";
  1008. if (1 == RegisterObj.get_PostToOEM)
  1009. {
  1010. if (g_OEMNameStr!="")
  1011. {
  1012. // if users says Yes or No to Activation, do some dynamic text manipulation to correct text grammar.
  1013. if (g_fRegWithMS)
  1014. {
  1015. g.Reg1Title.innerText = ApiObj.FormatMessage(L_Title2_Text, g_OEMNameStr, L_MS_Text);
  1016. g.Reg1Intro.innerHTML = ApiObj.FormatMessage(L_Intro2_Text, g_OEMNameStr, L_MS_Text);
  1017. }
  1018. else
  1019. {
  1020. g.Reg1Title.innerText = ApiObj.FormatMessage(L_Title1_Text, g_OEMNameStr);
  1021. g.Reg1Intro.innerHTML = ApiObj.FormatMessage(L_Intro1_Text, g_OEMNameStr);
  1022. }
  1023. // Show the OEM Registration radio buttons, its text, and the OEM Privacy Policy.
  1024. g.reg1_oem_TxtQuestion.innerText = ApiObj.FormatMessage(L_Question_Text, g_OEMNameStr);
  1025. g.reg1_spn3.innerHTML = ApiObj.FormatMessage(L_Answer_Text, g_OEMNameStr);
  1026. g.Reg1oem5.innerHTML = ApiObj.FormatMessage(L_Privacy_Text, g_OEMNameStr);
  1027. g.OEMRow1.style.display="inline";
  1028. g.OEMRow2.style.display="inline";
  1029. g.OEMRow3.style.display="inline";
  1030. g.reg1_oem_TxtQuestion.style.visibility="visible";
  1031. g.Reg1oem1.style.visibility="visible";
  1032. g.Reg1oem2.style.visibility="visible";
  1033. g.Reg1oem3.style.visibility="visible";
  1034. g.Reg1oem4.style.visibility="visible";
  1035. g.Reg1oem5.style.display="inline";
  1036. g_FirstFocusElement = g.rb_reg_oem_yes;
  1037. g_OEMRadioDisplayed = true;
  1038. }
  1039. else
  1040. {
  1041. g.Reg1Title.innerText = L_MissingOEMName_Text;
  1042. }
  1043. }
  1044. else
  1045. {
  1046. g.Reg1Title.innerText = ApiObj.FormatMessage(L_Title1_Text, L_MS_Text);
  1047. g.Reg1Intro.innerHTML = ApiObj.FormatMessage(L_Intro1_Text, L_MS_Text);
  1048. }
  1049. // if users says Yes to Activation, we show the MS Registration radio button, its text, and the MS Privacy Policy.
  1050. if (g_fRegWithMS)
  1051. {
  1052. g.MSRow1.style.display="inline";
  1053. g.MSRow2.style.display="inline";
  1054. g.MSRow3.style.display="inline";
  1055. g.reg1_ms_TxtQuestion.style.visibility="visible";
  1056. g.rb_reg_ms_yes.style.visibility="visible";
  1057. g.reg1_txt1.style.visibility="visible";
  1058. g.rb_reg_ms_no.style.visibility="visible";
  1059. g.reg1_txt2.style.visibility="visible";
  1060. g.Reg1Info.style.display="inline";
  1061. g.Reg1MS1.style.display="inline";
  1062. g_FirstFocusElement = g.rb_reg_ms_yes;
  1063. }
  1064. else
  1065. {
  1066. // This is to solve the problem of whenever a user says Yes to Activation,
  1067. // then yes to MS and OEM Registration in Reg1 (assuming posttooem=1),
  1068. // then clicks back and selected No to Activation then clicked next.
  1069. // Reg1 will have the OEM registration radio buttons, the MS radio buttons
  1070. // are hidden, but it's value internally is set to true. So we need to set
  1071. // it to false.
  1072. g_PostToMS = false;
  1073. g_PostToMSValueHolder = false;
  1074. InfoObj.set_MSOffer(false);
  1075. InfoObj.set_OtherOffer(false);
  1076. }
  1077. g.Reg1Title.style.visibility="visible";
  1078. g.Reg1Intro.style.visibility="visible";
  1079. // We use the following code to restore the checkbox selection whenever we go back to this page.
  1080. if (g_Reg1PostToMSSelectDone)
  1081. {
  1082. if (g_PostToMSValueHolder)
  1083. g.rb_reg_ms_yes.checked = true;
  1084. else
  1085. g.rb_reg_ms_no.checked = true;
  1086. }
  1087. if (g_Reg1PostToOEMSelectDone)
  1088. {
  1089. if (g_PostToOEMValueHolder)
  1090. g.rb_reg_oem_yes.checked = true;
  1091. else
  1092. g.rb_reg_oem_no.checked = true;
  1093. }
  1094. // We use the following code to determine if we need to enable the Next button or not.
  1095. if ((g_OEMRadioDisplayed) && (g_fRegWithMS))
  1096. {
  1097. if ((g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked) && (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked))
  1098. Reg1EnableNextButton();
  1099. else
  1100. g.btnNext.disabled = true;
  1101. }
  1102. else if ((!g_OEMRadioDisplayed) && (g_fRegWithMS))
  1103. {
  1104. if (g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked)
  1105. Reg1EnableNextButton();
  1106. else
  1107. g.btnNext.disabled = true;
  1108. }
  1109. else if ((g_OEMRadioDisplayed) && (!g_fRegWithMS))
  1110. {
  1111. if (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked)
  1112. Reg1EnableNextButton();
  1113. else
  1114. g.btnNext.disabled = true;
  1115. }
  1116. InitNewButtons();
  1117. if (g_FirstFocusElement != null)
  1118. g_FirstFocusElement.focus();
  1119. }
  1120. // oempriv.htm //////
  1121. function OEMPrivacyPolicy(SimpleBack, SimpleNext)
  1122. {
  1123. var L_Privacy1_Text = "%1 Privacy Statement";
  1124. InitFrameRef();
  1125. g_FirstFocusElement = g.btnBack;
  1126. InitNewButtons(SimpleBack, SimpleNext);
  1127. g.spn_privacy_oemname1.innerText = ApiObj.FormatMessage(L_Privacy1_Text, g_OEMNameStr);
  1128. g.spn_privacy_oemname2.innerText = g_OEMNameStr;
  1129. g.spn_privacy_oemname3.innerText = g_OEMNameStr;
  1130. g_FirstFocusElement.focus();
  1131. }
  1132. // reg2.htm //////
  1133. var g_Reg2EmailName="";
  1134. var g_Reg2MachineName="";
  1135. var g_Reg2PW="";
  1136. function Reg2SaveSettings() {
  1137. // restore fields
  1138. g_Reg2EmailName= g.emailname.value;
  1139. g_Reg2MachineName= g.machinename.value;
  1140. g_Reg2PW=g.passwd.value;
  1141. }
  1142. function Reg2_LoadMe() {
  1143. InitFrameRef();
  1144. g_FirstFocusElement = g.emailname;
  1145. // restore fields
  1146. g.emailname.value = g_Reg2EmailName;
  1147. g.machinename.value = g_Reg2MachineName;
  1148. g.passwd.value = g_Reg2PW;
  1149. InitNewButtons();
  1150. if (g_FirstFocusElement != null)
  1151. g_FirstFocusElement.focus();
  1152. }
  1153. function Reg2_RemindMe()
  1154. {
  1155. // BUGBUG: need to fill in later
  1156. /*
  1157. Following Windows Welcome, Microsoft will send you an e-mail message explaining how to retrieve your password. You can then register Windows from the Start menu.
  1158. */
  1159. }
  1160. function Default_radioClicked()
  1161. {
  1162. try
  1163. {
  1164. if (g.event == null)
  1165. return;
  1166. }
  1167. catch(e)
  1168. {
  1169. return;
  1170. }
  1171. g.btnNext.disabled = false;
  1172. InitNewButtons();
  1173. }
  1174. //// reg3.htm ///////////////////////
  1175. var g_PostToMS = true;
  1176. var g_PostToOEM = true;
  1177. var POST_TO_OEM = 1;
  1178. var POST_TO_MS = 2;
  1179. var g_PostToMSValueHolder = g_PostToMS;
  1180. var g_PostToOEMValueHolder = g_PostToOEM;
  1181. var StateAbbrevs = new Array("","AL","AK","AZ","AR","CA","CO","CT","DC","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY");
  1182. var FullStateNames = new Array("Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Washington, D.C.","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming");
  1183. var ProvinceNames = new Array("","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon");
  1184. // need ability to map state name string to index into StateAbbrevs
  1185. var g_StateName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  1186. g_StateName2IndexMap.CompareMode = COMPAREMODE_TEXT;
  1187. var g_ProvinceName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  1188. g_ProvinceName2IndexMap.CompareMode = COMPAREMODE_TEXT;
  1189. // windows scripting host -- used to send fake keybd events for keyboard helper on PID page
  1190. var WshShell = new ActiveXObject("WScript.Shell");
  1191. // init hash table
  1192. var ii;
  1193. for(ii=1;ii<=FullStateNames.length;ii++) {
  1194. // add both full name and abbrev to hash table
  1195. g_StateName2IndexMap.Add(FullStateNames[ii-1].toUpperCase(),ii);
  1196. g_StateName2IndexMap.Add(StateAbbrevs[ii].toUpperCase(),ii);
  1197. if(ii < ProvinceNames.length) {
  1198. g_ProvinceName2IndexMap.Add(ProvinceNames[ii].toUpperCase(),ii);
  1199. }
  1200. }
  1201. var L_Postal_Text = "Postal or <u>Z</u>IP code:";
  1202. var L_AsteriskPostal_Text = "*Postal or <u>Z</u>IP code:";
  1203. var L_Province_Text= "State/<u>P</u>rovince:";
  1204. var L_AsteriskProvince_Text= "*State/<u>P</u>rovince:";
  1205. var L_Canada_Text="Canada";
  1206. var L_UnitedStates_Text="United States";
  1207. function Reg3UserCountryChanged() {
  1208. // AGENT: notify Agent of the change
  1209. Agent_OnSelectChange(g.selCountry);
  1210. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  1211. if(g_Country == L_UnitedStates_Text) {
  1212. // when changing to US, try to translate any textbox string to state index
  1213. if(g.UserStateTextBox.value!="") {
  1214. var res=g_StateName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  1215. if(res!=null) {
  1216. g.selUSState.selectedIndex=res;
  1217. }
  1218. }
  1219. g.selCAProvince.style.display="none";
  1220. g.UserStateTextBox.style.display="none";
  1221. if(g.selUSState.style.display!="inline") {
  1222. g.selUSState.style.display="inline";
  1223. }
  1224. //g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  1225. //g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  1226. g.Reg3StateProvinceOptional.style.display="none";
  1227. g.Reg3ZipPostalCodeOptional.style.display="none";
  1228. // g.StateLabel.htmlFor="selUSState";
  1229. } else if(g_Country == L_Canada_Text) {
  1230. // when changing to Canada, try to translate any textbox string to province index
  1231. if(g.UserStateTextBox.value!="") {
  1232. var res=g_ProvinceName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  1233. if(res!=null) {
  1234. g.selCAProvince.selectedIndex=res;
  1235. }
  1236. }
  1237. g.selUSState.style.display="none";
  1238. g.UserStateTextBox.style.display="none";
  1239. g.selCAProvince.style.display="inline";
  1240. //g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  1241. //g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  1242. g.Reg3StateProvinceOptional.style.display="none";
  1243. g.Reg3ZipPostalCodeOptional.style.display="none";
  1244. // g.StateLabel.htmlFor="selCAProvince";
  1245. } else {
  1246. g.selUSState.style.display="none";
  1247. g.selCAProvince.style.display="none";
  1248. g.UserStateTextBox.style.display="inline";
  1249. g.LabelZIP.innerHTML = L_Postal_Text;
  1250. g.StateLabel.innerHTML = L_Province_Text;
  1251. g.Reg3StateProvinceOptional.style.display="inline";
  1252. if (IsFarEastLocale())
  1253. {
  1254. g.FE_Reg3ZipPostalCodeOptional.style.display="inline";
  1255. g.Reg3ZipPostalCodeOptional.style.display="none";
  1256. }
  1257. else
  1258. {
  1259. g.Reg3ZipPostalCodeOptional.style.display="inline";
  1260. }
  1261. // g.StateLabel.htmlFor="UserStateTextBox";
  1262. }
  1263. g_CountryIdx=g.selCountry.selectedIndex;
  1264. Reg3UserStateChanged();
  1265. }
  1266. function Reg3UserStateChanged() {
  1267. // AGENT: notify Agent of the change
  1268. // BUGBUG: ok for no notify on change to textbox?
  1269. Agent_OnSelectChange((g.selUSState.style.display != "none") ? g.selUSState : g.selCAProvince);
  1270. if(g.selUSState.style.display!="none")
  1271. {
  1272. g_StateIdx=g.selUSState.selectedIndex;
  1273. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  1274. }
  1275. else if (g.selCAProvince.style.display!="none")
  1276. {
  1277. g_StateIdx=g.selCAProvince.selectedIndex;
  1278. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  1279. }
  1280. else
  1281. {
  1282. g_State = g.UserStateTextBox.value;
  1283. }
  1284. }
  1285. // store field info here:
  1286. var g_FirstName=InfoObj.get_FirstName();
  1287. //var g_MiddleName=InfoObj.get_MiddleInitial(); // InfoObj.get_MiddleName(); BUGBUG need to add this fn
  1288. var g_LastName=InfoObj.get_LastName();
  1289. var g_Address1=InfoObj.get_Address1();
  1290. var g_Address2=InfoObj.get_Address2();
  1291. var g_City=InfoObj.get_City();
  1292. var g_ZipCode=InfoObj.get_Zip();
  1293. var g_EmailAddr= InfoObj.get_PrimaryEmail();
  1294. var g_Country=InfoObj.get_Country();
  1295. var g_CountryIdx=-1;
  1296. var g_State=InfoObj.get_State();
  1297. var g_StateIdx=0;
  1298. function Reg3SaveSettings()
  1299. {
  1300. g_FirstName=g.UserFirstName.value;
  1301. //g_MiddleName=g.UserMiddleName.value;
  1302. if (IsKoreanLocale())
  1303. g_LastName="";
  1304. else
  1305. g_LastName=g.UserLastName.value;
  1306. g_Address1=g.UserAddress.value;
  1307. g_Address2=g.UserAddress2.value;
  1308. g_ZipCode=g.UserZipCode.value;
  1309. g_EmailAddr=g.UserEmailAddress.value;
  1310. g_City=g.UserCity.value;
  1311. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  1312. if(g.UserStateTextBox.style.display!="none")
  1313. {
  1314. g_State=g.UserStateTextBox.value;
  1315. }
  1316. else if (g.selUSState.style.display!="none")
  1317. {
  1318. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  1319. }
  1320. else
  1321. {
  1322. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  1323. }
  1324. InfoObj.set_FirstName(g_FirstName);
  1325. InfoObj.set_LastName(g_LastName);
  1326. //InfoObj.set_MiddleInitial(g_MiddleName);
  1327. InfoObj.set_Country(g_Country);
  1328. InfoObj.set_State(g_State);
  1329. InfoObj.set_Address1(g_Address1);
  1330. InfoObj.set_Address2(g_Address2);
  1331. InfoObj.set_PrimaryEmail(g_EmailAddr);
  1332. InfoObj.set_Zip(g_ZipCode);
  1333. InfoObj.set_City(g_City);
  1334. TapiObj.set_CountryIndex(g.selCountry.selectedIndex);
  1335. InfoObj.set_CountryID(TapiObj.get_CountryID());
  1336. // Microsoft policy states that MSupdate should always be true whenever a user registers.
  1337. InfoObj.set_MSUpdate(true);
  1338. InfoObj.set_MSOffer(false);
  1339. if ((g_PostToMS==true) && (g.sharemsonly.checked))
  1340. InfoObj.set_MSOffer(true);
  1341. InfoObj.set_OtherOffer(false);
  1342. if ((g_PostToMS==true) && (g.sharems.checked))
  1343. InfoObj.set_OtherOffer(true);
  1344. }
  1345. var L_FullName_Text ="*<u>F</u>ull Name:";
  1346. // We want the Reg3 checkboxes to be unchecked by default.
  1347. InfoObj.set_MSOffer(false);
  1348. InfoObj.set_OtherOffer(false);
  1349. function Reg3_LoadMe()
  1350. {
  1351. // AGENT: we don't want Agent to process any events
  1352. // that might occur as a result of initializing the
  1353. // controls.
  1354. Agent_IgnoreEvents(true);
  1355. InitFrameRef();
  1356. var fTapi = TapiObj.IsTAPIConfigured(); // init TAPI
  1357. var CountryOptStr=TapiObj.get_AllCountryName();
  1358. // we used to do a document.write() to put this into selCountry. IE 5.5 seems to
  1359. // have redraw probs with long doc.writes, so parse it out and add it once in onload
  1360. var i;
  1361. var oOption;
  1362. var regexp1=/<OPTION>/g;
  1363. var tmpOptsStr = CountryOptStr.replace(regexp1, ""); //delete <OPTION>
  1364. var OptStrArray = tmpOptsStr.split("</OPTION>");
  1365. for(i=0; i < OptStrArray.length; i++) {
  1366. oOption = g.document.createElement("OPTION");
  1367. oOption.text = OptStrArray[i];
  1368. g.selCountry.add(oOption);
  1369. }
  1370. g.selCountry.onchange=Reg3UserCountryChanged;
  1371. g_FirstFocusElement = g.UserFirstName;
  1372. if (IsFarEastLocale())
  1373. {
  1374. /*For JPN, CHT, CHS,
  1375. Last Name
  1376. First Name
  1377. Country/Region
  1378. Province
  1379. City
  1380. Address
  1381. Zip
  1382. E-Mail
  1383. For KOR only,
  1384. Full Name
  1385. Country/Region
  1386. Province
  1387. City
  1388. Address
  1389. Zip
  1390. E-Mail
  1391. */
  1392. g.MainPageCell.style.display="none"; // hide while we change order
  1393. // no middle name for far east langs
  1394. // g.MiddleNameRow.style.display="none";
  1395. g.FieldTable.moveRow(1,0); // move lastname in front of first
  1396. g.FieldTable.moveRow(7,2); // move country to after firstname
  1397. g.FieldTable.moveRow(6,3); // move province to after country
  1398. g.FieldTable.moveRow(6,4); // move city to after province
  1399. g.FE_ZIPLabel.innerHTML=g.LabelRight.innerHTML;
  1400. g.FE_ZIPInput.innerHTML=g.MenuRight.innerHTML;
  1401. g.FE_ZIPRow.style.display="inline";
  1402. g.LabelRight.innerHTML="";
  1403. g.MenuRight.innerHTML="";
  1404. // no reason to limit these lengths for FE, so just make them match others
  1405. g.UserZipCode.size=30;
  1406. g.UserZipCode.maxlength=120;
  1407. g.UserStateTextBox.size=30;
  1408. g.UserStateTextBox.maxlength=120;
  1409. g_FirstFocusElement = g.UserLastName;
  1410. if (IsKoreanLocale()) {
  1411. g.LastNameRow.style.display="none";
  1412. g.LabelFirstName.innerHTML=L_FullName_Text;
  1413. g_FirstFocusElement = g.UserFirstName;
  1414. }
  1415. g.MainPageCell.style.display="inline";
  1416. }
  1417. // limit width of country menu since some text options are very long
  1418. g.selCountry.style.width=g.UserEmailAddress.offsetWidth;
  1419. g.UserFirstName.value=g_FirstName;
  1420. //g.UserMiddleName.value=g_MiddleName;
  1421. if (!IsKoreanLocale())
  1422. g.UserLastName.value=g_LastName;
  1423. g.UserAddress.value=g_Address1;
  1424. g.UserAddress2.value=g_Address2;
  1425. g.UserZipCode.value=g_ZipCode;
  1426. g.UserEmailAddress.value=g_EmailAddr;
  1427. g.UserCity.value=g_City;
  1428. // placeholder idx 0 option is needed to fix 101447
  1429. // Due to a possible mshtml bug, the cursor is shifted right when the menu
  1430. // expands to its full width.
  1431. g.selUSState.remove(0);
  1432. for (var i = 0; i < StateAbbrevs.length; i++) {
  1433. var oOption = g.document.createElement("OPTION");
  1434. oOption.text = StateAbbrevs[i];
  1435. if (StateAbbrevs[i] == g_State)
  1436. {
  1437. g_StateIdx = i;
  1438. }
  1439. g.selUSState.add(oOption);
  1440. }
  1441. for (i = 0; i < ProvinceNames.length; i++) {
  1442. oOption = g.document.createElement("OPTION");
  1443. oOption.text = ProvinceNames[i];
  1444. if (ProvinceNames[i] == g_State)
  1445. {
  1446. g_StateIdx = i;
  1447. }
  1448. g.selCAProvince.add(oOption);
  1449. }
  1450. // Note: the way code below is written, g_CountryIdx always >=0 so 2nd branch never
  1451. // taken. causes no probs though
  1452. g_CountryIdx = TapiObj.get_CountryIndex();
  1453. if(g_CountryIdx>=0)
  1454. {
  1455. g.selCountry.selectedIndex=g_CountryIdx;
  1456. if(g_Country == L_UnitedStates_Text)
  1457. {
  1458. g.selUSState.selectedIndex=g_StateIdx;
  1459. }
  1460. else if(g_Country == L_Canada_Text)
  1461. {
  1462. g.selCAProvince.selectedIndex=g_StateIdx;
  1463. }
  1464. else
  1465. g.UserStateTextBox.value=g_State;
  1466. }
  1467. else
  1468. {
  1469. // get default value
  1470. g.selCountry.selectedIndex = TapiObj.get_CountryIndex();
  1471. }
  1472. Reg3UserCountryChanged();
  1473. g.MainPageCell.style.visibility="visible";
  1474. g_PostToMS = g_PostToMSValueHolder;
  1475. g_PostToOEM = g_PostToOEMValueHolder;
  1476. // For complete checkbox behavior specs, see bug 321512
  1477. // If user says Yes to Register with MS in Reg1, Show the two checkboxes:
  1478. // o Send me promotions and offers from Microsoft.
  1479. // o Send me promotions and offers from Microsoft's partners.
  1480. // =======================================================================
  1481. if (g_PostToMS==true)
  1482. {
  1483. g.RegChkBxMSOnlyGrp.style.display = "inline";
  1484. g.RegChkBxMSGrp.style.display = "inline";
  1485. var MSoffer_Checked = InfoObj.get_MSOffer();
  1486. if (MSoffer_Checked)
  1487. g.sharemsonly.checked = true;
  1488. else
  1489. g.sharemsonly.checked = false;
  1490. var MSotheroffer_Checked = InfoObj.get_OtherOffer();
  1491. if (MSotheroffer_Checked)
  1492. g.sharems.checked = true;
  1493. else
  1494. g.sharems.checked = false;
  1495. }
  1496. InitNewButtons();
  1497. // since our code in this function needs focus between the firstname or the lastname field, and
  1498. // not on any button or object, we will use this next line of code to make the textbox focus or
  1499. // highlight if there will be any values in it.
  1500. g_FirstFocusElement.select();
  1501. g_FirstFocusElement.focus();
  1502. // AGENT: now we want event processing
  1503. Agent_IgnoreEvents(false);
  1504. // legal message for France, Belgium, or other localization
  1505. var L_CNIL_Text = "<p>";
  1506. var L_CnilStyleDisplay_Text = "none";
  1507. g.cnil_mesg.innerHTML = L_CNIL_Text;
  1508. g.cnil_mesg.style.display=L_CnilStyleDisplay_Text;
  1509. }
  1510. function GetCurrentProvince()
  1511. {
  1512. if(g.selCountry.options(g.selCountry.selectedIndex).text == L_UnitedStates_Text) {
  1513. return g.selUSState.options(g.selUSState.selectedIndex).text;
  1514. } else if(g.selCountry.options(g.selCountry.selectedIndex).text == L_Canada_Text) {
  1515. return g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  1516. } else return g.UserStateTextBox.value;
  1517. }
  1518. function GetCurrentCountry()
  1519. {
  1520. return g.selCountry.options(g.selCountry.selectedIndex).text;
  1521. }
  1522. var L_EnterValid_Text="Please fill in the required fields.";
  1523. var L_Email_Text="Please enter a valid E-mail address or leave the E-mail text box empty.";
  1524. var L_MS_Text="Microsoft";
  1525. function FormatRequiredFieldLabel(element,error)
  1526. {
  1527. if (error)
  1528. {
  1529. element.className = "text-error";
  1530. if (!(element.innerHTML.charAt(0) == "*"))
  1531. {
  1532. element.innerHTML = "* " + element.innerHTML
  1533. }
  1534. }
  1535. else
  1536. {
  1537. element.className = "text-primary";
  1538. if ((element.innerHTML.charAt(0) == "*"))
  1539. {
  1540. element.innerHTML = element.innerHTML.substring(2,(element.innerHTML.length - 1));
  1541. }
  1542. }
  1543. }
  1544. function VerifyReg3Fields()
  1545. {
  1546. g.error_mesg.style.display="none";
  1547. var LastErrorField = null;
  1548. var CurReg3ErrStringArray = new Array();
  1549. // user needs to complete input of address/name
  1550. // this dynamically builds the list of erroneous fields to give to the user
  1551. if(g.UserEmailAddress.value != "") {
  1552. // do some validation on email address
  1553. // Note special regexpr char like '\S' must be double-\'d because they are inside a string
  1554. var re = new RegExp("^\\s*\\S+@\\S+\\.\\S\\S+","");
  1555. if(re.exec(g.UserEmailAddress.value) == null) {
  1556. LastErrorField = g.UserEmailAddress;
  1557. FormatRequiredFieldLabel(g.LabelEmail,1);
  1558. } else {
  1559. FormatRequiredFieldLabel(g.LabelEmail,0);
  1560. }
  1561. }
  1562. var CurCountry=GetCurrentCountry();
  1563. // dont require state or zip except for US/Canada
  1564. if ((CurCountry == L_UnitedStates_Text)||(CurCountry == L_Canada_Text)) {
  1565. if(g.UserZipCode.value == "") {
  1566. LastErrorField = g.UserZipCode;
  1567. FormatRequiredFieldLabel(g.LabelZIP,1);
  1568. } else {
  1569. FormatRequiredFieldLabel(g.LabelZIP,0);
  1570. }
  1571. if(GetCurrentProvince() == "") {
  1572. if(g.selUSState.style.display!="none") {
  1573. LastErrorField = g.selUSState;
  1574. } else {
  1575. LastErrorField = g.selCAProvince;
  1576. }
  1577. FormatRequiredFieldLabel(g.StateLabel,1);
  1578. } else {
  1579. FormatRequiredFieldLabel(g.StateLabel,0);
  1580. }
  1581. }
  1582. if(g.UserCity.value == "") {
  1583. LastErrorField = g.UserCity;
  1584. FormatRequiredFieldLabel(g.LabelCity,1);
  1585. } else {
  1586. FormatRequiredFieldLabel(g.LabelCity,0);
  1587. }
  1588. if(g.UserAddress.value == "") {
  1589. LastErrorField = g.UserAddress;
  1590. FormatRequiredFieldLabel(g.LabelAddress,1);
  1591. } else {
  1592. FormatRequiredFieldLabel(g.LabelAddress,0);
  1593. }
  1594. if((g.UserLastName.value == "") && (g.LastNameRow.style.display!="none")) {
  1595. LastErrorField = g.UserLastName;
  1596. FormatRequiredFieldLabel(g.LabelLastName,1);
  1597. } else {
  1598. FormatRequiredFieldLabel(g.LabelLastName,0);
  1599. }
  1600. if(g.UserFirstName.value == "") {
  1601. LastErrorField = g.UserFirstName;
  1602. FormatRequiredFieldLabel(g.LabelFirstName,1);
  1603. } else {
  1604. FormatRequiredFieldLabel(g.LabelFirstName,0);
  1605. }
  1606. if(LastErrorField==null) {
  1607. return true;
  1608. }
  1609. // handle error
  1610. if(LastErrorField==g.UserEmailAddress) {
  1611. g.error_mesg.innerText = L_Email_Text;
  1612. } else {
  1613. g.error_mesg.innerText = L_EnterValid_Text;
  1614. }
  1615. g.error_mesg.className = "text-error";
  1616. g.error_mesg.style.display="inline";
  1617. try
  1618. {
  1619. g.btnNext.disabled=false;
  1620. }
  1621. catch(e) {}
  1622. try
  1623. {
  1624. g.btnBack.disabled=false;
  1625. }
  1626. catch(e) {}
  1627. try
  1628. {
  1629. g.btnSkip.disabled=false;
  1630. }
  1631. catch(e) {}
  1632. InitNewButtons();
  1633. LastErrorField.focus();
  1634. return false;
  1635. }
  1636. ///////////////////////////////////////////////////////////////////////////////
  1637. // tapi.htm
  1638. ///////////////////////////////////////////////////////////////////////////////
  1639. function TapiLoadMe()
  1640. {
  1641. InitFrameRef();
  1642. ResetDialing();
  1643. g_FirstFocusElement = g.selCountry;
  1644. if (null == TapiObj)
  1645. {
  1646. TapiObj = new Object;
  1647. TapiObj = window.external.Tapi;
  1648. }
  1649. RetrieveTapi();
  1650. Tapi_CountryChange();
  1651. g_FirstFocusElement.focus();
  1652. }
  1653. function Tapi_AreaCodeChange()
  1654. {
  1655. try
  1656. {
  1657. if (g.event == null)
  1658. return;
  1659. }
  1660. catch(e)
  1661. {
  1662. return;
  1663. }
  1664. if (window.external.Tapi.IsAreaCodeRequired(g.selCountry.selectedIndex) &&
  1665. window.external.CheckPhoneBook("msobe.isp") &&
  1666. g.edtAreaCode.value.length == 0)
  1667. g.btnNext.disabled = true;
  1668. else
  1669. g.btnNext.disabled = false;
  1670. InitNewButtons();
  1671. }
  1672. function Tapi_CountryChange()
  1673. {
  1674. try
  1675. {
  1676. if (g.event == null)
  1677. return;
  1678. }
  1679. catch(e)
  1680. {
  1681. return;
  1682. }
  1683. TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
  1684. if (window.external.CheckPhoneBook("msobe.isp"))
  1685. {
  1686. g.div_MSNNotAvailable.style.visibility = "hidden";
  1687. g.spn_AdditionalSettings.style.visibility = "visible";
  1688. g_DialingAvailableInCountry = true;
  1689. }
  1690. else
  1691. {
  1692. g.div_MSNNotAvailable.style.visibility = "visible";
  1693. g.spn_AdditionalSettings.style.visibility = "hidden";
  1694. g_DialingAvailableInCountry = false;
  1695. }
  1696. tapi_OutsideLineClicked();
  1697. Tapi_AreaCodeChange();
  1698. }
  1699. function StoreTapi()
  1700. {
  1701. TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
  1702. TapiObj.set_AreaCode = g.edtAreaCode.value;
  1703. if(g.radioTouchToneYes.checked)
  1704. TapiObj.set_PhoneSystem = 1; //touch tone
  1705. else
  1706. TapiObj.set_PhoneSystem = 0; //rotary
  1707. TapiObj.set_DialOut = g.edtOutsideLine.value;
  1708. }
  1709. function RetrieveTapi()
  1710. {
  1711. var fTapi = TapiObj.IsTAPIConfigured;
  1712. g.selCountry.selectedIndex = TapiObj.get_CountryIndex;
  1713. g.edtAreaCode.value = TapiObj.get_AreaCode;
  1714. if(1 == TapiObj.get_PhoneSystem)
  1715. g.radioTouchToneYes.checked = true; //touch tone
  1716. else
  1717. g.radioTouchToneNo.checked = true; //rotary
  1718. g.edtOutsideLine.value = TapiObj.get_DialOut;
  1719. if(g.edtOutsideLine.value != "")
  1720. g.radioOutSideLineYes.checked = true; //use a number to dial out
  1721. else
  1722. g.radioOutSideLineNo.checked = true; //don't use a number to dial out
  1723. }
  1724. function tapi_OutsideLineClicked()
  1725. {
  1726. try
  1727. {
  1728. if (g.event == null)
  1729. return;
  1730. }
  1731. catch(e)
  1732. {
  1733. return;
  1734. }
  1735. if (g.radioOutSideLineYes.checked == true &&
  1736. g.spn_AdditionalSettings.style.visibility == "visible")
  1737. {
  1738. g.spanOutsideLine.style.visibility = "visible";
  1739. g.edtOutsideLine.style.visibility = "visible";
  1740. g.edtOutsideLine.value = TapiObj.get_DialOut;
  1741. if (g.edtOutsideLine.value.length == 0)
  1742. g.edtOutsideLine.value = "9";
  1743. }
  1744. else
  1745. {
  1746. g.spanOutsideLine.style.visibility = "hidden";
  1747. g.edtOutsideLine.style.visibility = "hidden";
  1748. g.spanOutsideLine.style.visibility = "hidden";
  1749. g.edtOutsideLine.value = ""; //nuke out any outside line value
  1750. }
  1751. }
  1752. // END tapi.htm
  1753. // EULAWarn.htm
  1754. function EULAWarn_LoadMe()
  1755. {
  1756. InitFrameRef();
  1757. g_FirstFocusElement = g.btnBack;
  1758. if (g_EULA_OEM)
  1759. {
  1760. var L_BadEulaMSOEM1_TEXT = "You need to accept the End User License Agreement before you can use Windows. This legal agreement between you and Microsoft and %1 states the terms of use of Windows.";
  1761. g.EULAWarn_INFO1.innerText = ApiObj.FormatMessage(L_BadEulaMSOEM1_TEXT, g_OEMNameStr);
  1762. }
  1763. InitNewButtons();
  1764. g_FirstFocusElement.focus();
  1765. }
  1766. // END EULAWarn.htm
  1767. ///////////////////////////////////////////////////////////////////////////////
  1768. // General Default LoadMe function
  1769. ///////////////////////////////////////////////////////////////////////////////
  1770. function _Default_LoadMe(SimpleBack, SimpleNext)
  1771. {
  1772. InitFrameRef();
  1773. InitButtons(SimpleBack, SimpleNext);
  1774. if (g.btnNext.style.visibility == "visible")
  1775. g_FirstFocusElement = g.btnNext;
  1776. else if (g.btnSkip.style.visibility == "visible")
  1777. g_FirstFocusElement = g.btnSkip;
  1778. else if (g.btnBack.style.visibility == "visible")
  1779. g_FirstFocusElement = g.btnBack;
  1780. if (g_FirstFocusElement != null)
  1781. g_FirstFocusElement.focus();
  1782. else
  1783. g.document.body.focus();
  1784. }
  1785. function New_Default_LoadMe(SimpleBack, SimpleNext)
  1786. {
  1787. InitFrameRef();
  1788. InitNewButtons(SimpleBack, SimpleNext);
  1789. if (g.btnNext.style.visibility == "visible")
  1790. g_FirstFocusElement = g.btnNext;
  1791. else if (g.btnSkip.style.visibility == "visible")
  1792. g_FirstFocusElement = g.btnSkip;
  1793. else if (g.btnBack.style.visibility == "visible")
  1794. g_FirstFocusElement = g.btnBack;
  1795. if (g_FirstFocusElement != null)
  1796. g_FirstFocusElement.focus();
  1797. else
  1798. g.document.body.focus();
  1799. }
  1800. ///////////////////////////////////////////////////////////////////////////////
  1801. // eula.htm
  1802. ///////////////////////////////////////////////////////////////////////////////
  1803. function HandleTextAreaFocus() {
  1804. g.event.srcElement.style.borderStyle="ridge";
  1805. }
  1806. function HandleTextAreaBlur() {
  1807. g.event.srcElement.style.borderStyle="";
  1808. }
  1809. var g_EULA_OEM = false;
  1810. var g_fileEULA = null;
  1811. var g_EULA_radiosticky = null; // variable to make EULA radio buttons sticky
  1812. function EulaLoadMe()
  1813. {
  1814. InitFrameRef();
  1815. if (window.external.GetNoWelcomeFinish())
  1816. {
  1817. g.btnNext = g.btnFinish;
  1818. g.FiniBtnLocalText.style.display = "inline";
  1819. g.btnFinish.style.display = "inline";
  1820. g.ToContinueFinishSpn.style.display = "inline";
  1821. }
  1822. else
  1823. {
  1824. g.ToContinueNextSpn.style.display = "inline";
  1825. g.NextBtnLocalText.style.display = "inline";
  1826. g.btnNext.style.display = "inline";
  1827. }
  1828. var L_strBadEULA_Text = "Setup was unable to display the End User License Agreement. Setup will now close.";
  1829. g_fileEULA = EulaObj.ValidateEULA();
  1830. if (0 == g_fileEULA.length)
  1831. {
  1832. alert(L_strBadEULA_Text);
  1833. window.external.PowerDown(POWERDOWN_SHUTDOWN);
  1834. }
  1835. if (IsKoreanLocale())
  1836. {
  1837. g.txtEULA.cols=95;
  1838. g.txtEULA2.cols=95;
  1839. }
  1840. if (1 == window.external.GetOEMEula())
  1841. {
  1842. g.EULA_par1_MS_OEM.style.display="inline"; // show "The End User License Agreements..."
  1843. g.EulaOEMSpan.style.display="inline"; // show the OEM textarea
  1844. if(g_bInHighScreenRes)
  1845. {
  1846. g.txtEULA.rows=13; // increase the number of rows of MS textarea, for 1024x786 resolution
  1847. g.txtEULA2.rows=13; // increase the number of rows of OEM textarea, for 1024x786 resolution
  1848. }
  1849. g.AcceptMSOEM_EulaText.style.display="inline"; // show "Do you accept the terms of the EULAs"
  1850. g.EULA_MS_OEM_accept.style.display="inline" // show "Yes, I accept them"
  1851. g.EULA_MS_OEM_decline.style.display="inline" // show "No, I don't accept them"
  1852. Populate_MS_EulaTextArea(); // populate MS textarea
  1853. Populate_OEM_EulaTextArea(); // populate OEM textarea
  1854. g_EULA_OEM = true;
  1855. }
  1856. else
  1857. {
  1858. g.EULA_par1_MSonly.style.display="inline"; // show "The End User License Agreement..."
  1859. if(g_bInHighScreenRes)
  1860. g.txtEULA.rows=29; // increase the number of rows of MS textarea, for 1024x786 resolution
  1861. else
  1862. g.txtEULA.rows=18; // increase the number of rows of MS textarea, for 800x600 resolution
  1863. g.AcceptMS_EulaText.style.display="inline"; // show "Do you accept the terms of the EULA"
  1864. g.EULA_MSonly_accept.style.display="inline" // show "Yes, I accept it"
  1865. g.EULA_MSonly_decline.style.display="inline" // show "No, I don't accept it"
  1866. Populate_MS_EulaTextArea(); // populate MS textarea
  1867. g_EULA_OEM = false;
  1868. }
  1869. // Enable/Disable the Next button, or Check/Uncheck the Radio buttons
  1870. // Based on the value of g_EULA_radiosticky
  1871. // ----------------------------------------
  1872. if (g_EULA_radiosticky == null)
  1873. g.btnNext.disabled = true;
  1874. else if (g_EULA_radiosticky == 1)
  1875. g.radioAgree.checked = true;
  1876. else
  1877. g.radioDisAgree.checked = true;
  1878. InitNewButtons();
  1879. g.btnNext.onclick = EulaNextBtnHandler;
  1880. g_FirstFocusElement = g.btnBack;
  1881. g_FirstFocusElement.focus();
  1882. try
  1883. {
  1884. g.document.body.onkeydown = EulaOnKeyDown;
  1885. }
  1886. catch(e)
  1887. {
  1888. }
  1889. }
  1890. function Populate_MS_EulaTextArea()
  1891. {
  1892. g.txtEULA.innerText = ApiObj.LoadFile(g_fileEULA);
  1893. if (0 == g.txtEULA.innerText.length)
  1894. {
  1895. alert(L_strBadEULA_Text);
  1896. window.external.PowerDown(POWERDOWN_SHUTDOWN);
  1897. }
  1898. }
  1899. function Populate_OEM_EulaTextArea()
  1900. {
  1901. try
  1902. {
  1903. g.txtEULA2.innerText = ApiObj.LoadFile(window.external.GetOEMEulaText());
  1904. }
  1905. catch(e){}
  1906. if (0 == g.txtEULA2.innerText.length)
  1907. {
  1908. var L_EULAnotFound_Text = "ERROR! Windows detected that oemeulatext is missing or not defined in oobeinfo.ini, or is pointing to a file which does not exist.";
  1909. g.txtEULA2.innerText = L_EULAnotFound_Text;
  1910. }
  1911. }
  1912. function EulaLoadMe2()
  1913. {
  1914. InitFrameRef();
  1915. var fileEULA = EulaObj.ValidateEULA();
  1916. g.txtEULA.innerText = ApiObj.LoadFile(fileEULA);
  1917. g.EulaHideSpan.style.display="inline";
  1918. if (g_EULA_OEM)
  1919. {
  1920. try
  1921. {
  1922. g.txtEULA2.innerText = ApiObj.LoadFile(window.external.GetOEMEulaText());
  1923. }
  1924. catch(e)
  1925. {
  1926. var L_EULAnotFound_Text = "ERROR! Windows detected that oemeulatext is missing or not defined in oobeinfo.ini, or is pointing to a file which does not exist.";
  1927. g.txtEULA2.innerText = L_EULAnotFound_Text;
  1928. }
  1929. g.EulaOEMHideSpan.style.display="inline";
  1930. g.EULA_par3b.style.display="inline";
  1931. }
  1932. else
  1933. {
  1934. g.EULA_par3a.style.display="inline";
  1935. }
  1936. InitNewButtons('SimpleBack');
  1937. g_FirstFocusElement = g.btnBack;
  1938. g_FirstFocusElement.focus();
  1939. try
  1940. {
  1941. g.document.body.onkeydown = EulaOnKeyDown;
  1942. }
  1943. catch(e)
  1944. {
  1945. }
  1946. }
  1947. function EulaNextBtnHandler()
  1948. {
  1949. StoreEula();
  1950. GoNext();
  1951. }
  1952. function EulaOnKeyDown()
  1953. {
  1954. if (KeyEsc == g.event.keyCode)
  1955. {
  1956. g.event.returnValue = false;
  1957. g.event.keyCode = 0;
  1958. }
  1959. OnKeyDown();
  1960. }
  1961. var g_AcceptMS_EULA = false;
  1962. var g_AcceptOEM_EULA = false;
  1963. function EulaRadioClicked()
  1964. {
  1965. // if they click on either button, enable next
  1966. if(g.btnNext.disabled && (g.radioAgree.checked || g.radioDisAgree.checked))
  1967. {
  1968. g.btnNext.onmouseover = HandleNextButtonMouseOver;
  1969. g.btnNext.onmouseout = HandleNextButtonMouseOut;
  1970. g.btnNext.onmousedown = HandleNextButtonMouseDown;
  1971. g.btnNext.className="newbuttonsNext";
  1972. g.btnNext.disabled = false;
  1973. g.btnNext.onclick = EulaNextBtnHandler;
  1974. g.btnNext.focus();
  1975. }
  1976. if (g.radioAgree.checked)
  1977. g_EULA_radiosticky=1;
  1978. else
  1979. g_EULA_radiosticky=2;
  1980. g_AcceptMS_EULA = g.radioAgree.checked;
  1981. g_AcceptOEM_EULA = g.radioAgree.checked;
  1982. }
  1983. function StoreEula()
  1984. {
  1985. EulaObj.set_EULAAcceptance = g.radioAgree.checked;
  1986. }
  1987. // END eula.htm
  1988. var g_daylight=SysClockObj.get_AutoDaylight();
  1989. var g_CurTimeZoneIdx = SysClockObj.get_TimeZoneIdx();
  1990. function HandleTZChkBox()
  1991. {
  1992. g_daylight = g.daylight.checked; // this just persists on nav back
  1993. OnClick();
  1994. }
  1995. function HandleSelTZChange()
  1996. {
  1997. g_CurTimeZoneIdx = g.selTimeZone.selectedIndex;
  1998. g.daylight.disabled = !SysClockObj.get_DaylightEnabled(g_CurTimeZoneIdx);
  1999. }
  2000. function TimeZone_LoadMe()
  2001. {
  2002. InitFrameRef();
  2003. g_FirstFocusElement = g.selTimeZone;
  2004. InitNewButtons();
  2005. g.daylight.checked = g_daylight;
  2006. g.daylight.onclick = HandleTZChkBox;
  2007. g.selTimeZone.onchange=HandleSelTZChange;
  2008. g.selTimeZone.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  2009. g.selTimeZone.selectedIndex = g_CurTimeZoneIdx;
  2010. g.daylight.disabled = !SysClockObj.get_DaylightEnabled(g_CurTimeZoneIdx);
  2011. g_FirstFocusElement.focus();
  2012. }
  2013. ///////////////////////////////////////////////////////////////////////////////
  2014. // keybdcmt.htm
  2015. ///////////////////////////////////////////////////////////////////////////////
  2016. var g_RegionSelIdx=LangObj.get_RegionIndex();
  2017. var g_LangSelIdx=LangObj.get_LangIndex();
  2018. var g_KeyboardSelIdx=LangObj.get_KeyboardLayoutIndex();
  2019. function RegKBCmt_LoadMe()
  2020. {
  2021. InitFrameRef();
  2022. g_FirstFocusElement = g.btnNext;
  2023. InitNewButtons();
  2024. g.newkeybdname.innerText=LangObj.get_KeyboardLayoutName(g_KeyboardSelIdx);
  2025. g.newregionname.innerText=LangObj.get_RegionName(g_RegionSelIdx);
  2026. g.newlangname.innerText=LangObj.get_LangName(g_LangSelIdx);
  2027. g_FirstFocusElement.focus();
  2028. }
  2029. // END keybdcmt.htm
  2030. ///////////////////////////////////////////////////////////////////////////////
  2031. // keybd.htm
  2032. ///////////////////////////////////////////////////////////////////////////////
  2033. var iMaxKeybdNameLen=1;
  2034. var iMaxRegionNameLen=1;
  2035. var iMaxLangNameLen=1;
  2036. function HandleKeybdPageSelMenuChange() {
  2037. var namestr=g.event.srcElement.id.slice(3);
  2038. eval('g.'+namestr+'Name.value=g.event.srcElement.options(g.event.srcElement.selectedIndex).text;');
  2039. eval('g_'+namestr+'SelIdx='+'g.event.srcElement.selectedIndex;');
  2040. }
  2041. function SetKeybdFocus() {
  2042. g.selKeyboard.focus();
  2043. }
  2044. function SetRegionFocus() {
  2045. g.selRegion.focus();
  2046. }
  2047. function SetLangFocus() {
  2048. g.selLang.focus();
  2049. }
  2050. // keep separating mechanism in case we need to shorten these strings
  2051. var L_LangStr_Text="I <u>t</u>ype mostly in this language:";
  2052. var LangStrSmall=L_LangStr_Text;
  2053. var L_RegionStr_Text="I li<u>v</u>e closest to this region:";
  2054. var RegionStrSmall=L_RegionStr_Text;
  2055. var L_KeybdStr_Text="I <u>u</u>se this type of keyboard:";
  2056. var KeybdStrSmall=L_KeybdStr_Text;
  2057. var L_KeybdTitleSmall_Text="Select Your System Settings";
  2058. var L_KeybdStrHint_Text="Hint: For a standard English-language keyboard, select US.";
  2059. var KeybdStrHintSmall=L_KeybdStrHint_Text;
  2060. function RegKBLoadMe()
  2061. {
  2062. InitFrameRef();
  2063. g_FirstFocusElement = g.selRegion;
  2064. InitNewButtons();
  2065. RetrieveRegKB();
  2066. g.selKeyboard.onchange = HandleKeybdPageSelMenuChange;
  2067. g.selRegion.onchange = HandleKeybdPageSelMenuChange;
  2068. g.selLang.onchange = HandleKeybdPageSelMenuChange;
  2069. // fix 110160
  2070. g.KeyboardName.onfocus = SetKeybdFocus;
  2071. g.RegionName.onfocus = SetRegionFocus;
  2072. g.LangName.onfocus = SetLangFocus;
  2073. // init name boxes
  2074. g.RegionName.value=g.selRegion.options(g.selRegion.selectedIndex).text;
  2075. g_RegionSelIdx=g.selRegion.selectedIndex;
  2076. g.LangName.value=g.selLang.options(g.selLang.selectedIndex).text;
  2077. g_LangSelIdx=g.selLang.selectedIndex;
  2078. g.KeyboardName.value=g.selKeyboard.options(g.selKeyboard.selectedIndex).text;
  2079. g_KeyboardSelIdx=g.selKeyboard.selectedIndex;
  2080. // need to shorten text for small screen to make things fit
  2081. if(!g_bInHighScreenRes) {
  2082. g.KeybdStr.innerHTML=KeybdStrSmall;
  2083. g.RegionStr.innerHTML=RegionStrSmall;
  2084. g.LangStr.innerHTML=LangStrSmall;
  2085. g.KeybdStrHint.innerHTML=KeybdStrHintSmall;
  2086. for(i=3;i<=5;i++) {
  2087. eval("g.LargeResSpc"+i.toString()+".style.display='none';");
  2088. }
  2089. g.KeyBdTitle.innerText=L_KeybdTitleSmall_Text;
  2090. } else {
  2091. g.KeybdStr.innerHTML=L_KeybdStr_Text;
  2092. g.RegionStr.innerHTML=L_RegionStr_Text;
  2093. g.LangStr.innerHTML=L_LangStr_Text;
  2094. g.KeybdStrHint.innerHTML=L_KeybdStrHint_Text;
  2095. }
  2096. g.LangStr.style.visibility="visible";
  2097. g.KeybdStr.style.visibility="visible";
  2098. g.RegionStr.style.visibility="visible";
  2099. g.KeybdStrHint.style.visibility="visible";
  2100. g.selRegion.style.visibility="visible";
  2101. g.selKeyboard.style.visibility="visible";
  2102. g.selLang.style.visibility="visible";
  2103. g.KeyboardName.style.visibility="visible";
  2104. g.RegionName.style.visibility="visible";
  2105. g.LangName.style.visibility="visible";
  2106. g.KeyboardName.style.cursor="default";
  2107. g.RegionName.style.cursor="default";
  2108. g.LangName.style.cursor="default";
  2109. g_FirstFocusElement.focus();
  2110. }
  2111. // use this to enable "Enter" key as Next Button.
  2112. // but I really need to select focus'd button with enter.
  2113. // have next button be focused by default?? or is enter better, since
  2114. // they might not click on next
  2115. function RegKB_KeyPress()
  2116. {
  2117. try
  2118. {
  2119. if (g.event == null)
  2120. return;
  2121. }
  2122. catch(e)
  2123. {
  2124. return;
  2125. }
  2126. if (g.event.keyCode == KeyEnter)
  2127. GoNext();
  2128. }
  2129. function RetrieveRegKB()
  2130. {
  2131. if(LangObj.get_RegionIndex() > 20000) {
  2132. alert("error loading default region index: possible problem in locale.inf");
  2133. }
  2134. if(LangObj.get_KeyboardLayoutIndex() > 20000) {
  2135. alert("error loading default keybd index: possible problem in locale.inf");
  2136. }
  2137. if(LangObj.get_LangIndex() > 20000 ) {
  2138. alert("error loading default lang index: possible problem in locale.inf/content.inf");
  2139. }
  2140. var ilen = LangObj.get_NumOfRegions();
  2141. for (var i = 0; i < ilen; i++)
  2142. {
  2143. var oOption = g.document.createElement("OPTION");
  2144. oOption.text = LangObj.get_RegionName(i);
  2145. g.selRegion.add(oOption);
  2146. if(oOption.text.length > iMaxRegionNameLen) {
  2147. iMaxRegionNameLen=oOption.text.length;
  2148. }
  2149. }
  2150. ilen = LangObj.get_NumOfLangs();
  2151. for (var i = 0; i < ilen; i++)
  2152. {
  2153. var oOption = g.document.createElement("OPTION");
  2154. oOption.text = LangObj.get_LangName(i);
  2155. g.selLang.add(oOption);
  2156. if(oOption.text.length > iMaxLangNameLen) {
  2157. iMaxLangNameLen=oOption.text.length;
  2158. }
  2159. }
  2160. ilen = LangObj.get_NumOfKeyboardLayouts();
  2161. for (i = 0; i < ilen; i++)
  2162. {
  2163. var oOption = g.document.createElement("OPTION");
  2164. oOption.text = LangObj.get_KeyboardLayoutName(i);
  2165. g.selKeyboard.add(oOption);
  2166. if(oOption.text.length > iMaxKeybdNameLen)
  2167. iMaxKeybdNameLen=oOption.text.length;
  2168. }
  2169. // BUGBUG
  2170. g.selRegion.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  2171. g.selRegion.selectedIndex= g_RegionSelIdx; // BUGBUG: these hacks dont work anymore
  2172. g.selKeyboard.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  2173. g.selKeyboard.selectedIndex= g_KeyboardSelIdx;
  2174. g.selLang.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  2175. g.selLang.selectedIndex= g_LangSelIdx;
  2176. }
  2177. // END keybd.htm
  2178. // fini.htm
  2179. // These vars are set on oobeutil.jsx
  2180. var g_IsActivationSuccessful = false;
  2181. var g_IsMSRegistrationSuccessful = false;
  2182. var g_IsOEMRegistrationSuccessful = false;
  2183. var g_ShowParagraph = false;
  2184. function ShowFinish_Paragraph_Header()
  2185. {
  2186. if (g_ShowParagraph)
  2187. {
  2188. g.FiniSummaryIntro2.style.display = "inline";
  2189. }
  2190. }
  2191. function FinishPage_LoadMe()
  2192. {
  2193. InitFrameRef();
  2194. if (g_IsActivationSuccessful)
  2195. {
  2196. var L_ActivateWindows_Text = "You activated your copy of Windows.<BR>";
  2197. g_ShowParagraph = true;
  2198. g.FiniSummary0.innerHTML = L_ActivateWindows_Text;
  2199. g.FiniSummary0.style.display = "inline";
  2200. }
  2201. // OEM didn't Pre-reg the machine
  2202. if (1 != window.external.get_RegStatus())
  2203. {
  2204. if (1 == RegisterObj.get_PostToOEM && g_IsOEMRegistrationSuccessful)
  2205. {
  2206. var strOEMName = g_OEMNameStr;
  2207. if (strOEMName == null || (strOEMName != null && strOEMName.length == 0))
  2208. {
  2209. var L_RegisterdWith_Text = "You registered your computer with the OEM.<BR>";
  2210. g.FiniSummary1.innerHTML = L_RegisterdWith_Text;
  2211. }
  2212. else
  2213. {
  2214. var L_RegisterdWith_Text = "You registered your computer with %1.<BR>";
  2215. g.FiniSummary1.innerHTML = ApiObj.FormatMessage(L_RegisterdWith_Text, strOEMName);
  2216. }
  2217. g_ShowParagraph = true;
  2218. g.FiniSummary1.style.display = "inline";
  2219. }
  2220. if (g_IsMSRegistrationSuccessful)
  2221. {
  2222. var L_RegisterdWithMS_Text = "You registered your copy of Windows with Microsoft.<BR>";
  2223. g_ShowParagraph = true;
  2224. g.FiniSummary2.innerHTML = L_RegisterdWithMS_Text;
  2225. g.FiniSummary2.style.display = "inline";
  2226. }
  2227. }
  2228. var bHasSignup = 0;
  2229. try
  2230. {
  2231. bHasSignup = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "ISPSignup");
  2232. }
  2233. catch (e) { bHasSignup = 0;}
  2234. if (bHasSignup || ConnectedToInternetEx(false))
  2235. {
  2236. var L_SignupWith_Text = "Your computer is configured for Internet access.<BR>";
  2237. g_ShowParagraph = true;
  2238. g.FiniSummary3.innerHTML = L_SignupWith_Text;
  2239. g.FiniSummary3.style.display = "inline";
  2240. }
  2241. if (bHasSignup || window.external.ConnectedToInternet())
  2242. {
  2243. window.external.SetICWCompleted();
  2244. }
  2245. ShowFinish_Paragraph_Header();
  2246. if (LANGUAGE_REBOOT_END == LangObj.get_RebootState())
  2247. {
  2248. g.finishmsg.style.display="none";
  2249. g.rebootfinishmsg.style.display="inline";
  2250. }
  2251. g.msgspan.style.display="inline";
  2252. if (g.btnNext != null)
  2253. g_FirstFocusElement = g.btnNext;
  2254. else if (g.btnBack != null)
  2255. g_FirstFocusElement = g.btnBack;
  2256. InitNewButtons();
  2257. g_FirstFocusElement.focus();
  2258. }
  2259. ///////////////////////////////////////////////////////////////////////////////
  2260. // badpid.htm
  2261. ///////////////////////////////////////////////////////////////////////////////
  2262. function badpid_LoadMe()
  2263. {
  2264. InitFrameRef();
  2265. g_FirstFocusElement=g.btnBack;
  2266. if (null == PidObj)
  2267. {
  2268. PidObj = new Object;
  2269. PidObj = window.external.ProductID;
  2270. }
  2271. var strPid = PidObj.get_PID();
  2272. for (var i = 0; i < 5; i++)
  2273. {
  2274. g.lblPID[i].innerText = strPid.substr(i * 6, 5);
  2275. }
  2276. if (strPid.length == 0)
  2277. g.PidEntered.style.visibility = "hidden";
  2278. else
  2279. g.PidEntered.style.visibility = "visible";
  2280. InitNewButtons();
  2281. g_FirstFocusElement.focus();
  2282. g_CameFromBadPkeyPage=true;
  2283. }
  2284. ///////////////////////////////////////////////////////////////////////////////
  2285. // username.htm
  2286. ///////////////////////////////////////////////////////////////////////////////
  2287. // Function: UserName_LoadMe
  2288. // Description: This function is called if the user declines registration, and also declines
  2289. // to create any Identities (or we skip the Identities page?) then we should pop up a page
  2290. // that asks his/her name for personalization.
  2291. var g_RegisteredOwnerDone = false;
  2292. var g_UsernameFirstname_Valid = true;
  2293. var g_UsernameLastname_Valid = true;
  2294. function UserName_LoadMe()
  2295. {
  2296. InitFrameRef();
  2297. g_FirstFocusElement = g.txtUserFirstName;
  2298. // If we are in Far East, switch the rows of firstname and lastname, except if we are in Korean locale where we only use fullname.
  2299. if (IsFarEastLocale())
  2300. {
  2301. g.MainPageCell.style.display="none"; // hide while we change order
  2302. if (IsKoreanLocale())
  2303. {
  2304. g.spnUserName_Primary3.style.display="inline";
  2305. g.LastNameRow.style.display="none";
  2306. g.EnterUserFirstName_1.innerHTML=L_FullName_Text;
  2307. if (IspAccountObj.HasSignUp())
  2308. {
  2309. g.UserName_IspAccountNameF.innerText = IspAccountObj.UserName;
  2310. g.UserName_IspAccountNameF.style.display = "inline";
  2311. }
  2312. }
  2313. else
  2314. {
  2315. g.spnUserName_Primary2.style.display="inline";
  2316. if (g.LastNameRow == g.FieldTable.rows[1])
  2317. {
  2318. // swap the tab index
  2319. var i = g.txtUserLastName.tabIndex;
  2320. g.txtUserLastName.tabIndex = g.txtUserFirstName.tabIndex;
  2321. g.txtUserFirstName.tabIndex = i;
  2322. // swap the position
  2323. g.FieldTable.moveRow(1,0); // move lastname in front of the firstname
  2324. }
  2325. if ((!g_UsernameFirstname_Valid) && (g_UsernameLastname_Valid))
  2326. g_FirstFocusElement = g.txtUserFirstName;
  2327. else
  2328. g_FirstFocusElement = g.txtUserLastName;
  2329. if (IspAccountObj.HasSignUp())
  2330. {
  2331. g.UserName_IspAccountNameL.innerText = IspAccountObj.UserName;
  2332. g.UserName_IspAccountNameL.style.display = "inline";
  2333. }
  2334. }
  2335. g.MainPageCell.style.display="inline";
  2336. }
  2337. else
  2338. {
  2339. if ((!g_UsernameLastname_Valid) && (g_UsernameFirstname_Valid))
  2340. g_FirstFocusElement = g.txtUserLastName;
  2341. g.spnUserName_Primary1.style.display="inline";
  2342. if (IspAccountObj.HasSignUp())
  2343. {
  2344. g.UserName_IspAccountNameF.innerText = IspAccountObj.UserName;
  2345. g.UserName_IspAccountNameF.style.display = "inline";
  2346. }
  2347. }
  2348. g_FirstFocusElement.focus();
  2349. InitNewButtons();
  2350. }
  2351. ///////////////////////////////////////////////////////////////////////////////
  2352. // prodkey.htm
  2353. ///////////////////////////////////////////////////////////////////////////////
  2354. var g_CameFromBadPkeyPage=false;
  2355. var g_LastFocusedPidBox;
  2356. var g_SelectionExistsBeforeKeyPress=null;
  2357. function PIDBox_HandleBlur() {
  2358. g_LastFocusedPidBox=g.event.srcElement;
  2359. }
  2360. function PIDBox_HandleFocus() {
  2361. g_LastFocusedPidBox=g.event.srcElement;
  2362. OnFocus();
  2363. }
  2364. function PID_LoadMe()
  2365. {
  2366. InitFrameRef();
  2367. // Show proper text and graphic if we are in retail or OEM mode
  2368. if (window.external.get_RetailOOBE())
  2369. {
  2370. // Retail scenario
  2371. g.PID_Retail_span.style.display="inline";
  2372. }
  2373. else
  2374. {
  2375. // OEM scenario
  2376. g.PID_OEM_span.style.display="inline";
  2377. }
  2378. g_FirstFocusElement = g.edtProductKey[0];
  2379. RetrievePid();
  2380. g_FirstFocusElement.focus();
  2381. var rangefocus = g_FirstFocusElement.createTextRange();
  2382. rangefocus.collapse();
  2383. rangefocus.moveStart("word", 0);
  2384. rangefocus.select();
  2385. g_TabForward = false;
  2386. g_TabBackward = false;
  2387. PID_CheckLength(false);
  2388. if(DebugObj.get_MsDebugMode) {
  2389. // Don't show the "Debug Skip" button anymore.
  2390. // g.btnSkip.style.visibility="visible";
  2391. }
  2392. for (i = 0; i <= 4; i++)
  2393. {
  2394. g.edtProductKey[i].onblur=PIDBox_HandleBlur;
  2395. g.edtProductKey[i].onfocus=PIDBox_HandleFocus;
  2396. }
  2397. g_LastFocusedPidBox=g.edtProductKey[0];
  2398. InitNewButtons();
  2399. if(g_CameFromBadPkeyPage) {
  2400. g.edtProductKey[0].select();
  2401. g_CameFromBadPkeyPage=false;
  2402. }
  2403. }
  2404. var g_CharCode0_plus1=("0".charCodeAt(0))+1;
  2405. function KeyboardHelperClick()
  2406. {
  2407. try
  2408. {
  2409. if (g.event == null)
  2410. return;
  2411. }
  2412. catch(e)
  2413. {
  2414. return;
  2415. }
  2416. g.event.returnValue = false; // if false, cancels default action on button
  2417. g.event.cancelBubble = true;
  2418. if (g.event.srcElement.tagName == "BUTTON") {
  2419. g_LastFocusedPidBox.focus();
  2420. if(g.document.selection.type=="Text") {
  2421. g.document.execCommand("Delete");
  2422. if(g.event.srcElement.name=="{BACKSPACE}")
  2423. return;
  2424. }
  2425. if(g.event.srcElement.name=="{BACKSPACE}") {
  2426. var tr=g_LastFocusedPidBox.createTextRange();
  2427. tr.collapse(false);
  2428. tr.moveStart("character",-1);
  2429. tr.execCommand("Delete");
  2430. return;
  2431. }
  2432. var i=g_LastFocusedPidBox.id.charCodeAt(3)-g_CharCode0_plus1;
  2433. if((i<4) && (g_LastFocusedPidBox.value.length == 5) && CursorAtEndOfField(i) && (!g_SelectionExistsBeforeKeyPress)) {
  2434. TabForward(i,false);
  2435. // should change to g_LastFocusedPidBox, but isn't working due to some IE5.5 regression (focus handler event srcElement is not new event pidbox but current event one)
  2436. }
  2437. if (g_LastFocusedPidBox.value.length != 5) {
  2438. g_LastFocusedPidBox.value+=g.event.srcElement.name;
  2439. // AGENT: notify Agent of the event, NOTE: code in AgtScrpt.js.
  2440. Agent_OnProductKeyKeyboardHelper(g_LastFocusedPidBox, g.event.srcElement.name);
  2441. if (g_TabBackward) {
  2442. TabBackward(i,false);
  2443. } else if(g_TabForward) {
  2444. TabForward(i,false);
  2445. }
  2446. g_TabForward = false;
  2447. g_TabBackward = false;
  2448. }
  2449. }
  2450. }
  2451. function PID_CheckLength(KnownIncomplete)
  2452. {
  2453. // call this only if box reaches length 5 for speed?
  2454. if(KnownIncomplete) {
  2455. g.btnNext.onclick = null;
  2456. g.btnNext.disabled = true;
  2457. g.btnNext.className="newbuttonsNext-disabled";
  2458. return;
  2459. }
  2460. var TotLength=g.edtProductKey[0].value.length+g.edtProductKey[1].value.length+
  2461. g.edtProductKey[2].value.length+g.edtProductKey[3].value.length+
  2462. g.edtProductKey[4].value.length;
  2463. if (TotLength == 25)
  2464. {
  2465. g.btnNext.disabled = false;
  2466. g.btnNext.className="newbuttonsNext";
  2467. g.btnNext.onclick = GoNext;
  2468. }
  2469. else
  2470. {
  2471. g.btnNext.onclick = null;
  2472. g.btnNext.disabled = true;
  2473. g.btnNext.className="newbuttonsNext-disabled";
  2474. }
  2475. }
  2476. function RetrievePid()
  2477. {
  2478. // retrieves the pid if avialable.
  2479. var strPid = PidObj.get_PID();
  2480. // if there is no PID then we set the
  2481. // focus to the first field
  2482. if (strPid.length == 0)
  2483. {
  2484. g.edtProductKey[0].focus();
  2485. }
  2486. // else we populate the fields with the
  2487. // sections of the PID
  2488. else
  2489. {
  2490. var re = new RegExp("(.*)-(.*)-(.*)-(.*)-(.*)","");
  2491. if(re.exec(strPid) == null) {
  2492. throw "Internal error: RegExp pattmatch failed!";
  2493. }
  2494. g.edtProductKey[0].value = RegExp.$1;
  2495. g.edtProductKey[1].value = RegExp.$2;
  2496. g.edtProductKey[2].value = RegExp.$3;
  2497. g.edtProductKey[3].value = RegExp.$4;
  2498. g.edtProductKey[4].value = RegExp.$5;
  2499. }
  2500. }
  2501. function StorePid()
  2502. {
  2503. var strPid = "";
  2504. for (var i = 0; i < 4; i++)
  2505. {
  2506. strPid += g.edtProductKey[i].value;
  2507. strPid += '-';
  2508. }
  2509. strPid += g.edtProductKey[i].value;
  2510. PidObj.set_PID(strPid);
  2511. }
  2512. var g_TabForward = false;
  2513. function TabForward(currentEdit,DoSelectAll)
  2514. {
  2515. g_TabForward = false;
  2516. if(currentEdit==4) {
  2517. // deselect any existing selection before moving focus to back button
  2518. if(g.document.selection.type!="None") {
  2519. g.document.selection.empty();
  2520. }
  2521. g.btnBack.focus();
  2522. return;
  2523. }
  2524. currentEdit++;
  2525. g.edtProductKey[currentEdit].focus();
  2526. if(DoSelectAll) {
  2527. g.edtProductKey[currentEdit].select();
  2528. return;
  2529. }
  2530. var tr = g.edtProductKey[currentEdit].createTextRange();
  2531. tr.collapse(true);
  2532. tr.moveStart("word", 0);
  2533. tr.select();
  2534. }
  2535. var g_TabBackward = false;
  2536. function TabBackward(currentEdit,DoSelectAll)
  2537. {
  2538. g_TabBackward = false;
  2539. if (currentEdit == 0) {
  2540. // deselect any existing selection before moving focus to button
  2541. if(g.document.selection.type!="None") {
  2542. g.document.selection.empty();
  2543. }
  2544. if(g.btnNext.disabled) {
  2545. g.btnBack.focus();
  2546. } else {
  2547. g.btnNext.focus();
  2548. }
  2549. return;
  2550. }
  2551. currentEdit--;
  2552. g.edtProductKey[currentEdit].focus();
  2553. if(DoSelectAll) {
  2554. g.edtProductKey[currentEdit].select();
  2555. return;
  2556. }
  2557. var tr = g.edtProductKey[currentEdit].createTextRange();
  2558. tr.collapse(false);
  2559. tr.moveStart("word", 1);
  2560. tr.select();
  2561. }
  2562. function CursorAtStartOfField(currentEdit) {
  2563. var tr = g.edtProductKey[currentEdit].createTextRange();
  2564. var tr2 = g.document.selection.createRange();
  2565. tr2.moveEnd("textedit",1);
  2566. if(tr.isEqual(tr2)){
  2567. return true;
  2568. } else {
  2569. return false;
  2570. }
  2571. }
  2572. function CursorAtEndOfField(currentEdit) {
  2573. // assumes selection is current edit field
  2574. var tr = g.edtProductKey[currentEdit].createTextRange();
  2575. var tr2 = g.document.selection.createRange();
  2576. tr2.moveStart("textedit",-1);
  2577. if(tr.isEqual(tr2)){
  2578. return true;
  2579. } else {
  2580. return false;
  2581. }
  2582. }
  2583. function IsProductIDKey(keyCode)
  2584. {
  2585. var str = String.fromCharCode(keyCode);
  2586. var result = str.match(/B|C|D|F|G|H|J|K|M|P|Q|R|T|V|W|X|Y|2|3|4|6|7|8|9/);
  2587. return (null != result);
  2588. }
  2589. var g_keyPressKeyCode = 0;
  2590. function ProductIDPropertyChange()
  2591. {
  2592. try
  2593. {
  2594. if (g.event == null)
  2595. return;
  2596. }
  2597. catch(e)
  2598. {
  2599. return;
  2600. }
  2601. // enable Next Btn when PID is full, and automatically move to
  2602. // next/previous field when entering/deleting chars
  2603. if ("value" == g.event.propertyName) {
  2604. // find the index at which we are.
  2605. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  2606. // our g_Tab variables can be booleans instead of counts because they can
  2607. // have a max value of 1, becase there will only ever be 1 call to OnPropertyChange if the
  2608. // length of the edit is 0 or 5
  2609. switch(g.edtProductKey[i].value.length) {
  2610. case 5:
  2611. g_TabForward = (i<4); // dont tab forward if on last PID box
  2612. PID_CheckLength(false);
  2613. break;
  2614. case 4:
  2615. case 0:
  2616. case 1:
  2617. PID_CheckLength(true); //change from 25char-state could have occurred with any of these lengths
  2618. }
  2619. // see if we want to tab backward
  2620. // if pixbox is empty, and last keypress was not a pidkey (which adds a char),
  2621. // and nothing was selected.
  2622. // BUGBUG: this currently only fully works for the delete key. when backspace
  2623. // is pressed, g.document.selection.type is always "None" even if there was a selection
  2624. if ((g.edtProductKey[i].value.length == 0) && (i > 0) &&
  2625. (g_keyPressKeyCode==KeyBackSpc)&&(g_keyPressKeyCode==KeyDelete)&&
  2626. (g.document.selection.type=="None")) {
  2627. g_TabBackward = true; // IsProd check is to handle the case where they select everything then press a 2, etc.
  2628. }
  2629. }
  2630. g_keyPressKeyCode = 0;
  2631. }
  2632. //As of IE 4.0, the onkeypress event fires and can be canceled for the following keys:
  2633. //
  2634. //Letters: a - z
  2635. //Numerals: 0 - 9
  2636. //Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
  2637. //System: ESCAPE, SPACE, SHIFT
  2638. function ProductIDKeyPress()
  2639. {
  2640. try
  2641. {
  2642. if (g.event == null)
  2643. return;
  2644. }
  2645. catch(e)
  2646. {
  2647. return;
  2648. }
  2649. // BUGBUG: hack workaround: KeyBackSpc event should arrive at KeyDown handler, but it comes here instead
  2650. // I dont know why
  2651. if (g.event.keyCode == KeyBackSpc) {
  2652. ProductIDKeyDown();
  2653. return;
  2654. }
  2655. KeyCodeToUpper();
  2656. g_keyPressKeyCode = g.event.keyCode;
  2657. if (!IsProductIDKey(g_keyPressKeyCode)) {
  2658. g.event.keyCode = 0;
  2659. return;
  2660. } else {
  2661. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  2662. if((i<4) && (g.edtProductKey[i].value.length == 5) && CursorAtEndOfField(i) && (!g_SelectionExistsBeforeKeyPress)) {
  2663. TabForward(i,false);
  2664. }
  2665. }
  2666. }
  2667. //In IE 5.0, the onkeydown event fires for the following keys:
  2668. //
  2669. //Editing: DELETE, INSERT,BACKSPACE
  2670. //Function: F1 - F12
  2671. //Letters: a - z
  2672. //Navigation: HOME, END, Left Arrow, Right Arrow, Up Arrow, Down Arrow, PAGE UP, PAGE DOWN
  2673. //Numerals: 0 - 9
  2674. //Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
  2675. //System: ESCAPE, SPACE, SHIFT, TAB, SHIFT+TAB
  2676. //
  2677. // the following keys and key combinations can be canceled by specifying event.returnValue=false:
  2678. //
  2679. //Editing: BACKSPACE, DELETE
  2680. //Letters: a - z
  2681. //Navigation: PAGE UP, PAGE DOWN, END, HOME, Left Arrow, Right Arrow, Up Arrow, Down Arrow
  2682. //Numerals: 0 - 9
  2683. //Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
  2684. //System: SPACE, ESCAPE, TAB, SHIFT+TAB
  2685. function ProductIDKeyDown()
  2686. {
  2687. try
  2688. {
  2689. if (g.event == null)
  2690. return;
  2691. }
  2692. catch(e)
  2693. {
  2694. return;
  2695. }
  2696. var keyCode = g.event.keyCode;
  2697. g_SelectionExistsBeforeKeyPress=(g.document.selection.type!="None");
  2698. if(g.event.srcElement.tagName=="INPUT") {
  2699. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  2700. } else {
  2701. var i=-1;
  2702. }
  2703. switch(keyCode) {
  2704. case KeyTab:
  2705. if(g.event.srcElement == g.edtProductKey[i]) {
  2706. if(g.event.shiftKey)
  2707. TabBackward(i,true);
  2708. else TabForward(i,true);
  2709. g.event.returnValue = false;
  2710. g.event.keyCode = 0;
  2711. g.event.cancelBubble = true;
  2712. break;
  2713. }
  2714. break;
  2715. case KeyLeftArrow:
  2716. if((i>0) && CursorAtStartOfField(i)) {
  2717. TabBackward(i,false);
  2718. g.event.returnValue = false;
  2719. }
  2720. break;
  2721. case KeyRightArrow:
  2722. if((i<4) && CursorAtEndOfField(i)) {
  2723. TabForward(i,false);
  2724. g.event.returnValue = false;
  2725. }
  2726. break;
  2727. case KeyBackSpc:
  2728. case KeyDelete:
  2729. // if there is already 5 characters in a field, and the user puts the cursor in it, we want to
  2730. // fill in the next box with the character. we have to do this here because there is no propertychange,
  2731. // and keyup is too late
  2732. //if(g.edtProductKey[i].value.length == 5 && IsProductIDKey(keyCode) && g.document.selection==null)
  2733. // TabForward(i);
  2734. // cgeorges note: I enabled this feature tried it and didnt like it
  2735. ////////
  2736. // we want the delete/backspace to move the previous edit box if:
  2737. // there is 0 characters, and the user puts the cursor in it, and selection is non-null
  2738. // OR backspc && cursor is at start of field
  2739. if ((i > 0) &&
  2740. ( ((g.document.selection.type=="None") && (g.edtProductKey[i].value.length == 0))
  2741. ||((keyCode==KeyBackSpc)&& CursorAtStartOfField(i)))) {
  2742. TabBackward(i,false);
  2743. g.event.returnValue = false; // so no deletion occurs when backspace moves to prev pidbox
  2744. g.event.keyCode = 0;
  2745. }
  2746. break;
  2747. case KeyEnter:
  2748. if((g.btnNext.disabled == false)&&(g.event.srcElement!=g.btnBack)) {
  2749. g.btnNext.click();
  2750. g.event.returnValue = false;
  2751. g.event.keyCode = 0;
  2752. g.event.cancelBubble = true;
  2753. }
  2754. break;
  2755. }
  2756. }
  2757. function ProductIDKeyUp()
  2758. {
  2759. try
  2760. {
  2761. if (g.event == null)
  2762. return;
  2763. }
  2764. catch(e)
  2765. {
  2766. return;
  2767. }
  2768. if((!g_TabForward) && (!g_TabBackward)) {
  2769. return;
  2770. }
  2771. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  2772. if (g_TabBackward) {
  2773. TabBackward(i,false);
  2774. return;
  2775. } else
  2776. if(g_TabForward) {
  2777. TabForward(i,false);
  2778. }
  2779. }
  2780. // called on every mouse click into PID page body, to make sure focus never leaves PID fields
  2781. function PID_SetCorrectFocus()
  2782. {
  2783. try
  2784. {
  2785. if (g.event == null)
  2786. return;
  2787. }
  2788. catch(e)
  2789. {
  2790. return;
  2791. }
  2792. if((g.event.srcElement.tagName == "INPUT")||(g.event.srcElement.tagName == "BUTTON")) {
  2793. return;
  2794. }
  2795. // only get here if we clicked on something unexpected
  2796. for (var i = 0; i < 5; i++)
  2797. {
  2798. if (g.event.srcElement == g.edtProductKey[i])
  2799. {
  2800. return;
  2801. }
  2802. }
  2803. // if full key is entered then pass events directly to buttons without doing the stuff below
  2804. if((g.btnNext.disabled == false) && (g.btnNext.contains(g.event.srcElement) || g.btnBack.contains(g.event.srcElement)))
  2805. return;
  2806. for (var i = 4; i >= 0; i--)
  2807. {
  2808. if (g.edtProductKey[i].value.length < 5 && g.edtProductKey[i].value.length > 0)
  2809. {
  2810. g.edtProductKey[i].focus();
  2811. var range = g.edtProductKey[i].createTextRange();
  2812. range.collapse();
  2813. range.moveStart("word", 1);
  2814. range.select();
  2815. return;
  2816. }
  2817. }
  2818. if (i < 0)
  2819. {
  2820. g.edtProductKey[0].focus();
  2821. var range = g.edtProductKey[0].createTextRange();
  2822. range.collapse();
  2823. range.moveStart("word", 0);
  2824. range.select();
  2825. return;
  2826. }
  2827. }
  2828. // END pid.htm
  2829. ///////////////////////////////////////////////////////////////////////////////
  2830. // hndshake.htm
  2831. ///////////////////////////////////////////////////////////////////////////////
  2832. function hndshake_OnKeyPress()
  2833. {
  2834. try
  2835. {
  2836. if (g.event == null)
  2837. return;
  2838. }
  2839. catch(e)
  2840. {
  2841. return;
  2842. }
  2843. // Treat the enter key like the next button
  2844. if ((g.event.keyCode == KeyEnter) &&
  2845. (g.btnNext.disabled == false))
  2846. {
  2847. GoNext();
  2848. }
  2849. else
  2850. {
  2851. KeyPressIsValid();
  2852. }
  2853. }
  2854. function hndshake_CheckEdits()
  2855. {
  2856. try
  2857. {
  2858. if (g.event == null)
  2859. return;
  2860. }
  2861. catch(e)
  2862. {
  2863. return;
  2864. }
  2865. if (g.event.srcElement != g.edtMSNPhoneNumber)
  2866. {
  2867. hndshake_CheckEnableNextButton();
  2868. }
  2869. }
  2870. function hndshake_CheckEnableNextButton()
  2871. {
  2872. try
  2873. {
  2874. if (g.event == null)
  2875. return;
  2876. }
  2877. catch(e)
  2878. {
  2879. return;
  2880. }
  2881. if (g.edtMSNPhoneNumber.value.length)
  2882. {
  2883. g.btnNext.disabled = false;
  2884. }
  2885. else
  2886. {
  2887. g.btnNext.disabled = true;
  2888. }
  2889. InitNewButtons();
  2890. }
  2891. function hndshake_LoadMe()
  2892. {
  2893. InitFrameRef();
  2894. g_FirstFocusElement = g.edtMSNPhoneNumber;
  2895. hndshake_CheckEnableNextButton();
  2896. g_FirstFocusElement.focus();
  2897. }
  2898. ///////////////////////////////////////////////////////////////////////////////
  2899. // pberr.htm
  2900. ///////////////////////////////////////////////////////////////////////////////
  2901. function Newpberr_LoadMe()
  2902. {
  2903. New_Default_LoadMe('SimpleBack');
  2904. var L_pbErrOEMName_Text = g_OEMNameStr;
  2905. if (L_pbErrOEMName_Text == "")
  2906. {
  2907. L_pbErrOEMName_Text = L_MissingOEMName_Text;
  2908. }
  2909. var L_MainPBerrMsg_Text = "";
  2910. if (g_DoActivation)
  2911. {
  2912. if ((g_PostToMS) && (g_PostToOEM))
  2913. {
  2914. L_MainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. To register your computer later without an Internet connection, please contact %1. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft over the telephone.";
  2915. g.pberr_par1.innerText = ApiObj.FormatMessage(L_MainPBerrMsg_Text, L_pbErrOEMName_Text);
  2916. }
  2917. else if ((g_PostToMS) && (!g_PostToOEM))
  2918. {
  2919. L_MainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft by telephone. An Internet connection is needed to register your copy of Windows with Microsoft.";
  2920. g.pberr_par1.innerText = L_MainPBerrMsg_Text;
  2921. }
  2922. else if ((!g_PostToMS) && (g_PostToOEM))
  2923. {
  2924. L_MainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft by telephone. To register your computer later without an Internet connection, please contact %1.";
  2925. g.pberr_par1.innerText = ApiObj.FormatMessage(L_MainPBerrMsg_Text, L_pbErrOEMName_Text);
  2926. }
  2927. else
  2928. {
  2929. // If we're here, it means g_PostToMS=flase and g_PostToOEM=false.
  2930. L_MainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft over the telephone.";
  2931. g.pberr_par1.innerText = L_MainPBerrMsg_Text;
  2932. }
  2933. }
  2934. else
  2935. {
  2936. if ((!g_PostToMS) && (g_PostToOEM))
  2937. {
  2938. L_MainPBerrMsg_Text = "Online registration is currently unavailable in your country or region. To register your computer later without an Internet connection, please contact %1.";
  2939. g.pberr_par1.innerText = ApiObj.FormatMessage(L_MainPBerrMsg_Text, L_pbErrOEMName_Text);
  2940. }
  2941. }
  2942. }
  2943. ///////////////////////////////////////////////////////////////////////////////
  2944. // jndomain.htm
  2945. ///////////////////////////////////////////////////////////////////////////////
  2946. var g_Domain = ( window.external.GetNetJoinStatus() == JOIN_STATUS_DOMAIN );
  2947. var g_DomainName = null;
  2948. var g_DomainUser = null;
  2949. var g_DomainPass = null;
  2950. var g_DomainDone = false;
  2951. function jndomain_OnKeyPress()
  2952. {
  2953. try
  2954. {
  2955. if (g.event == null)
  2956. return;
  2957. }
  2958. catch(e)
  2959. {
  2960. return;
  2961. }
  2962. if (g.event.keyCode == KeyEnter)
  2963. {
  2964. jndomainNextBtnHandler();
  2965. }
  2966. }
  2967. function jndomainNextBtnHandler()
  2968. {
  2969. if (g.radioYesDomain.checked)
  2970. {
  2971. g_Domain = g.radioYesDomain.checked;
  2972. g_DomainName = g.textboxDomain.value;
  2973. Navigate("setup\\jndom_a.htm"); // This will navigate to "Enter your domain settings - Username, Password..."
  2974. }
  2975. else
  2976. {
  2977. g_Domain = !g.radioNoDomain.checked;
  2978. g_DomainName = "";
  2979. GoNext();
  2980. }
  2981. }
  2982. var jndom_rb_stat = 0;
  2983. function jndomainLoadMe()
  2984. {
  2985. InitFrameRef();
  2986. g_FirstFocusElement = g.btnNext;
  2987. g_FirstFocusElement.focus();
  2988. InitNewButtons();
  2989. g.radioYesDomain.checked = false;
  2990. g.radioNoDomain.checked = false;
  2991. if (jndom_rb_stat==0)
  2992. g.radioNoDomain.checked=true;
  2993. else
  2994. g.radioYesDomain.checked=true;
  2995. checkJoinDomain();
  2996. g.btnNext.onclick = jndomainNextBtnHandler;
  2997. }
  2998. function jndom_a_OnKeyPress()
  2999. {
  3000. try
  3001. {
  3002. if (g.event == null)
  3003. return;
  3004. }
  3005. catch(e)
  3006. {
  3007. return;
  3008. }
  3009. if (g.event.keyCode == KeyEnter)
  3010. {
  3011. jndomain2NextBtnHandler();
  3012. }
  3013. }
  3014. function jndomain2NextBtnHandler()
  3015. {
  3016. g_DomainUser = g.textboxDomUser.value;
  3017. g_DomainPass = g.textboxDomPass.value;
  3018. GoNext();
  3019. }
  3020. function jndomainLoadMe2()
  3021. {
  3022. InitFrameRef();
  3023. if (g.btnNext != null)
  3024. g_FirstFocusElement = g.btnNext;
  3025. else
  3026. if (g.btnSkip != null)
  3027. g_FirstFocusElement = g.btnSkip;
  3028. else
  3029. if (g.btnBack != null)
  3030. g_FirstFocusElement = g.btnBack;
  3031. InitNewButtons("SimpleBack", null);
  3032. if (g_FirstFocusElement != null)
  3033. g_FirstFocusElement.focus();
  3034. else
  3035. g.document.body.focus();
  3036. g.btnNext.onclick = jndomain2NextBtnHandler;
  3037. }
  3038. function checkJoinDomain()
  3039. {
  3040. if (g.radioNoDomain.checked)
  3041. {
  3042. g.textboxDomain.disabled = true;
  3043. g.textboxDomain.style.backgroundColor='#dddddd';
  3044. jndom_rb_stat = 0;
  3045. }
  3046. else
  3047. {
  3048. g.textboxDomain.disabled = false;
  3049. g.textboxDomain.style.backgroundColor='#ffffff';
  3050. jndom_rb_stat = 1;
  3051. }
  3052. }
  3053. ///////////////////////////////////////////////////////////////////////////////
  3054. // Security Password
  3055. ///////////////////////////////////////////////////////////////////////////////
  3056. var g_AdminPassword = null;
  3057. function validatePassword()
  3058. {
  3059. if (g.ConfirmPass.value != g.SecurityPass.value)
  3060. {
  3061. g.SecurityPass.value = "";
  3062. g.ConfirmPass.value = "";
  3063. g.SecurityExplHidden.style.display = "";
  3064. }
  3065. else
  3066. GoNext();
  3067. }
  3068. function SecurityPasswordLoadMe()
  3069. {
  3070. InitFrameRef();
  3071. InitNewButtons();
  3072. g_FirstFocusElement = g.SecurityPass;
  3073. g_FirstFocusElement.focus();
  3074. g_FirstFocusElement.select();
  3075. g.btnNext.onclick = validatePassword;
  3076. }
  3077. ///////////////////////////////////////////////////////////////////////////////
  3078. // MISC Functions
  3079. ///////////////////////////////////////////////////////////////////////////////
  3080. // Page Navigation
  3081. // InitCKPT, PushCKPT, PopCKPT, CKPTFromVal are meant to handle the behavior for GoBack.
  3082. // We only go back to certain pages (i.e., Sound Check).
  3083. // And on some of the pages, we only go back if they haven't been
  3084. // completed (i.e., EULA, PID).
  3085. //
  3086. // So, we push checkpoints if we intend to all coming back to that page.
  3087. // We pop checkpoints if we no longer want to come back (e.g., we've
  3088. // completed that page.
  3089. function InitCKPT()
  3090. {
  3091. // STATUS_ISP(0) STATUS_PRECONFIG STATUS_NONE STATUS_OFF
  3092. // ------------ ------------- ------------- --------------
  3093. dnCKPT[CKPT_ANIMATION] = new CheckPoint("", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
  3094. dnCKPT[CKPT_HWCHK] = new CheckPoint("", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
  3095. dnCKPT[CKPT_WELCOME] = new CheckPoint("setup\\welcome.htm", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
  3096. dnCKPT[CKPT_MOUSETUT1] = new CheckPoint("html\\mouse\\mouse.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  3097. dnCKPT[CKPT_IMETUTORIAL] = new CheckPoint("html\\IME\\IMETut1.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  3098. dnCKPT[CKPT_OEMHW] = new CheckPoint("html\\oemhw\\oemhw.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  3099. dnCKPT[CKPT_REGION_KEYBD] = new CheckPoint("setup\\keybd.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  3100. dnCKPT[CKPT_REGKB_COMMIT] = new CheckPoint("setup\\keybdcmt.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  3101. dnCKPT[CKPT_TIMEZONE] = new CheckPoint("setup\\timezone.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  3102. dnCKPT[CKPT_EULA] = new CheckPoint("setup\\neweula.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  3103. dnCKPT[CKPT_EULA_DECLINE] = new CheckPoint("setup\\badeula.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  3104. dnCKPT[CKPT_PRODUCTKEY] = new CheckPoint("setup\\prodkey.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  3105. dnCKPT[CKPT_BADPRODUCTKEY] = new CheckPoint("setup\\badpkey.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  3106. dnCKPT[CKPT_COMPNAME] = new CheckPoint("setup\\compname.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  3107. dnCKPT[CKPT_SECPASS] = new CheckPoint("setup\\security.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  3108. dnCKPT[CKPT_JNDOMAIN] = new CheckPoint("setup\\jndomain.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3109. dnCKPT[CKPT_ICSCHOICE] = new CheckPoint("setup\\ics.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3110. dnCKPT[CKPT_SCONNECT] = new CheckPoint("html\\sconnect\\sconnect.htm",SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3111. dnCKPT[CKPT_HOMENETWIZPROMPT] = new CheckPoint("setup\\hnwprmpt.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3112. dnCKPT[CKPT_DSLMAIN] = new CheckPoint("html\\dslmain\\dslmain.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3113. dnCKPT[CKPT_DSLPPPOE]=new CheckPoint("html\\dslmain\\dsl_a.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3114. dnCKPT[CKPT_DSLBROADBAND]=new CheckPoint("html\\dslmain\\dsl_b.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3115. dnCKPT[CKPT_CONGRATS]=new CheckPoint("html\\dslmain\\dsllast.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3116. dnCKPT[CKPT_ACTIVATION] = new CheckPoint("setup\\activate.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3117. dnCKPT[CKPT_REGISTER1] = new CheckPoint("setup\\reg1.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3118. dnCKPT[CKPT_REGISTER3] = new CheckPoint("setup\\reg3.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3119. dnCKPT[CKPT_ACT_MSG] = new CheckPoint("setup\\acterror.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3120. dnCKPT[CKPT_ICONN] = new CheckPoint("setup\\iconn.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3121. dnCKPT[CKPT_REGDIAL] = new CheckPoint("setup\\drdyoem.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  3122. dnCKPT[CKPT_ISPSIGNUP] = new CheckPoint("setup\\isp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3123. dnCKPT[CKPT_MIGLIST] = new CheckPoint("setup\\miglist.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3124. dnCKPT[CKPT_ISPDIAL] = new CheckPoint("setup\\drdyisp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3125. dnCKPT[CKPT_REFDIAL] = new CheckPoint("setup\\drdyref.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3126. dnCKPT[CKPT_MIGDIAL] = new CheckPoint("setup\\drdymig.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3127. dnCKPT[CKPT_ISPTYPE] = new CheckPoint("html\\isptype\\isptype.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3128. dnCKPT[CKPT_ICONNECT] = new CheckPoint("html\\iconnect\\iconnect.htm",SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3129. dnCKPT[CKPT_OEMISP] = new CheckPoint("html\\ispsgnup\\ispsgnup.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3130. dnCKPT[CKPT_OEMCUST] = new CheckPoint("html\\oemcust\\oemcust.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  3131. dnCKPT[CKPT_IDENTITIES2] = new CheckPoint("setup\\ident2.htm", SNDX_IDENTITIES, SNDX_IDENTITIES, SNDX_IDENTITIES, SNDX_IDENTITIES);
  3132. dnCKPT[CKPT_DONE] = new CheckPoint("setup\\fini.htm", SNDX_FINI, SNDX_FINI, SNDX_FINI, SNDX_FINI);
  3133. PopCKPT();
  3134. // init simple navigation mappings
  3135. g_SimpleNavMap= new ActiveXObject("Scripting.Dictionary");
  3136. g_SimpleNavMap.CompareMode = COMPAREMODE_TEXT;
  3137. InitSimpleNavMap_MouseTut();
  3138. iconnect_InitSimpleNavMap();
  3139. sconnect_InitSimpleNavMap();
  3140. }
  3141. function PushCKPT(ckpt)
  3142. {
  3143. if (ckpt > 0 && ckpt < CKPT_MAX)
  3144. {
  3145. var tos = 0;
  3146. try
  3147. {
  3148. tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  3149. }
  3150. catch (e) {}
  3151. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString(), ckpt);
  3152. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, ++tos);
  3153. ApiObj.FlushRegKey(HKEY_LOCAL_MACHINE);
  3154. g_CurrentCKPT = ckpt;
  3155. }
  3156. }
  3157. function ClearStatusBar()
  3158. {
  3159. StatusBar1.style.backgroundColor = "#bbbbbb";
  3160. StatusBar2.style.backgroundColor = "#bbbbbb";
  3161. StatusBar3.style.backgroundColor = "#bbbbbb";
  3162. StatusBar4.style.backgroundColor = "#bbbbbb";
  3163. StatusBar5.style.backgroundColor = "#bbbbbb";
  3164. }
  3165. function PaintStatusBar(WhatBar)
  3166. {
  3167. // We use this method so that whenever we skip a step, that step is highlighted as well.
  3168. var HighlightColor = "#00cc00"; // Green
  3169. if (WhatBar == "1")
  3170. {
  3171. StatusBar1.style.backgroundColor = HighlightColor;
  3172. }
  3173. if (WhatBar == "2")
  3174. {
  3175. StatusBar1.style.backgroundColor = HighlightColor;
  3176. StatusBar2.style.backgroundColor = HighlightColor;
  3177. }
  3178. if (WhatBar == "3")
  3179. {
  3180. StatusBar1.style.backgroundColor = HighlightColor;
  3181. StatusBar2.style.backgroundColor = HighlightColor;
  3182. StatusBar3.style.backgroundColor = HighlightColor;
  3183. }
  3184. if (WhatBar == "4")
  3185. {
  3186. StatusBar1.style.backgroundColor = HighlightColor;
  3187. StatusBar2.style.backgroundColor = HighlightColor;
  3188. StatusBar3.style.backgroundColor = HighlightColor;
  3189. StatusBar4.style.backgroundColor = HighlightColor;
  3190. }
  3191. if (WhatBar == "5")
  3192. {
  3193. StatusBar1.style.backgroundColor = HighlightColor;
  3194. StatusBar2.style.backgroundColor = HighlightColor;
  3195. StatusBar3.style.backgroundColor = HighlightColor;
  3196. StatusBar4.style.backgroundColor = HighlightColor;
  3197. StatusBar5.style.backgroundColor = HighlightColor;
  3198. }
  3199. }
  3200. function PopCKPT(ckptCheck)
  3201. {
  3202. var ckpt = 0;
  3203. try
  3204. {
  3205. var tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  3206. if (tos > 0)
  3207. {
  3208. ckpt = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, (tos - 1).toString());
  3209. if (null == ckptCheck || ckpt == ckptCheck)
  3210. {
  3211. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, --tos);
  3212. ApiObj.DeleteRegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString());
  3213. ApiObj.FlushRegKey(HKEY_LOCAL_MACHINE);
  3214. }
  3215. }
  3216. }
  3217. catch (e) {}
  3218. if (ckpt > 0 && ckpt < CKPT_MAX)
  3219. {
  3220. g_CurrentCKPT = ckpt;
  3221. }
  3222. else
  3223. g_CurrentCKPT = null;
  3224. }
  3225. function EmptyCKPTStack()
  3226. {
  3227. while (null != g_CurrentCKPT)
  3228. {
  3229. PopCKPT();
  3230. }
  3231. }
  3232. function URLFromCKPT(ckpt)
  3233. {
  3234. var str = "";
  3235. if (ckpt > 0 && ckpt < CKPT_MAX)
  3236. {
  3237. str = dnCKPT[ckpt].strURL;
  3238. }
  3239. return str;
  3240. }
  3241. function IndexFromCKPT(ckpt, status)
  3242. {
  3243. var index = 0;
  3244. if (ckpt > 0 && ckpt < CKPT_MAX)
  3245. {
  3246. var checkpoint = dnCKPT[ckpt];
  3247. index = checkpoint.rgindex[status];
  3248. }
  3249. return index;
  3250. }
  3251. function IsLocalFile()
  3252. {
  3253. try
  3254. {
  3255. return (-1 != g.location.protocol.indexOf("file"));
  3256. }
  3257. catch (e)
  3258. {
  3259. return false;
  3260. }
  3261. }
  3262. ///////////////////////////////////////////////////////////////////////////////
  3263. // public navigation APIs
  3264. ///////////////////////////////////////////////////////////////////////////////
  3265. var g_fVideoGonextStarted = false;
  3266. function VideoGoNext(CalledBy)
  3267. {
  3268. OOBEDocBody.style.backgroundColor="#4E6FD6";
  3269. if (!g_fVideoGonextStarted)
  3270. {
  3271. g_fVideoGonextStarted = true;
  3272. if (CalledBy == null)
  3273. {
  3274. CalledBy = "Timer";
  3275. }
  3276. trace("VideoGoNext: Called by " + CalledBy);
  3277. // We clear g_VideoEvent inside a try statement because we will script error if setTimeout is already executed.
  3278. try
  3279. {
  3280. window.clearTimeout(g_VideoEvent);
  3281. }
  3282. catch(e){}
  3283. if (CalledBy == "Timer")
  3284. {
  3285. GoNext();
  3286. }
  3287. else
  3288. {
  3289. // Don't use the WM player thread to call GoNext.
  3290. setTimeout("GoNext()", 40);
  3291. }
  3292. }
  3293. }
  3294. function SetBack(strURL)
  3295. {
  3296. g_OEMAddBackURL = strURL;
  3297. }
  3298. // this handles the user's "Skip" requests
  3299. ///////////////////////////////////////////////////////////////////////////////
  3300. // GoCancel
  3301. //
  3302. // This function is responsible for
  3303. // * Saving state for a page when the Skip button is clicked.
  3304. // * Calling GoNavigate with the checkpoint id of the next checkpoint
  3305. //
  3306. // This function is NOT responsible for
  3307. // * Setting state for the next page. That should be done in GoNavigate.
  3308. //
  3309. // Default behavior is to navigate to the first page of the next checkpoint.
  3310. //
  3311. ///////////////////////////////////////////////////////////////////////////////
  3312. function GoCancel(ckpt)
  3313. {
  3314. try
  3315. {
  3316. if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
  3317. return;
  3318. }
  3319. catch(e)
  3320. {
  3321. return;
  3322. }
  3323. DisableAllButtons();
  3324. switch (g_CurrentCKPT)
  3325. {
  3326. case CKPT_HWCHK:
  3327. GoNavigate(CKPT_WELCOME);
  3328. break;
  3329. case CKPT_WELCOME:
  3330. // allow the user to bail out of OOBE
  3331. PushCKPT(CKPT_DONE);
  3332. GoNext();
  3333. break;
  3334. case CKPT_REGION_KEYBD:
  3335. // need to avoid handling any existing input info, which GoNext does
  3336. GoNavigate(CKPT_TIMEZONE);
  3337. break;
  3338. case CKPT_PRODUCTKEY:
  3339. // skip button only exists in debug mode. lets you skip PID page
  3340. PopCKPT(CKPT_PRODUCTKEY); // make sure we go back to reg1.htm
  3341. GoNavigate(CKPT_COMPNAME);
  3342. break;
  3343. case CKPT_COMPNAME:
  3344. g.document.body.style.cursor = "wait";
  3345. // Disable the Computername edit field
  3346. g.txtCompName.style.backgroundColor='#dddddd';
  3347. g.txtCompName.disabled=true;
  3348. g.txtCompDesc.style.backgroundColor='#dddddd';
  3349. g.txtCompDesc.disabled=true;
  3350. g_ComputerDescription = null;
  3351. // Give the system some time to paint and then call the function
  3352. //
  3353. window.setTimeout("CompName_ChangeComplete(true);",50);
  3354. break;
  3355. case CKPT_ICSCHOICE:
  3356. GoNavigate(CKPT_ACTIVATION);
  3357. break;
  3358. case CKPT_DSLPPPOE: // fall through
  3359. case CKPT_DSLBROADBAND:
  3360. case CKPT_DSLMAIN:
  3361. PopCKPT();
  3362. GoNavigate(CKPT_ACTIVATION);
  3363. break;
  3364. case CKPT_REGISTER3:
  3365. Reg3SaveSettings(); // save field settings in case we return to page
  3366. g_PostToMS = false;
  3367. g_PostToOEM = false;
  3368. if ( !g_DoActivation )
  3369. {
  3370. GoNavigate(CKPT_ICONN);
  3371. break;
  3372. }
  3373. else if (UseNetwork())
  3374. {
  3375. LanActReg();
  3376. break;
  3377. }
  3378. else
  3379. {
  3380. GoNavigate(CKPT_REGDIAL);
  3381. break;
  3382. }
  3383. break;
  3384. case CKPT_ISPSIGNUP:
  3385. GoNavigate(CKPT_OEMCUST);
  3386. break;
  3387. case CKPT_MIGLIST:
  3388. // When skip on the referral dialing, go to finish
  3389. GoNavigate(CKPT_OEMCUST);
  3390. break;
  3391. case CKPT_REGDIAL:
  3392. GoNavigate(CKPT_ICONN);
  3393. break;
  3394. case CKPT_REFDIAL:
  3395. case CKPT_MIGDIAL:
  3396. case CKPT_ISPDIAL:
  3397. // When skip on the referral dialing, go to finish
  3398. GoNavigate(CKPT_OEMCUST);
  3399. break;
  3400. case CKPT_IDENTITIES2:
  3401. InfoObj.set_UseIdentities(false);
  3402. GoNavigate(CKPT_DONE);
  3403. // GoNext();
  3404. break;
  3405. default:
  3406. GoNext();
  3407. break;
  3408. }
  3409. }
  3410. ///////////////////////////////////////////////////////////////////////////////
  3411. // GoBack
  3412. //
  3413. // This function is responsible for
  3414. // * Saving state for a page when the Back button is clicked.
  3415. // * Popping the current checkpoint off the checkpoint stack
  3416. // * Navigating to the previous checkpoint
  3417. //
  3418. // This function is NOT responsible for
  3419. // * Setting state for the next page. That should be done in GoNavigate.
  3420. //
  3421. ///////////////////////////////////////////////////////////////////////////////
  3422. function GoBack(ckpt)
  3423. {
  3424. try
  3425. {
  3426. if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
  3427. return;
  3428. }
  3429. catch(e)
  3430. {
  3431. return;
  3432. }
  3433. DisableAllButtons();
  3434. if(g_CurrentCKPT == g_DialCKPT)
  3435. ResetDialing();
  3436. else if(g_CurrentCKPT == CKPT_ISPSIGNUP)
  3437. ResetDialing();
  3438. else if(g_CurrentCKPT == CKPT_REGISTER1)
  3439. Reg1SaveRadioState(); // save radio button settings in case we return to page
  3440. else if(g_CurrentCKPT == CKPT_REGISTER3)
  3441. Reg3SaveSettings(); // save field settings in case we return to page
  3442. else if(g_CurrentCKPT == CKPT_PRODUCTKEY)
  3443. StorePid();
  3444. else if(g_CurrentCKPT == CKPT_IDENTITIES2)
  3445. Identities2_OnLeave();
  3446. // end if
  3447. {
  3448. var ckptPrevious = g_CurrentCKPT;
  3449. PopCKPT();
  3450. if (ckptPrevious == g_CurrentCKPT)
  3451. {
  3452. // This handles the case where the current page pushed itself on the stack.
  3453. PopCKPT();
  3454. }
  3455. if (g_CurrentCKPT > 0 && g_CurrentCKPT < CKPT_MAX)
  3456. {
  3457. GoNavigate(g_CurrentCKPT);
  3458. }
  3459. }
  3460. }
  3461. function StatusNavigate()
  3462. {
  3463. window.external.set_StatusIndex(IndexFromCKPT(g_CurrentCKPT, g_status));
  3464. }
  3465. ////////////////////////////////////////////////////////////////////
  3466. // Required API for USB mouse and/or keyboard checks
  3467. ////////////////////////////////////////////////////////////////////
  3468. function OnDeviceArrival(nDeviceType)
  3469. {
  3470. if (CKPT_HWCHK == g_CurrentCKPT)
  3471. {
  3472. GoNavigate(CKPT_HWCHK);
  3473. }
  3474. }
  3475. ///////////////////////////////////////////////////////////////////////////////
  3476. // GoNavigate
  3477. //
  3478. // This function is responsible for setting state prior to navigating to the
  3479. // first page of a checkpoint. This includes:
  3480. // * determining whether the page should be displayed
  3481. // * pushing the checkpoint id on the checkpoint stack
  3482. // * calling Navigate to navigate to the page
  3483. //
  3484. // Default behavior is to push the checkpoint id and navigate to the first page
  3485. // of the checkpoint. If this is the only processing required, use the
  3486. // default case instead of adding a case for the checkpoint.
  3487. //
  3488. // Calling GoNavigate recursively can cause navigation problems. If a page
  3489. // will not be displayed for a checkpoint, the code should fall through to the
  3490. // next case statement instead of calling GoNavigate.
  3491. //
  3492. // DON'T MUCK WITH THE ORDER OF THE CASES IN THE SWITCHES BELOW WITHOUT
  3493. // CONSIDERING FALL-THROUGH
  3494. ///////////////////////////////////////////////////////////////////////////////
  3495. function GoNavigate(ckptGoHere)
  3496. {
  3497. try
  3498. {
  3499. if (g_bStartup == false)
  3500. {
  3501. if (IsLocalFile())
  3502. {
  3503. if (g.event != null)
  3504. {
  3505. g.event.returnValue = false;
  3506. g.event.cancelBubble = true;
  3507. }
  3508. }
  3509. }
  3510. else
  3511. g_bStartup = false;
  3512. }
  3513. catch(e)
  3514. {
  3515. return;
  3516. }
  3517. switch (ckptGoHere)
  3518. {
  3519. case CKPT_ANIMATION:
  3520. trace("GoNavigate: CKPT_ANIMATION");
  3521. try
  3522. {
  3523. // Don't run animation if we're directed not to, or if stuff is missing.
  3524. if (!DirObj.get_DoSkipAnimation() && FileSystemObj.FileExists(g_OOBEDirPath+"images\\intro.wmv"))
  3525. {
  3526. PushCKPT(CKPT_ANIMATION);
  3527. IntroAnimation.settings.enableErrorDialogs = false;
  3528. MovieFrame.style.display = "inline";
  3529. IntroAnimation.style.visibility = "visible";
  3530. // Start video timer to execute VideoGoNext x seconds(estimated) after the video starts playing.
  3531. // In cases the video played successfully or tried to bail out earlier, the timer will be cleared automatically.
  3532. //
  3533. // Last minute info - We decided to set the timer to 20 seconds instead of 10, because on some slower machines
  3534. // the timer kicks in early, thus cutting the video play short. Just be careful when you
  3535. // plan to change the number of seconds.
  3536. g_VideoEvent = window.setTimeout(VideoGoNext, 20000);
  3537. IntroAnimation.Controls.Play(); // This causes the movie to start
  3538. break;
  3539. }
  3540. }
  3541. catch(err)
  3542. {
  3543. var temp = "EXCEPTION THROWN: WMP control failed to play or disable dialogs.";
  3544. temp += "\rerror name: " + err.name;
  3545. temp += "\rmessage: " + err.message;
  3546. temp += "\rnumber: " + err.number;
  3547. temp += "\rdescription: " + err.description;
  3548. trace(temp);
  3549. }
  3550. // fall through...
  3551. case CKPT_HWCHK:
  3552. trace("GoNavigate: CKPT_HWCHK");
  3553. // In some retail cases, we want to skip everything
  3554. if (window.external.get_RetailOOBE() && DirObj.get_IntroOnly())
  3555. {
  3556. trace("Skipping the rest of OOBE because IntroOnly is set");
  3557. PushCKPT(CKPT_DONE);
  3558. GoNext();
  3559. break;
  3560. }
  3561. PushCKPT(CKPT_HWCHK);
  3562. // Ensure that the page is now visible.
  3563. OOBEDocBody.style.cursor = "default";
  3564. ScreenFrame.style.display = "inline";
  3565. var bKeyboardPresent = window.external.CheckKeyboard();
  3566. var bMousePresent = window.external.CheckMouse();
  3567. if ((0 == bKeyboardPresent) || (0 == bMousePresent))
  3568. {
  3569. if ((0 == bKeyboardPresent) && (0 == bMousePresent))
  3570. {
  3571. Navigate("setup\\nousbkm.htm");
  3572. }
  3573. else if (0 == bKeyboardPresent)
  3574. {
  3575. Navigate("setup\\nousbkbd.htm");
  3576. }
  3577. else // (0 == bMousePresent)
  3578. {
  3579. Navigate("setup\\nousbms.htm");
  3580. }
  3581. break;
  3582. }
  3583. // fall through...
  3584. case CKPT_WELCOME:
  3585. trace("GoNavigate: CKPT_WELCOME");
  3586. if (!window.external.GetNoWelcomeFinish())
  3587. {
  3588. PushCKPT(CKPT_WELCOME); //BUGBUG do we want to do this?
  3589. Navigate(URLFromCKPT(CKPT_WELCOME));
  3590. break;
  3591. }
  3592. // fall through...
  3593. case CKPT_MOUSETUT1:
  3594. trace("GoNavigate: CKPT_MOUSETUT1");
  3595. var MT_INIstr=DirObj.get_DoMouseTutorial();
  3596. if ((MT_INIstr.length>0) && (MT_INIstr=="2"))
  3597. {
  3598. PushCKPT(CKPT_MOUSETUT1);
  3599. Navigate(URLFromCKPT(CKPT_MOUSETUT1));
  3600. break;
  3601. }
  3602. // fall through...
  3603. case CKPT_IMETUTORIAL:
  3604. trace("GoNavigate: CKPT_IMETUTORIAL");
  3605. if ((1 == DirObj.get_DoIMETutorial()) && g_IMEExists)
  3606. {
  3607. PushCKPT(CKPT_IMETUTORIAL);
  3608. Navigate(URLFromCKPT(CKPT_IMETUTORIAL));
  3609. break;
  3610. }
  3611. // fall through...
  3612. case CKPT_OEMHW:
  3613. trace("GoNavigate: CKPT_OEMHW");
  3614. if (1 == DirObj.get_DoOEMHardwareCheck())
  3615. {
  3616. PushCKPT(CKPT_OEMHW);
  3617. Navigate(URLFromCKPT(CKPT_OEMHW));
  3618. break;
  3619. }
  3620. // fall through...
  3621. case CKPT_REGION_KEYBD:
  3622. trace("GoNavigate: CKPT_REGION_KEYBD");
  3623. if (1 == DirObj.get_DoRegionalKeyboard() && !StatusObj.get_Status(LANGUAGECOMPLETED))
  3624. {
  3625. PushCKPT(CKPT_REGION_KEYBD);
  3626. Navigate(URLFromCKPT(CKPT_REGION_KEYBD));
  3627. break;
  3628. }
  3629. // If we're not showing the page, we still want to give OEM's a chance
  3630. // to set the language options silently.
  3631. if ( 0 == DirObj.get_DoRegionalKeyboard() &&
  3632. ! window.external.get_RetailOOBE()
  3633. ) {
  3634. LangObj.SaveSettings();
  3635. }
  3636. // fall through...
  3637. case CKPT_TIMEZONE:
  3638. trace("GoNavigate: CKPT_TIMEZONE");
  3639. var TimeZonewasSet=SysClockObj.get_TimeZonewasPreset();
  3640. // only show timezone page if preset TimeZoneValue does not exist and TimeZone=1,
  3641. // or if TimeZoneValue is invalid
  3642. if ((!TimeZonewasSet &&
  3643. ((1 == DirObj.get_DoTimeZone()) || (DirObj.get_TimeZoneValue() != ""))))
  3644. {
  3645. PushCKPT(CKPT_TIMEZONE);
  3646. Navigate(URLFromCKPT(CKPT_TIMEZONE));
  3647. break;
  3648. }
  3649. // fall through...
  3650. case CKPT_EULA:
  3651. trace("GoNavigate: CKPT_EULA");
  3652. if (null == EulaObj)
  3653. {
  3654. EulaObj = new Object;
  3655. EulaObj = window.external.Eula;
  3656. }
  3657. // skip EULA if user has already accepted in OOBE mode, or if we are running
  3658. // the retail SKU
  3659. if (!EulaObj.get_EULAAcceptance && 0 == window.external.get_RetailOOBE() )
  3660. {
  3661. PushCKPT(CKPT_EULA);
  3662. Navigate(URLFromCKPT(CKPT_EULA));
  3663. break;
  3664. }
  3665. // fall through...
  3666. case CKPT_PRODUCTKEY:
  3667. trace("GoNavigate: CKPT_PRODUCTKEY");
  3668. if (null == PidObj)
  3669. {
  3670. PidObj = new Object;
  3671. PidObj = window.external.ProductID;
  3672. }
  3673. // skips over PID if it's already validated, or if we are running
  3674. // the retail or select SKU
  3675. if (
  3676. 0 == window.external.get_RetailOOBE() &&
  3677. 0 == window.external.IsSelectVariation() &&
  3678. (0 == PidObj.get_PID.length || !PidObj.ValidatePID)
  3679. )
  3680. {
  3681. PushCKPT(CKPT_PRODUCTKEY); //this sets g_CurrentCKPT=CPKT_PRODUCTKEY
  3682. Navigate(URLFromCKPT(CKPT_PRODUCTKEY));
  3683. break;
  3684. }
  3685. // fall through...
  3686. case CKPT_COMPNAME:
  3687. trace("GoNavigate: CKPT_COMPNAME");
  3688. // Don't show this page in Retail mode or if it has already been
  3689. // displayed.
  3690. //
  3691. if (window.external.get_RetailOOBE())
  3692. {
  3693. CompName_ChangeComplete(false);
  3694. // this will fall through...don't break here.
  3695. }
  3696. else if (!g_CompNameChangeComplete)
  3697. {
  3698. PushCKPT(CKPT_COMPNAME);
  3699. Navigate(URLFromCKPT(CKPT_COMPNAME));
  3700. break;
  3701. }
  3702. // fall through
  3703. case CKPT_SECPASS:
  3704. trace("GoNavigate: CKPT_SECPASS");
  3705. // Only show admin password page if we're an OEM-preinstalled PRO SKU and we
  3706. // haven't been here before.
  3707. if ( null == g_AdminPassword &&
  3708. window.external.IsProfessionalSKU() &&
  3709. 0 == window.external.get_RetailOOBE() &&
  3710. 1 == DirObj.get_DoAdminPassword()
  3711. ) {
  3712. PushCKPT(CKPT_SECPASS);
  3713. Navigate(URLFromCKPT(CKPT_SECPASS));
  3714. break;
  3715. }
  3716. // fall through
  3717. case CKPT_JNDOMAIN:
  3718. trace("GoNavigate: CKPT_JNDOMAIN");
  3719. if (!window.external.GetNoWelcomeFinish() &&
  3720. (1 == DirObj.get_DoJoinDomain()) )
  3721. {
  3722. // Only show domain page if we're an OEM-preinstalled PRO SKU and we
  3723. // haven't been here before.
  3724. if ( !g_DomainDone && window.external.IsProfessionalSKU() &&
  3725. 0 == window.external.get_RetailOOBE() && HasNetwork()
  3726. ) {
  3727. PushCKPT(CKPT_JNDOMAIN);
  3728. Navigate(URLFromCKPT(CKPT_JNDOMAIN));
  3729. break;
  3730. }
  3731. }
  3732. // fall through...
  3733. case CKPT_SCONNECT:
  3734. trace("GoNavigate: CKPT_SCONNECT");
  3735. if (!window.external.GetNoWelcomeFinish())
  3736. {
  3737. // We use the DisplayIcsCongratsPage so that we wont come back
  3738. // to the congratulations page after passing it.
  3739. // DisplayIcsCongratsPage is initially set to true.
  3740. if ( DisplayIcsCongratsPage
  3741. && UseIcs()
  3742. && !g_bIsSetupUpgrade
  3743. )
  3744. {
  3745. // We used to navigate to a congratulations page, we took it out until further notice.
  3746. // If we reach here, we are connected via ICS...
  3747. // DisplayIcsCongratsPage = false;
  3748. // Navigate("html\\sconnect\\scntlast.htm");
  3749. GoNavigate(CKPT_ACTIVATION);
  3750. break;
  3751. }
  3752. }
  3753. // fall through...
  3754. case CKPT_HOMENETWIZPROMPT:
  3755. trace("GoNavigate: CKPT_HOMENETWIZPROMPT");
  3756. if (!window.external.GetNoWelcomeFinish())
  3757. {
  3758. if (!g_bIsSetupUpgrade)
  3759. {
  3760. if ((CanConfigLan() == CONFIG_LAN_NO) && HasIndeterminateLan())
  3761. {
  3762. PushCKPT(CKPT_HOMENETWIZPROMPT);
  3763. Navigate(URLFromCKPT(CKPT_HOMENETWIZPROMPT));
  3764. break;
  3765. }
  3766. }
  3767. }
  3768. // fall through...
  3769. case CKPT_ICSCHOICE:
  3770. trace("GoNavigate: CKPT_ICSCHOICE");
  3771. if (!window.external.GetNoWelcomeFinish())
  3772. {
  3773. if (!g_bIsSetupUpgrade)
  3774. {
  3775. if (CanConfigLan() != CONFIG_LAN_NO)
  3776. {
  3777. // Don't run ICS page if OFFLINE=1 in oobeinfo.ini under [StartUpOptions]
  3778. if (g_status != STATUS_OFF)
  3779. {
  3780. // Go to "Do you wanna connect using a network?" page. Formerly ICS
  3781. // page...
  3782. PushCKPT(CKPT_ICSCHOICE);
  3783. Navigate(URLFromCKPT(CKPT_ICSCHOICE));
  3784. break;
  3785. }
  3786. }
  3787. }
  3788. }
  3789. // fall through...
  3790. case CKPT_ACTIVATION:
  3791. trace("GoNavigate: CKPT_ACTIVATION");
  3792. // If we are in NoWelcomeFinish, skip activation here.
  3793. // if g_ActivationRequired = true, run Activation. Else fall through to Registration.
  3794. if ( !window.external.GetNoWelcomeFinish() &&
  3795. ((UseNetwork() || UseModem())
  3796. && (g_ActivationRequired)
  3797. && (g_status != STATUS_OFF) )
  3798. )
  3799. {
  3800. PushCKPT(CKPT_ACTIVATION);
  3801. Navigate(URLFromCKPT(CKPT_ACTIVATION));
  3802. break;
  3803. }
  3804. // fall through...
  3805. case CKPT_REGISTER1:
  3806. trace("GoNavigate: CKPT_REGISTER1");
  3807. // If we are in NoWelcomeFinish, skip Registration.
  3808. if ( !window.external.GetNoWelcomeFinish() &&
  3809. ( (UseNetwork() || UseModem())
  3810. && !window.external.get_RegStatus()
  3811. && 1 != StatusObj.get_Status(MS_REGISTRATION)
  3812. && 1 != StatusObj.get_Status(OEM_REGISTRATION)
  3813. && (g_status != STATUS_OFF) )
  3814. )
  3815. {
  3816. PushCKPT(CKPT_REGISTER1);
  3817. Navigate(URLFromCKPT(CKPT_REGISTER1));
  3818. break;
  3819. }
  3820. // fall through...
  3821. case CKPT_ICONN:
  3822. trace("GoNavigate: CKPT_ICONN");
  3823. if ( !window.external.GetNoWelcomeFinish() &&
  3824. !g_bIsSetupUpgrade)
  3825. {
  3826. if ( (STATUS_ISP == g_status) && UseAnalogModem())
  3827. {
  3828. PushCKPT(CKPT_ICONN);
  3829. Navigate(URLFromCKPT(CKPT_ICONN));
  3830. break;
  3831. }
  3832. }
  3833. // fall through...
  3834. case CKPT_ISPSIGNUP:
  3835. trace("GoNavigate: CKPT_ISPSIGNUP");
  3836. if ( !window.external.GetNoWelcomeFinish() &&
  3837. (STATUS_ISP == g_status))
  3838. {
  3839. if ( (!g_bIsSetupUpgrade && UseAnalogModem()) ||
  3840. (g_bIsSetupUpgrade &&
  3841. ((!ConnectedToInternetEx(false) && HasAnalogModem()) ||
  3842. UseAnalogModem())
  3843. )
  3844. )
  3845. {
  3846. PushCKPT(CKPT_ISPSIGNUP);
  3847. Navigate(URLFromCKPT(CKPT_ISPSIGNUP));
  3848. break;
  3849. }
  3850. }
  3851. // fall through...
  3852. // BEGIN OEM CASES. DO NOT ADD CASES between here and CKPT_DONE. Doing so
  3853. // will break navigation.
  3854. //
  3855. case CKPT_OEMISP: // PreConfig case
  3856. trace("GoNavigate: CKPT_OEMISP");
  3857. if (!g_bIsSetupUpgrade)
  3858. {
  3859. if ( (STATUS_PRECONFIG == g_status) && !window.external.GetNoIspPreconfig())
  3860. {
  3861. ResetDialing();
  3862. PushCKPT(CKPT_OEMISP);
  3863. Navigate(URLFromCKPT(CKPT_OEMISP));
  3864. break;
  3865. }
  3866. }
  3867. // fall through...
  3868. case CKPT_OEMCUST:
  3869. trace("GoNavigate: CKPT_OEMCUST");
  3870. // Next line of code added by TandyT to support special ISP signup process commands
  3871. // Calls to function in agtcore.js
  3872. Agent_TurnOffISPSpecialCommands();
  3873. ResetDialing();
  3874. if (1 == DirObj.get_OEMCust)
  3875. {
  3876. PushCKPT(CKPT_OEMCUST);
  3877. Navigate(URLFromCKPT(CKPT_OEMCUST));
  3878. break;
  3879. }
  3880. // fall through...
  3881. //
  3882. // END OEM CASES
  3883. case CKPT_IDENTITIES2:
  3884. trace("GoNavigate: CKPT_IDENTITIES2");
  3885. if (!window.external.GetNoWelcomeFinish())
  3886. {
  3887. IspAccountObj.Check();
  3888. if (NeedToCreateAccount())
  3889. {
  3890. PushCKPT(CKPT_IDENTITIES2);
  3891. Navigate(URLFromCKPT(CKPT_IDENTITIES2));
  3892. break;
  3893. }
  3894. else
  3895. {
  3896. InfoObj.set_UseIdentities(false);
  3897. }
  3898. }
  3899. // fall through...
  3900. case CKPT_DONE:
  3901. trace("GoNavigate: CKPT_DONE");
  3902. ResetDialing();
  3903. if (!window.external.GetNoWelcomeFinish())
  3904. {
  3905. PushCKPT(CKPT_DONE);
  3906. Navigate(URLFromCKPT(CKPT_DONE));
  3907. }
  3908. else
  3909. {
  3910. PushCKPT(CKPT_DONE);
  3911. GoNext();
  3912. }
  3913. break;
  3914. default:
  3915. trace("GoNavigate: default (" + ckptGoHere + ")");
  3916. PushCKPT(ckptGoHere); // sets g_CurrentCKPT = ckptGoHere;
  3917. Navigate(URLFromCKPT(ckptGoHere));
  3918. break;
  3919. }
  3920. StatusNavigate();
  3921. // AGENT: notify Agent, code in AgtCore.js
  3922. Agent_OnNavigate();
  3923. }
  3924. ///////////////////////////////////////////////////////////////////////////////
  3925. // GoNext
  3926. //
  3927. // This function is responsible for
  3928. // * Saving state for a page when the Next button is clicked.
  3929. // * Calling GoNavigate with the checkpoint id of the next checkpoint
  3930. //
  3931. // This function is NOT responsible for
  3932. // * Setting state for the next page. That should be done in GoNavigate.
  3933. //
  3934. // Default behavior is to call GoNavigate with an invalid checkpoint id.
  3935. // Therefore each checkpoint MUST have a case in the switch statement.
  3936. //
  3937. ///////////////////////////////////////////////////////////////////////////////
  3938. function GoNext()
  3939. {
  3940. try
  3941. {
  3942. if (IsLocalFile() && g.event == null)
  3943. return;
  3944. }
  3945. catch(e)
  3946. {
  3947. return;
  3948. }
  3949. DisableAllButtons();
  3950. switch (g_CurrentCKPT)
  3951. {
  3952. case CKPT_ANIMATION:
  3953. try
  3954. {
  3955. IntroAnimation.Controls.Stop();
  3956. IntroAnimation.style.visibility = "hidden";
  3957. }
  3958. catch(err)
  3959. {
  3960. var temp = "EXCEPTION THROWN: WMP control failed to stop.";
  3961. temp += "\rerror name: " + err.name;
  3962. temp += "\rmessage: " + err.message;
  3963. temp += "\rnumber: " + err.number;
  3964. temp += "\rdescription: " + err.description;
  3965. trace(temp);
  3966. }
  3967. MovieFrame.style.display = "none";
  3968. GoNavigate(CKPT_HWCHK);
  3969. break;
  3970. case CKPT_HWCHK:
  3971. GoNavigate(CKPT_HWCHK);
  3972. break;
  3973. case CKPT_WELCOME:
  3974. g_DidWePassWelcomePage = true;
  3975. g.document.body.style.cursor = "wait";
  3976. window.setTimeout("GoNavigate(CKPT_MOUSETUT1);",50);
  3977. break;
  3978. case CKPT_MOUSETUT1:
  3979. GoNavigate(CKPT_IMETUTORIAL);
  3980. break;
  3981. case CKPT_IMETUTORIAL:
  3982. GoNavigate(CKPT_OEMHW);
  3983. break;
  3984. case CKPT_OEMHW:
  3985. GoNavigate(CKPT_REGION_KEYBD);
  3986. break;
  3987. case CKPT_REGION_KEYBD:
  3988. // setting these to null fixes hanging bug where user clicks on selmenus
  3989. // during execution of SaveSettings
  3990. g.selKeyboard.disabled = true;
  3991. g.selKeyboard.onchange = null;
  3992. g.selRegion.disabled = true;
  3993. g.selRegion.onchange = null;
  3994. g.selLang.disabled = true;
  3995. g.selLang.onchange = null;
  3996. g.document.body.style.cursor = "wait";
  3997. LangObj.set_RegionIndex(g.selRegion.selectedIndex)
  3998. LangObj.set_LangIndex(g.selLang.selectedIndex);
  3999. LangObj.set_KeyboardLayoutIndex(g.selKeyboard.selectedIndex);
  4000. // must always call SaveSettings() since apparently there is
  4001. // no way to know current language setting of machine
  4002. LangObj.SaveSettings();
  4003. if (LANGUAGE_REBOOT_NOW == LangObj.get_RebootState())
  4004. GoNavigate(CKPT_REGKB_COMMIT);
  4005. else
  4006. GoNavigate(CKPT_TIMEZONE);
  4007. g.document.body.style.cursor = "default";
  4008. break;
  4009. case CKPT_REGKB_COMMIT:
  4010. // "Next" for this page indicates a restart
  4011. PopCKPT(CKPT_REGKB_COMMIT); // Don't want this in our history anymore after reboot
  4012. PopCKPT(CKPT_REGION_KEYBD);
  4013. PushCKPT(CKPT_TIMEZONE); // so when we come back after reboot we are on
  4014. // the timezone page
  4015. StatusObj.set_Status(LANGUAGECOMPLETED, true);
  4016. window.external.PowerDown(POWERDOWN_REBOOT);
  4017. break;
  4018. case CKPT_TIMEZONE:
  4019. g_daylight = g.daylight.checked;
  4020. g_CurTimeZoneIdx = g.selTimeZone.selectedIndex;
  4021. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneSaved", 1);
  4022. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneIdx", g_CurTimeZoneIdx);
  4023. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "DayLight", g_daylight);
  4024. GoNavigate(CKPT_EULA);
  4025. break;
  4026. case CKPT_EULA:
  4027. if (EulaObj.get_EULAAcceptance)
  4028. {
  4029. PopCKPT();
  4030. GoNavigate(CKPT_PRODUCTKEY);
  4031. }
  4032. else
  4033. GoNavigate(CKPT_EULA_DECLINE);
  4034. break;
  4035. case CKPT_EULA_DECLINE:
  4036. PopCKPT();
  4037. PushCKPT(CKPT_EULA); // go back to main eula page, not this one
  4038. window.external.PowerDown(POWERDOWN_SHUTDOWN);
  4039. break;
  4040. case CKPT_PRODUCTKEY:
  4041. StorePid();
  4042. if (PidObj.get_PID.length != 0 && PidObj.ValidatePID())
  4043. {
  4044. PopCKPT(CKPT_PRODUCTKEY);
  4045. GoNavigate(CKPT_COMPNAME);
  4046. }
  4047. else
  4048. {
  4049. GoNavigate(CKPT_BADPRODUCTKEY);
  4050. }
  4051. break;
  4052. case CKPT_BADPRODUCTKEY:
  4053. PopCKPT(); // go back to prodkey page on restart, not this one
  4054. PushCKPT(CKPT_PRODUCTKEY); // does this leave 2 pid pgs on stack?
  4055. window.external.PowerDown(POWERDOWN_SHUTDOWN);
  4056. break;
  4057. case CKPT_COMPNAME:
  4058. g.document.body.style.cursor = "wait";
  4059. if (COMPNAME_INVALIDNAME == CompName_OnNext())
  4060. {
  4061. g.document.body.style.cursor = "default";
  4062. }
  4063. break;
  4064. case CKPT_SECPASS:
  4065. g_AdminPassword = g.SecurityPass.value;
  4066. window.external.SetAdminPassword(
  4067. "",
  4068. g_AdminPassword
  4069. );
  4070. PopCKPT();
  4071. GoNavigate(CKPT_JNDOMAIN);
  4072. break;
  4073. case CKPT_JNDOMAIN:
  4074. window.external.JoinDomain(
  4075. g_DomainName,
  4076. g_DomainUser,
  4077. g_DomainPass,
  4078. g_Domain ? 1 : 0
  4079. );
  4080. g_DomainDone = true;
  4081. PopCKPT();
  4082. GoNavigate(CKPT_SCONNECT);
  4083. break;
  4084. case CKPT_ICSCHOICE:
  4085. if (CanConfigLan() == CONFIG_LAN_YES)
  4086. {
  4087. if (GetPublicLanCount() != 0)
  4088. {
  4089. if (g.radio_ChooseDSLCable.checked)
  4090. {
  4091. // Connect through a local area network or home network
  4092. // No firewall is necessary
  4093. window.external.FirewallPreferredConnection(false);
  4094. }
  4095. else if (g.radio_ChooseLAN.checked)
  4096. {
  4097. // Connect directly to the Internet
  4098. window.external.FirewallPreferredConnection(true);
  4099. }
  4100. GoNavigate(CKPT_ACTIVATION);
  4101. }
  4102. else
  4103. {
  4104. // g_fFirewallRequired is used to identify if user has gone through
  4105. // CKPT_DSLMAIN or CKPT_DSLBROADBAND
  4106. if (g.radio_ChooseDSLCable.checked)
  4107. {
  4108. g_fFirewallRequired = true;
  4109. GoNavigate(CKPT_DSLMAIN);
  4110. }
  4111. else if (g.radio_ChooseLAN.checked)
  4112. {
  4113. // go to Setting up high speed connection (dsl_b.htm).
  4114. g_fFirewallRequired = false;
  4115. GoNavigate(CKPT_DSLBROADBAND);
  4116. }
  4117. else if (g.radio_ChooseModem.checked)
  4118. {
  4119. g_fFirewallRequired = false;
  4120. SetPreferredConnection(CONNECTIONTYPE_MODEM);
  4121. GoNavigate(CKPT_ACTIVATION);
  4122. }
  4123. }
  4124. }
  4125. else
  4126. {
  4127. PopCKPT(CKPT_ICSCHOICE);
  4128. GoNavigate(CKPT_HOMENETWIZPROMPT);
  4129. }
  4130. break;
  4131. case CKPT_DSLMAIN:
  4132. if (g.dsltypeform.radioDSLYes.checked)
  4133. {
  4134. GoNavigate(CKPT_DSLPPPOE);
  4135. }
  4136. else
  4137. {
  4138. GoNavigate(CKPT_DSLBROADBAND);
  4139. }
  4140. break;
  4141. case CKPT_DSLPPPOE:
  4142. if (dsl_pppoe_OnNext())
  4143. {
  4144. PopCKPT();
  4145. GoNavigate(CKPT_ACTIVATION);
  4146. // GoNavigate(CKPT_CONGRATS);
  4147. }
  4148. else
  4149. {
  4150. // validation failed: reload the page. Fields in error will be
  4151. // flagged in red.
  4152. dsl_pppoe_LoadMe();
  4153. }
  4154. break;
  4155. case CKPT_DSLBROADBAND:
  4156. if (dsl_broadband_OnNext())
  4157. {
  4158. PopCKPT();
  4159. GoNavigate(CKPT_ACTIVATION);
  4160. // GoNavigate(CKPT_CONGRATS);
  4161. }
  4162. else
  4163. {
  4164. // validation failed: reload the page. Fields in error will be
  4165. // flagged in red.
  4166. dsl_broadband_LoadMe();
  4167. }
  4168. break;
  4169. case CKPT_SCONNECT:
  4170. // Don't need to pop this checkpoint since it's not on the stack.
  4171. GoNavigate(CKPT_ACTIVATION);
  4172. break;
  4173. case CKPT_CONGRATS:
  4174. PopCKPT(CKPT_CONGRATS);
  4175. PopCKPT(CKPT_DSLMAIN);
  4176. GoNavigate(CKPT_ACTIVATION);
  4177. break;
  4178. case CKPT_HOMENETWIZPROMPT:
  4179. // We can't configure the firewall settings; It doesn't
  4180. // mean we don't have internet connectivity.
  4181. GoNavigate(CKPT_ACTIVATION);
  4182. break;
  4183. case CKPT_ACTIVATION:
  4184. // Check and set the status of g_fRegWithMS before we go to the next checkpoint.
  4185. // If users don't want to Activate Windows, and PostToOEM=1, goto Reg1.htm.
  4186. // Otherwise, if PostToOEM is not equal to 1, skip Reg1.htm and
  4187. // proceed to the next checkpoint, in this case, CKPT_ICONN.
  4188. //
  4189. if (g.rb_act_1.checked)
  4190. {
  4191. g_DoActivation = true;
  4192. g_fRegWithMS=true;
  4193. GoNavigate(CKPT_REGISTER1);
  4194. }
  4195. else
  4196. {
  4197. g_DoActivation = false;
  4198. g_fRegWithMS=false;
  4199. if (1 == RegisterObj.get_PostToOEM)
  4200. GoNavigate(CKPT_REGISTER1);
  4201. else
  4202. GoNavigate(CKPT_ICONN);
  4203. }
  4204. break;
  4205. case CKPT_REGISTER1:
  4206. if (g_fRegWithMS)
  4207. {
  4208. if (g.rb_reg_ms_yes.checked)
  4209. g_PostToMS=true;
  4210. else
  4211. g_PostToMS=false;
  4212. }
  4213. else
  4214. {
  4215. g_PostToMS=false;
  4216. }
  4217. if (1 == RegisterObj.get_PostToOEM)
  4218. {
  4219. if (g.rb_reg_oem_yes.checked)
  4220. g_PostToOEM=true;
  4221. else
  4222. g_PostToOEM=false;
  4223. }
  4224. else
  4225. {
  4226. g_PostToOEM=false;
  4227. }
  4228. Reg1SaveRadioState();
  4229. if (g_PostToMS || g_PostToOEM)
  4230. {
  4231. GoNavigate(CKPT_REGISTER3);
  4232. }
  4233. else if ( !g_DoActivation )
  4234. {
  4235. GoNavigate(CKPT_ICONN);
  4236. }
  4237. else if (UseNetwork())
  4238. {
  4239. LanActReg();
  4240. }
  4241. else if (UseModem())
  4242. {
  4243. GoNavigate(CKPT_REGDIAL);
  4244. }
  4245. else
  4246. {
  4247. // Theoretically we should never get here. If we do, let's just go
  4248. // on to the next thing.
  4249. //
  4250. trace("GoNext: CKPT_REGISTER1 - ERROR: Unable to connect to internet.");
  4251. GoNavigate(CKPT_ICONN);
  4252. }
  4253. break;
  4254. case CKPT_REGISTER3:
  4255. trace("GoNext: CKPT_REGISTER3");
  4256. var L_Reg3Title_Text = "Submitting Registration Information ...";
  4257. if(VerifyReg3Fields())
  4258. {
  4259. Reg3SaveSettings();
  4260. Save_Registered_owner(g.UserFirstName.value, g.UserLastName.value);
  4261. if (UseNetwork())
  4262. {
  4263. LanActReg();
  4264. }
  4265. else
  4266. {
  4267. GoNavigate(CKPT_REGDIAL);
  4268. }
  4269. g.document.body.style.cursor = "wait";
  4270. g.sharems.disabled = true;
  4271. g.firstname.disabled = true;
  4272. g.lastname.disabled = true;
  4273. g.Address.disabled = true;
  4274. g.Address2.disabled = true;
  4275. g.City.disabled = true;
  4276. g.State.disabled = true;
  4277. g.Zipcode.disabled = true;
  4278. g.Email.disabled = true;
  4279. g.selCountry.disabled = true;
  4280. g.selCAProvince.disabled = true;
  4281. g.selUSState.disabled = true;
  4282. g.Reg3Title.innerHTML = L_Reg3Title_Text;
  4283. }
  4284. break;
  4285. case CKPT_ACT_MSG:
  4286. PopCKPT();
  4287. GoNavigate(CKPT_ICONN);
  4288. break;
  4289. case CKPT_ICONN:
  4290. if (g.radioYesIconn.checked)
  4291. {
  4292. GoNavigate(CKPT_ISPSIGNUP);
  4293. }
  4294. else if (g.radioNoIconn.checked)
  4295. {
  4296. GoNavigate(CKPT_OEMCUST);
  4297. }
  4298. break;
  4299. case CKPT_ISPSIGNUP:
  4300. trace("GoNext: CKPT_ISPSIGNUP");
  4301. if (g.radioGetNewISP.checked)
  4302. {
  4303. if (window.external.CheckOnlineStatus && window.external.CheckStayConnected("msobe.isp"))
  4304. {
  4305. PushCKPT(CKPT_ISPDIAL);
  4306. g_IgnoreDialErr = false;
  4307. window.external.Connect(CONNECTED_ISP_SIGNUP, "msobe.isp");
  4308. }
  4309. else
  4310. {
  4311. window.external.Hangup();
  4312. GoNavigate(CKPT_ISPDIAL); // Getting Online
  4313. }
  4314. }
  4315. else if ((g.radioMigrateISP != null) && g.radioMigrateISP.checked)
  4316. {
  4317. // We want the default behavior to be showing the migration path if ISPMigrate = 0 or
  4318. // is not specified
  4319. if (!DirObj.get_ShowISPMigration())
  4320. {
  4321. if (window.external.CheckOnlineStatus && window.external.CheckStayConnected("migrate.isp"))
  4322. {
  4323. g_bTapiDone = false;
  4324. GoNavigate(CKPT_REFDIAL);
  4325. }
  4326. else
  4327. {
  4328. window.external.Hangup();
  4329. GoNavigate(CKPT_REFDIAL);
  4330. }
  4331. }
  4332. else
  4333. {
  4334. GoNavigate(CKPT_ICONNECT);
  4335. }
  4336. }
  4337. else
  4338. {
  4339. GoCancel(); // skip checked
  4340. }
  4341. break;
  4342. case CKPT_REFDIAL:
  4343. GoNavigate(CKPT_ICONNECT);
  4344. break;
  4345. case CKPT_ICONNECT:
  4346. GoNavigate(CKPT_OEMCUST);
  4347. break;
  4348. case CKPT_ISPDIAL:
  4349. GoNavigate(CKPT_OEMCUST);
  4350. break;
  4351. case CKPT_REGDIAL:
  4352. GoNavigate(CKPT_ICONN);
  4353. break;
  4354. case CKPT_OEMISP:
  4355. GoNavigate(CKPT_OEMCUST);
  4356. break;
  4357. case CKPT_OEMCUST:
  4358. GoNavigate(CKPT_IDENTITIES2);
  4359. break;
  4360. case CKPT_IDENTITIES2:
  4361. Identities2_OnLeave();
  4362. if (g_Identities2_OK)
  4363. {
  4364. // ASSUME: user can't go back at finish page,
  4365. // otherwise it would disallow owner name from reflecting
  4366. // the identities.
  4367. if (!g_RegisteredOwnerDone)
  4368. {
  4369. Save_Registered_owner(g.txtUser.item(g_NameToSaveIndex).value);
  4370. }
  4371. InfoObj.set_UseIdentities(true);
  4372. GoNavigate(CKPT_DONE);
  4373. }
  4374. else
  4375. {
  4376. Identities2_LoadMe();
  4377. }
  4378. break;
  4379. case CKPT_DONE:
  4380. g.document.body.style.cursor = "wait";
  4381. var finish = window.external.Finish();
  4382. g.document.body.style.cursor = "default";
  4383. if (finish == FINISH_OK || finish == FINISH_REBOOT)
  4384. {
  4385. if (IspAccountObj.HasSignUp() && InfoObj.get_UseIdentities())
  4386. {
  4387. // If no user accounts were created, then the ProfileName
  4388. // should be set to the default profile name. Otherwise,
  4389. // if just the first one is left blank for some reason,
  4390. // the ProfileName should not be written
  4391. var Identity0 = InfoObj.get_Identity(0);
  4392. var ProfileName = InfoObj.get_DefaultNewUser();
  4393. if ((Identity0 != null) && (Identity0 != "") &&
  4394. (ProfileName != null) && (ProfileName != ""))
  4395. {
  4396. IspAccountObj.SetProfileName(ProfileName);
  4397. }
  4398. }
  4399. SysClockObj.set_AutoDaylight(g_daylight);
  4400. if (SysClockObj.set_TimeZoneIdx(g_CurTimeZoneIdx))
  4401. {// User selected a different timezone, because of a timezone&font issue we need to reboot.
  4402. finish = FINISH_REBOOT;
  4403. }
  4404. }
  4405. if (finish == FINISH_REBOOT) // Finish was successful, but we need to reboot
  4406. {
  4407. window.external.PowerDown(POWERDOWN_REBOOT);
  4408. }
  4409. else if (finish != FINISH_OK)
  4410. {
  4411. // allow ourselves to go back to those pages if they gave us bad
  4412. // information
  4413. EmptyCKPTStack();
  4414. if (finish & FINISH_BAD_PID)
  4415. {
  4416. GoNavigate(CKPT_PRODUCTKEY);
  4417. }
  4418. else if (finish & FINISH_BAD_EULA)
  4419. {
  4420. GoNavigate(CKPT_EULA);
  4421. }
  4422. else
  4423. {
  4424. // setupX "stamp" of user.exe failed, we should nav to the
  4425. // earliest page in the flow...
  4426. GoNavigate(CKPT_WELCOME);
  4427. }
  4428. }
  4429. break;
  4430. default:
  4431. // BUGBUG should we remove the default altogether?
  4432. GoNavigate(Need_to_handle_this_CKPT_in_GoNext);
  4433. break;
  4434. }
  4435. }
  4436. // BUGBUG temporary until MSN changes code
  4437. function GoOffline()
  4438. {
  4439. GoNext();
  4440. }
  4441. function GetCurrentPageName() {
  4442. var re = new RegExp("\\\\([^\\\\]+)$");
  4443. re.exec(g.window.location.pathname);
  4444. return RegExp.$1;
  4445. }
  4446. // these handle next/back navigation for non-checkpoint pages
  4447. function SimpleNavBack()
  4448. {
  4449. g.window.history.back();
  4450. }
  4451. /*
  4452. This version of SimpleNavNext contains the workaround for IE 90257. not enabled yet
  4453. another part of 90527 fix is in InitButtons()
  4454. */
  4455. function SimpleNavNext() // original version that does not fix IE 90257
  4456. {
  4457. var CurPage = GetCurrentPageName();
  4458. var NextPage = g_SimpleNavMap.Item(CurPage);
  4459. Navigate(NextPage);
  4460. }
  4461. // Description: Disable all the buttons
  4462. // Used to prevent script error caused by
  4463. // double clicking or rapid clicking
  4464. // of two different buttons. E.g. when someone click
  4465. // next and back quickly.
  4466. //
  4467. function DisableAllButtons()
  4468. {
  4469. try
  4470. {
  4471. if(g.btnNext!=null)
  4472. {
  4473. g.btnNext.onclick=null;
  4474. }
  4475. } catch (e) {}
  4476. try
  4477. {
  4478. if(g.btnBack!=null)
  4479. {
  4480. g.btnBack.onclick=null;
  4481. }
  4482. } catch (e) {}
  4483. try
  4484. {
  4485. if(g.btnSkip!=null)
  4486. {
  4487. g.btnSkip.onclick=null;
  4488. }
  4489. } catch (e) {}
  4490. try
  4491. {
  4492. g.btnNext.disabled=true;
  4493. g.btnNext.className="newbuttonsNext-disabled";
  4494. }
  4495. catch(e) {}
  4496. try
  4497. {
  4498. g.btnBack.disabled=true;
  4499. g.btnBack.className="newbuttonsBack-disabled";
  4500. }
  4501. catch(e) {}
  4502. try
  4503. {
  4504. g.btnSkip.disabled=true;
  4505. g.btnSkip.className="newbuttonsSkip-disabled";
  4506. }
  4507. catch(e) {}
  4508. }
  4509. // Function: InitFrameRef
  4510. // Description: Sets up globals to point to buttons
  4511. // Since the buttons exist on the child frame,
  4512. // we want to have quick access to them without
  4513. // going through the collections.
  4514. //
  4515. // WARNING: Call this function at the top of XXX_LoadMe()
  4516. //
  4517. // SIDE-EFFECT: This function also sets the watermark appropriate for the screen size.
  4518. //
  4519. function InitFrameRef(ExternalModule)
  4520. {
  4521. trace("GoNext: InitFrameRef");
  4522. try
  4523. {
  4524. document.frames("connDelay").frameElement.style.display="none";
  4525. document.frames("connDelay").frameElement.style.zIndex=-1;
  4526. // We want to see a black frame around OOBE if our res. is > 1024.
  4527. // We initially set it to blue so that we will have a smooth transition from
  4528. // our animation to OOBE.
  4529. OOBEDocBody.style.backgroundColor="#000000";
  4530. }
  4531. catch (e)
  4532. {
  4533. }
  4534. g_LastButtonText = null;
  4535. g_FirstFocusElement = null;
  4536. g_LastKeyDown = null;
  4537. g = document.frames("msoobeMain");
  4538. try
  4539. {
  4540. g.document.body.style.backgroundColor = "transparent";
  4541. }
  4542. catch(e){}
  4543. try
  4544. {
  4545. if (g != null)
  4546. {
  4547. if(g.btnNext!=null)
  4548. g.btnNext.disabled=false;
  4549. if(g.btnBack!=null)
  4550. g.btnBack.disabled=false;
  4551. if(g.btnSkip!=null)
  4552. g.btnSkip.disabled=false;
  4553. }
  4554. g.document.body.onkeydown = OnKeyDown;
  4555. g.document.body.style.cursor = 'auto';
  4556. }
  4557. catch(e){}
  4558. }
  4559. function HideButtons(buttons)
  4560. {
  4561. if (null != g.btnBack && (buttons & HIDE_BACK))
  4562. {
  4563. g.btnBack.Hide = true;
  4564. }
  4565. if (null != g.btnNext && (buttons & HIDE_NEXT))
  4566. {
  4567. g.btnNext.Hide = true;
  4568. }
  4569. if (null != g.spanCancel && (buttons & HIDE_CANCEL))
  4570. {
  4571. g.btnSkip.Hide = true;
  4572. }
  4573. /*
  4574. if (null != g.spanRestore && (buttons & HIDE_RESTORE))
  4575. {
  4576. g.btnRestore.Hide = true;
  4577. }
  4578. */
  4579. }
  4580. function HandleButtonMouseOver()
  4581. {
  4582. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4583. this.className="buttons-hover";
  4584. }
  4585. function HandleButtonMouseOut()
  4586. {
  4587. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4588. this.className="buttons";
  4589. }
  4590. function InitButtons(SimpleBack, SimpleNext)
  4591. {
  4592. // Some js files like dialmgr.js are both being used by OOBE and desktop activation,
  4593. // and the call to Initbuttons could either be in msobshel.htx or actshell.htx, so it's best to leave
  4594. // the initbuttons in the js files as it is and perform a checking here if we are in full screen OOBE or not.
  4595. if (!InReminderMode())
  4596. {
  4597. InitNewButtons(SimpleBack, SimpleNext);
  4598. }
  4599. else
  4600. {
  4601. if(g.btnSkip!=null) {
  4602. g.btnSkip.onmouseover = HandleButtonMouseOver;
  4603. g.btnSkip.onmouseout = HandleButtonMouseOut;
  4604. if(!g.btnSkip.disabled) {
  4605. g.btnSkip.onclick = GoCancel;
  4606. // dont enable onfocus,onblur handlers until issues in 88615 are resolved
  4607. // g.btnSkip.onfocus = HandleButtonMouseOver;
  4608. // g.btnSkip.onblur = HandleButtonMouseOut;
  4609. g.btnSkip.className="buttons";
  4610. } else {
  4611. g.btnSkip.className="buttons-disabled";
  4612. }
  4613. }
  4614. if (g.btnNext != null)
  4615. {
  4616. g.btnNext.onmouseover = HandleButtonMouseOver;
  4617. g.btnNext.onmouseout = HandleButtonMouseOut;
  4618. if (!g.btnNext.disabled)
  4619. {
  4620. if (SimpleNext == null)
  4621. {
  4622. g.btnNext.onclick = GoNext;
  4623. }
  4624. else
  4625. {
  4626. g.btnNext.onclick = SimpleNavNext;
  4627. }
  4628. g.btnNext.className="buttons";
  4629. }
  4630. else
  4631. {
  4632. g.btnNext.className="buttons-disabled";
  4633. }
  4634. }
  4635. if (g.btnBack != null)
  4636. {
  4637. g.btnBack.onmouseover = HandleButtonMouseOver;
  4638. g.btnBack.onmouseout = HandleButtonMouseOut;
  4639. if (!g.btnBack.disabled)
  4640. {
  4641. if (SimpleBack == null)
  4642. {
  4643. g.btnBack.onclick = GoBack;
  4644. }
  4645. else
  4646. {
  4647. g.btnBack.onclick = SimpleNavBack;
  4648. }
  4649. g.btnBack.className="buttons";
  4650. }
  4651. else
  4652. {
  4653. g.btnBack.className="buttons-disabled";
  4654. }
  4655. }
  4656. }
  4657. }
  4658. // New OOBE buttons
  4659. // -----------------------------------------------
  4660. function HandleBackButtonMouseOver()
  4661. {
  4662. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4663. this.className="newbuttonsBack-hover";
  4664. }
  4665. function HandleBackButtonMouseOut()
  4666. {
  4667. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4668. this.className="newbuttonsBack";
  4669. }
  4670. function HandleBackButtonMouseDown()
  4671. {
  4672. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4673. this.className="newbuttonsBack-down";
  4674. }
  4675. function HandleSkipButtonMouseOver()
  4676. {
  4677. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4678. this.className="newbuttonsSkip-hover";
  4679. }
  4680. function HandleSkipButtonMouseOut()
  4681. {
  4682. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4683. this.className="newbuttonsSkip";
  4684. }
  4685. function HandleSkipButtonMouseDown()
  4686. {
  4687. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4688. this.className="newbuttonsSkip-down";
  4689. }
  4690. function HandleNextButtonMouseOver()
  4691. {
  4692. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4693. this.className="newbuttonsNext-hover";
  4694. }
  4695. function HandleNextButtonMouseOut()
  4696. {
  4697. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4698. this.className="newbuttonsNext";
  4699. }
  4700. function HandleNextButtonMouseDown()
  4701. {
  4702. if((!this.disabled)&&(this.tagName=="BUTTON"))
  4703. this.className="newbuttonsNext-down";
  4704. }
  4705. function InitNewButtons(NewSimpleBack, NewSimpleNext)
  4706. {
  4707. if(g.btnSkip!=null)
  4708. {
  4709. g.btnSkip.onmouseover = HandleSkipButtonMouseOver;
  4710. g.btnSkip.onmouseout = HandleSkipButtonMouseOut;
  4711. g.btnSkip.onmousedown = HandleSkipButtonMouseDown;
  4712. if(!g.btnSkip.disabled)
  4713. {
  4714. g.btnSkip.onclick = GoCancel;
  4715. g.btnSkip.className="newbuttonsSkip";
  4716. }
  4717. else
  4718. {
  4719. g.btnSkip.className="newbuttonsSkip-disabled";
  4720. }
  4721. }
  4722. if (g.btnNext != null)
  4723. {
  4724. g.btnNext.onmouseover = HandleNextButtonMouseOver;
  4725. g.btnNext.onmouseout = HandleNextButtonMouseOut;
  4726. g.btnNext.onmousedown = HandleNextButtonMouseDown;
  4727. if (!g.btnNext.disabled)
  4728. {
  4729. if (NewSimpleNext == null)
  4730. g.btnNext.onclick = GoNext;
  4731. else
  4732. g.btnNext.onclick = SimpleNavNext;
  4733. g.btnNext.className="newbuttonsNext";
  4734. }
  4735. else
  4736. {
  4737. g.btnNext.className="newbuttonsNext-disabled";
  4738. }
  4739. }
  4740. if (g.btnBack != null)
  4741. {
  4742. g.btnBack.onmouseover = HandleBackButtonMouseOver;
  4743. g.btnBack.onmouseout = HandleBackButtonMouseOut;
  4744. g.btnBack.onmousedown = HandleBackButtonMouseDown;
  4745. if (!g.btnBack.disabled)
  4746. {
  4747. if (NewSimpleBack == null)
  4748. g.btnBack.onclick = GoBack;
  4749. else
  4750. g.btnBack.onclick = SimpleNavBack;
  4751. g.btnBack.className="newbuttonsBack";
  4752. }
  4753. else
  4754. {
  4755. g.btnBack.className="newbuttonsBack-disabled";
  4756. }
  4757. }
  4758. }
  4759. var g_LastKeyDown = null;
  4760. function OnKeyDown()
  4761. {
  4762. try
  4763. {
  4764. if (IsLocalFile() && g.event == null)
  4765. return;
  4766. }
  4767. catch(e)
  4768. {
  4769. return;
  4770. }
  4771. if (g.event.altKey)
  4772. {
  4773. g_LastKeyDown = String.fromCharCode(g.event.keyCode);
  4774. if (g_LastKeyDown != null)
  4775. g_LastKeyDown = g_LastKeyDown.toUpperCase();
  4776. }
  4777. else
  4778. g_LastKeyDown = null;
  4779. // AGENT: pass keydown to Agent, NOTE: code in AgtCore.js
  4780. Agent_OnKeyDown(g.event.srcElement);
  4781. }
  4782. // AGENT: SelectClick is used by Agent
  4783. function OnSelectClick()
  4784. {
  4785. Agent_OnSelectClick(g.event.srcElement);
  4786. }
  4787. // AGENT: OnClick is used by Agent
  4788. function OnClick()
  4789. {
  4790. Agent_OnElementClick(g.event.srcElement);
  4791. }
  4792. // AGENT: Focus functions are used by Agent
  4793. function OnFocus()
  4794. {
  4795. // Put other code here that needs access to the focus event
  4796. Agent_OnFocus(g.event.srcElement);
  4797. }
  4798. // VALIDATION ROUTINES
  4799. function KeyPressIsNumeric()
  4800. {
  4801. try
  4802. {
  4803. if (IsLocalFile() && g.event == null)
  4804. return;
  4805. }
  4806. catch(e)
  4807. {
  4808. return;
  4809. }
  4810. if (!IsNumeric(g.event.keyCode))
  4811. {
  4812. g.event.keyCode = 0;
  4813. g.event.returnValue = false;
  4814. }
  4815. }
  4816. function IsNumeric(keyCode)
  4817. {
  4818. if ((keyCode >= 48/*0*/) && (keyCode <= 57/*9*/))
  4819. return true;
  4820. else
  4821. return false;
  4822. }
  4823. function IsSpecial(keyCode)
  4824. {
  4825. // BUGBUG DISABLED FOR BETA
  4826. /*
  4827. var bFound = false;
  4828. var iPosition = 0;
  4829. for (;iPosition < g_SpecialChars.length; iPosition++)
  4830. {
  4831. if (g_SpecialChars.charCodeAt(iPosition) == keyCode)
  4832. {
  4833. bFound = true;
  4834. break;
  4835. }
  4836. }
  4837. return bFound;
  4838. */
  4839. return false;
  4840. }
  4841. function KeyPressIsValid()
  4842. {
  4843. try
  4844. {
  4845. if (IsLocalFile() && g.event == null)
  4846. return;
  4847. }
  4848. catch(e)
  4849. {
  4850. return;
  4851. }
  4852. if (!IsAlpha(g.event.keyCode) &&
  4853. !IsSpecial(g.event.keyCode) &&
  4854. !IsNumeric(g.event.keyCode))
  4855. {
  4856. g.event.keyCode = 0;
  4857. g.event.returnValue = false;
  4858. }
  4859. }
  4860. function KeyPressIsAlpha()
  4861. {
  4862. try
  4863. {
  4864. if (IsLocalFile() && g.event == null)
  4865. return;
  4866. }
  4867. catch(e)
  4868. {
  4869. return;
  4870. }
  4871. if (!IsAlpha(g.event.keyCode))
  4872. {
  4873. g.event.keyCode = 0;
  4874. g.event.returnValue = false;
  4875. }
  4876. }
  4877. function IsAlpha(keyCode)
  4878. {
  4879. // BUGBUG DISABLED FOR BETA
  4880. /*
  4881. var strKeyCode = String.fromCharCode(keyCode);
  4882. var re1 = new RegExp("\w"); // BUGBUG: should \ be escaped?
  4883. var re2 = new RegExp("\D"); // BUGBUG: should \ be escaped?
  4884. strKeyCode.match(re1);
  4885. strKeyCode.match(re2);
  4886. //return ((strKeyCode.match(re1) != null) && (strKeyCode.match(re2) != null));
  4887. */
  4888. // if ((keyCode >= 97/*a*/ && keyCode <= 122/*z*/) ||
  4889. // (keyCode >= 65/*A*/ && keyCode <= 90 /*Z*/))
  4890. return true;
  4891. // else
  4892. // return false;
  4893. }
  4894. function NumberOfSpaces(strValue)
  4895. {
  4896. /*
  4897. var NASexp = RegExp("\s"); // BUGBUG: should \ be escaped?
  4898. var result = strValue.match(NASexp);
  4899. return ((result == null) || (result.length != strValue.length));
  4900. */
  4901. var iSpaceCount = 0;
  4902. for (iPosition = 0; iPosition < strValue.length; iPosition ++)
  4903. {
  4904. if (strValue.charAt(iPosition) == ' ')
  4905. {
  4906. iSpaceCount++;
  4907. }
  4908. }
  4909. return iSpaceCount;
  4910. }
  4911. function KeyCodeToUpper()
  4912. {
  4913. var strKeyCode = String.fromCharCode(g.event.keyCode);
  4914. strKeyCode = strKeyCode.toUpperCase();
  4915. g.event.keyCode = strKeyCode.charCodeAt(0);
  4916. }
  4917. // END VALIDATION ROUTINES
  4918. function FlashPlayerInstalled()
  4919. {
  4920. var fReturn = false;
  4921. try
  4922. {
  4923. // Correlate the PROGID and CLSID sections of the registry, then determine
  4924. // whether the inproc server exists.
  4925. //
  4926. // Trailing backslashes on registry paths are required to read default
  4927. // value.
  4928. //
  4929. strProgId = WshShell.RegRead("HKCR\\CLSID\\"
  4930. + CLSID_FLASH_PLAYER
  4931. + "\\VersionIndependentProgID\\");
  4932. if ( PROGID_FLASH_PLAYER == strProgId
  4933. && CLSID_FLASH_PLAYER == WshShell.RegRead( "HKCR\\"
  4934. + strProgId
  4935. + "\\CLSID\\")
  4936. )
  4937. {
  4938. strInprocServer32 = WshShell.RegRead( "HKCR\\CLSID\\"
  4939. + CLSID_FLASH_PLAYER
  4940. + "\\InprocServer32\\"
  4941. );
  4942. fReturn = FileSystemObj.FileExists(strInprocServer32);
  4943. }
  4944. }
  4945. catch (err)
  4946. {
  4947. // if an exception is thrown, something grave is amiss. It is safer to
  4948. // assume player is not installed.
  4949. //
  4950. fReturn = false;
  4951. }
  4952. return fReturn;
  4953. }
  4954. function InitApplication()
  4955. {
  4956. OOBEDocBody.style.cursor = "wait"; // show "wait" cursor while initializing
  4957. OOBEDocBody.style.backgroundColor="black";
  4958. g_bStartup = true;
  4959. InitFrameRef();
  4960. // Check if oemlogo under [Branding] is present in oobeinfo.ini,
  4961. // If so, check if that file does exists, and then use it.
  4962. var OEMLogoFile = null;
  4963. OEMLogoFile = ApiObj.get_INIKey("branding", "oemlogo");
  4964. if ( (OEMLogoFile != null)
  4965. && (OEMLogoFile.length>0)
  4966. && FileSystemObj.FileExists(g_OOBEDirPath+"images\\"+OEMLogoFile) )
  4967. {
  4968. spnOEMLogo.style.visibility="visible";
  4969. spnOEMLogo.style.backgroundImage = 'url(images/' + OEMLogoFile + ')';
  4970. }
  4971. NewMicrosoftLogo.src = 'images/mslogo.jpg';
  4972. g_bInHighScreenRes =
  4973. (window.top.screen.width >= 1024) &&
  4974. (window.top.screen.height >= 768);
  4975. // reset all parameters that change in high screen resolution
  4976. if (g_bInHighScreenRes)
  4977. {
  4978. NewWatermarkBackground.src = 'images/newmark1.jpg';
  4979. NewWatermarkTop.src = 'images/newtop1.jpg';
  4980. NewWatermarkBottom.src = 'images/newbtm1.jpg';
  4981. NewWatermarkBottom.style.top = 712;
  4982. ScreenFrame.style.width = 1024;
  4983. ScreenFrame.style.height = 768;
  4984. MainFrameTable.style.top = 28;
  4985. MainFrameTable.style.height = "99%";
  4986. document.frames("ifrmConnDelay").frameElement.style.left=0;
  4987. spnOEMLogo.style.left = 749;
  4988. spnAssist.style.top = 590;
  4989. spnAssist.style.left = 815;
  4990. spnAssist.style.width = 240;
  4991. }
  4992. else
  4993. {
  4994. NewWatermarkBackground.src = 'images/newmark8.jpg';
  4995. NewWatermarkTop.src = 'images/newtop8.jpg';
  4996. NewWatermarkBottom.src = 'images/newbtm8.jpg';
  4997. NewWatermarkBottom.style.top = 542;
  4998. // If our Window width and/or height is less then 800 or 600,
  4999. // this will add horizontal and/or vertical scroll bar.
  5000. ScreenFrame.style.width = 800;
  5001. ScreenFrame.style.height = 600;
  5002. }
  5003. // Move Agent to the left regardless of our resolution if we are in Bidi.
  5004. if (window.parent.document.dir == "rtl")
  5005. spnAssist.style.left = 10;
  5006. var ScreenDiff = window.top.screen.width - parseInt(ScreenFrame.style.width);
  5007. ScreenFrame.style.left = (ScreenDiff > 0) ? ScreenDiff / 2 : 0;
  5008. ScreenDiff = window.top.screen.height - parseInt(ScreenFrame.style.height);
  5009. ScreenFrame.style.top = (ScreenDiff > 0) ? ScreenDiff / 2 : 0;
  5010. // Set the alternate text for the movie and Agent
  5011. var L_MovieAlt_Text = "Welcome";
  5012. var L_AgentAlt_Text = "Click me to get help";
  5013. IntroAnimation.alt = L_MovieAlt_Text;
  5014. AssistImg.alt = L_AgentAlt_Text;
  5015. // WARNING: Force the No Modem status pane because InitStatusPane currently
  5016. // causes the RACM and Telephony services to be started in order to
  5017. // enumerate modems. When CheckDialReady uses PnP or some other means to
  5018. // enumerate modems, InitStatusPane can be called here to correctly
  5019. // initialize the status pane.
  5020. //
  5021. g_status = STATUS_OFF;
  5022. window.external.LoadStatusItems("No Modem");
  5023. InitCKPT();
  5024. // IME handling
  5025. g_IMEExists = FileSystemObj.FileExists(ApiObj.get_SystemDirectory() + "\\OOBE\\HTML\\IME\\IMETut1.htm");
  5026. Agent_Init();
  5027. if ( 0 != window.external.get_RetailOOBE() )
  5028. {
  5029. EmptyCKPTStack();
  5030. }
  5031. g_bIsSetupUpgrade = window.external.IsUpgrade();
  5032. spnPage.style.visibility = "visible";
  5033. if (ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneSaved") == 1)
  5034. {
  5035. g_CurTimeZoneIdx = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneIdx");
  5036. g_daylight = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "DayLight");
  5037. }
  5038. if ( window.external.get_RetailOOBE() ||
  5039. g_CurrentCKPT > CKPT_COMPNAME ||
  5040. DirObj.get_IntroOnly()
  5041. )
  5042. {
  5043. // Make sure services.exe doesn't hang.
  5044. window.external.ComputerNameChangeComplete(false);
  5045. }
  5046. if ( !window.external.get_RetailOOBE() &&
  5047. window.external.GetNoWelcomeFinish() )
  5048. {
  5049. ApiObj.OEMComputername();
  5050. CompName_ChangeComplete(false);
  5051. window.external.OEMPassword();
  5052. // set it to something, since the oem prepopulated the password.
  5053. // We don't want to ask the question in this case.
  5054. g_AdminPassword = ""
  5055. }
  5056. // Construct the "To continue, click Next" string
  5057. // This will work for both BiDi and non-BiDi scenarios.
  5058. g_ClickNextStrWelcome = "<table tabindex=-1 border=0 style=\"position:absolute; top: " + ((!g_bInHighScreenRes) ? L_ClickNextStrTopPercent800_Text : L_ClickNextStrTopPercent1024_Text) + "; left:2%; width:95%\"><tr>"
  5059. +"<td class=\"text-primary\" ID=NextText nowrap>"+L_ContStr_Text+" <span class=\"emphasis-lesser\">"
  5060. +L_NextStr_Text+"</span>"+L_ClickNextLocStr_Text+L_Period_Text+"</td><td width=90%>&nbsp;</td></tr></table>";
  5061. // Check if user has previously selected a preferred connection type.
  5062. // This is for cases where OOBE was cold booted on any page after the ics.htm page
  5063. // This will cause proper navigation especially when we cold boot for ex. in isp.htm
  5064. // Check the registry if we have previously saved the connection type through SetPreferredConnection() in icsmgr.js
  5065. var AnyPrefConnection = null;
  5066. try
  5067. {
  5068. AnyPrefConnection = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", PREFCONN_REG_VALUE);
  5069. }
  5070. catch(e){AnyPrefConnection = null}
  5071. if (AnyPrefConnection == null)
  5072. g_PreferredConnection = CONNECTIONTYPE_INVALID;
  5073. else
  5074. g_PreferredConnection = AnyPrefConnection;
  5075. // Navigate to proper page
  5076. if (null == g_CurrentCKPT)
  5077. {
  5078. GoNavigate(CKPT_ANIMATION);
  5079. }
  5080. else
  5081. {
  5082. if (g_CurrentCKPT > CKPT_COMPNAME)
  5083. {
  5084. // Start services, etc. if OOBE won't navigate through CKPT_COMPNAME
  5085. //
  5086. CompName_ChangeComplete(false);
  5087. }
  5088. OOBEDocBody.style.cursor = "default";
  5089. ScreenFrame.style.display = "inline";
  5090. GoNavigate(g_CurrentCKPT);
  5091. }
  5092. // Start the music.
  5093. PlayBackgroundMusic();
  5094. // Now that we've navigated, make sure we show the OOBE window.
  5095. window.external.ShowOOBEWindow();
  5096. }
  5097. function InitStatusMenu()
  5098. {
  5099. trace("InitStatusMenu");
  5100. if ( (1 == DirObj.get_Offline() || false == InternetCapabilityExists() ))
  5101. {
  5102. g_status = STATUS_OFF;
  5103. StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
  5104. window.external.LoadStatusItems("No Modem");
  5105. }
  5106. else
  5107. {
  5108. if (UseIcs())
  5109. {
  5110. window.external.TriggerIcsCallback(true);
  5111. }
  5112. else
  5113. {
  5114. window.external.TriggerIcsCallback(false);
  5115. }
  5116. var str = DirObj.get_ISPSignup().toUpperCase();
  5117. if ("MSN" == str)
  5118. {
  5119. g_status = STATUS_ISP;
  5120. if ( window.external.get_RegStatus() )
  5121. window.external.LoadStatusItems("MSN(No Reg)");
  5122. else
  5123. window.external.LoadStatusItems("MSN");
  5124. }
  5125. else if ("OFFLINE" == str)
  5126. {
  5127. g_status = STATUS_ISP;
  5128. if ( window.external.get_RegStatus() )
  5129. window.external.LoadStatusItems("Offline(No Reg)");
  5130. else
  5131. window.external.LoadStatusItems("Offline");
  5132. }
  5133. else if ("PRECONFIG" == str)
  5134. {
  5135. g_status = STATUS_PRECONFIG;
  5136. if ( window.external.get_RegStatus() )
  5137. window.external.LoadStatusItems("Preconfig(No Reg)");
  5138. else
  5139. window.external.LoadStatusItems("Preconfig");
  5140. }
  5141. else
  5142. {
  5143. g_status = STATUS_NONE;
  5144. StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
  5145. if ( window.external.get_RegStatus() )
  5146. window.external.LoadStatusItems("None(No Reg)");
  5147. else
  5148. window.external.LoadStatusItems("None");
  5149. }
  5150. }
  5151. }
  5152. function ProcessQueuedEvents() {
  5153. // flush all WM_ events in windows queue.
  5154. // workaround for IE 103880, 'white flashes in statpane & button on page unload'
  5155. window.external.ProcessQueuedEvents();
  5156. }
  5157. // Update status pane and navigate
  5158. function navigatetoPrivacy(PrivPage)
  5159. {
  5160. if(g_CurrentCKPT == CKPT_REGISTER1) {
  5161. Reg1SaveRadioState();
  5162. }
  5163. if(g_CurrentCKPT == CKPT_REGISTER3) {
  5164. Reg3SaveSettings();
  5165. }
  5166. if (PrivPage == "MS")
  5167. Navigate("setup\\prvcyMS.htm");
  5168. else if (PrivPage == "Activation_Policy")
  5169. Navigate("setup\\act_plcy.htm");
  5170. else
  5171. Navigate("setup\\OEMpriv.htm");
  5172. }
  5173. function navigatetoEULA()
  5174. {
  5175. Navigate("setup\\neweula2.htm");
  5176. }
  5177. ///////////////////////////////////////////////////////////////////////////////
  5178. // isp.htm
  5179. ///////////////////////////////////////////////////////////////////////////////
  5180. function GetAncestorByTag(elem, tagName)
  5181. {
  5182. if (elem == null || tagName == null)
  5183. {
  5184. return null;
  5185. }
  5186. var aNode = elem.parentNode;
  5187. var tagNameUpperCase = tagName.toUpperCase();
  5188. while (aNode != null && aNode.nodeName != tagNameUpperCase)
  5189. {
  5190. aNode = aNode.parentNode;
  5191. }
  5192. return aNode;
  5193. }
  5194. var g_bRadioMigrateISP=false;
  5195. var g_MSNISP=false;
  5196. var g_ExistISP=false;
  5197. var g_NoISP=false;
  5198. var L_RetailMSN_Text = "<b><u>G</u>et online with MSN </b><br>Select this option if you're a new or existing MSN member.";
  5199. var L_UpgradeSkip_Text = "<b><u>D</u>o not set up an Internet connection at this time</b><br>Select this option if you already have an Internet connection on your computer, or if you do not want to set up an MSN Internet connection at this time.";
  5200. var L_UpgradeSkipAccessKey_Text = "D";
  5201. function IspLoadMe()
  5202. {
  5203. InitFrameRef();
  5204. if (window.external.get_RetailOOBE())
  5205. {
  5206. g.ISP_New.innerHTML = L_RetailMSN_Text;
  5207. }
  5208. if (g_status == STATUS_ISP || g_status == STATUS_OFF)
  5209. {
  5210. g.radioGetNewISP.style.display = "inline";
  5211. g.ISP_New.style.display = "inline";
  5212. g.radioGetNewISP.checked=true;
  5213. g_FirstFocusElement = g.radioGetNewISP;
  5214. if (g_bIsSetupUpgrade)
  5215. {
  5216. var trMigrateISP = GetAncestorByTag(g.radioMigrateISP, "TR");
  5217. var tableMigrateISP = GetAncestorByTag(trMigrateISP, "TABLE");
  5218. if ((tableMigrateISP != null) && (trMigrateISP != null))
  5219. {
  5220. tableMigrateISP.deleteRow(trMigrateISP.rowIndex);
  5221. }
  5222. g.skipISP.accessKey = L_UpgradeSkipAccessKey_Text;
  5223. g.skipISP.innerHTML = L_UpgradeSkip_Text;
  5224. }
  5225. }
  5226. else
  5227. {
  5228. g.radioGetNewISP.style.display = "none";
  5229. g.ISP_New.style.display = "none";
  5230. g.radioMigrateISP.checked=true;
  5231. g_FirstFocusElement = g.radioMigrateISP;
  5232. }
  5233. InitNewButtons();
  5234. g_FirstFocusElement.focus();
  5235. }
  5236. function IspUnLoad()
  5237. {
  5238. try
  5239. {
  5240. g_bRadioMigrateISP = (g.event.srcElement==g.radioMigrateISP);
  5241. }
  5242. catch (e) {}
  5243. }
  5244. ///////////////////////////////////////////////////////////////////////////////
  5245. // ics.htm
  5246. ///////////////////////////////////////////////////////////////////////////////
  5247. function IcsLoadMe()
  5248. {
  5249. InitFrameRef();
  5250. InitNewButtons();
  5251. if (CanConfigLan() == CONFIG_LAN_UNKNOWN)
  5252. {
  5253. g.title_ics0.style.display="inline";
  5254. g.text_description_ics0.style.display="inline";
  5255. g.img_status_ics0.style.display="inline";
  5256. g.btnNext.className="newbuttonsNext-disabled";
  5257. g.btnNext.disabled=true;
  5258. CheckIfConfigLan("IcsLoadMe2()");
  5259. }
  5260. else
  5261. {
  5262. IcsLoadMe2();
  5263. }
  5264. }
  5265. function IcsLoadMe2()
  5266. {
  5267. if (!g || !g.title_ics0 || !g.title_ics1 || !g.title_ics2)
  5268. {
  5269. // the page may already be skipped
  5270. return;
  5271. }
  5272. if (CanConfigLan() == CONFIG_LAN_YES)
  5273. {
  5274. g.title_ics0.style.display="none";
  5275. g.text_description_ics0.style.display="none";
  5276. g.img_status_ics0.style.display="none";
  5277. g.btnNext.disabled = false;
  5278. g.btnNext.className="newbuttonsNext";
  5279. g.radio_ics1.style.display="inline";
  5280. g.radio_ics2.style.display="inline";
  5281. if (GetPublicLanCount() != 0)
  5282. {
  5283. g.title_ics1.style.display="inline";
  5284. g.text_description_ics1.style.display="inline";
  5285. g.radio_description1_ics1.style.display="inline";
  5286. g.radio_description2_ics1.style.display="inline";
  5287. g.text_description2_ics1.style.display="inline";
  5288. }
  5289. else
  5290. {
  5291. g.title_ics2.style.display="inline";
  5292. g.text_description_ics2.style.display="inline";
  5293. g.radio_description1_ics2.style.display="inline";
  5294. g.radio_description2_ics2.style.display="inline";
  5295. g.radio_description1_ics2x.style.display="inline";
  5296. g.radio_description2_ics2x.style.display="inline";
  5297. if (HasModem())
  5298. {
  5299. g.TXT_MODEM01.style.display="inline";
  5300. g.TXT_MODEM02.style.display="inline";
  5301. g.TXT_MODEM02x.style.display="inline";
  5302. g.radio_ChooseModem.checked="true";
  5303. }
  5304. }
  5305. g_FirstFocusElement = g.btnNext;
  5306. g_FirstFocusElement.focus();
  5307. }
  5308. else
  5309. {
  5310. g.btnNext.disabled = false;
  5311. g.btnNext.click();
  5312. }
  5313. }
  5314. ///////////////////////////////////////////////////////////////////////////////
  5315. //iconn.htm
  5316. ///////////////////////////////////////////////////////////////////////////////
  5317. var g_YesIconn=false;
  5318. var g_NoIconn=false;
  5319. function IconnLoadMe()
  5320. {
  5321. InitFrameRef();
  5322. if(g_YesIconn) {
  5323. g.radioYesIconn.checked=true;
  5324. } else if(g_NoIconn){
  5325. g.radioNoIconn.checked=true;
  5326. }else {
  5327. g.radioNoIconn.checked=false;
  5328. g.radioYesIconn.checked=false;
  5329. }
  5330. g_FirstFocusElement = g.btnNext;
  5331. g_FirstFocusElement.focus();
  5332. g.btnBack.disabled=true;
  5333. if(!(g.radioYesIconn.checked || g.radioNoIconn.checked))
  5334. g.btnNext.disabled=true;
  5335. g.radioYesIconn.onclick = Iconn_HandleClick;
  5336. g.radioNoIconn.onclick = Iconn_HandleClick;
  5337. InitNewButtons();
  5338. }
  5339. function Iconn_HandleClick()
  5340. {
  5341. try
  5342. {
  5343. g_YesIconn = (g.event.srcElement==g.radioYesIconn);
  5344. g_NoIconn = (g.event.srcElement==g.radioNoIconn);
  5345. IconnRadioClicked();
  5346. }
  5347. catch (err)
  5348. {
  5349. logError("Iconn_HandleClick", err);
  5350. throw err;
  5351. }
  5352. }
  5353. function IconnRadioClicked()
  5354. {
  5355. // if they click on either button, enable next
  5356. if(g.btnNext.disabled && (g.radioYesIconn.checked || g.radioNoIconn.checked))
  5357. {
  5358. g.btnNext.onmouseover = HandleNextButtonMouseOver;
  5359. g.btnNext.onmouseout = HandleNextButtonMouseOut;
  5360. g.btnNext.onmousedown = HandleNextButtonMouseDown;
  5361. g.btnNext.className="newbuttonsNext";
  5362. g.btnNext.disabled = false;
  5363. g.btnNext.onclick = GoNext;
  5364. g.btnNext.focus();
  5365. }
  5366. }
  5367. ///////////////////////////////////////////////////////////////////////////////
  5368. // ident1.htm
  5369. ///////////////////////////////////////////////////////////////////////////////
  5370. var g_cIdentitiesMax = InfoObj.get_IdentitiesMax();
  5371. ///////////////////////////////////////////////////////////////////////////////
  5372. // NeedToCreateAccount
  5373. //
  5374. // Determine whether OOBE should navigate to the first identities page or username page
  5375. // and, if so, navigate there.
  5376. //
  5377. // Returns true if OOBE navigates to the page, false otherwise.
  5378. //
  5379. ///////////////////////////////////////////////////////////////////////////////
  5380. function NeedToCreateAccount()
  5381. {
  5382. try
  5383. {
  5384. // Look for reasons not to show the identities and username page.
  5385. //
  5386. if ( window.external.GetNetJoinStatus() == JOIN_STATUS_DOMAIN ) {
  5387. trace("NeedToCreateAccount: Joining a domain");
  5388. return false;
  5389. }
  5390. if (1 == InfoObj.get_OEMIdentities())
  5391. {
  5392. trace("NeedToCreateAccount: OEM identities are used");
  5393. return false;
  5394. }
  5395. var iUserCount = window.external.GetLocalUserCount();
  5396. if ( iUserCount > 1 ) {
  5397. trace("NeedToCreateAccount: GetLocalUserCount returned " + iUserCount);
  5398. return false;
  5399. }
  5400. return true;
  5401. }
  5402. catch (err)
  5403. {
  5404. logError("NeedToCreateAccount", err);
  5405. throw err;
  5406. }
  5407. return true;
  5408. }
  5409. // Initialize the page
  5410. //
  5411. function Identities1_LoadMe()
  5412. {
  5413. try
  5414. {
  5415. InitFrameRef();
  5416. g_FirstFocusElement = g.btnNext;
  5417. var MultipleIdentities = InfoObj.get_UseIdentities();
  5418. if(MultipleIdentities) {
  5419. g.radioMultipleIdentities.checked=true;
  5420. } else {
  5421. g.radioSingleIdentity.checked=true;
  5422. }
  5423. g.radioMultipleIdentities.onclick = Identities1_HandleClick;
  5424. g.radioSingleIdentity.onclick = Identities1_HandleClick;
  5425. InitNewButtons();
  5426. if (g_FirstFocusElement != null)
  5427. g_FirstFocusElement.focus();
  5428. }
  5429. catch (err)
  5430. {
  5431. logError("Identities1_LoadMe", err);
  5432. throw err;
  5433. }
  5434. }
  5435. // Save the state of the multiple identies option button. The value of
  5436. // InfoObj.get_UseIdentities() will determine whether subsequent identities pages are
  5437. // displayed.
  5438. //
  5439. function Identities1_HandleClick()
  5440. {
  5441. try
  5442. {
  5443. var MultipleIdentities = (g.event.srcElement==g.radioMultipleIdentities);
  5444. InfoObj.set_UseIdentities(MultipleIdentities);
  5445. }
  5446. catch (err)
  5447. {
  5448. logError("Identities1_HandleClick", err);
  5449. throw err;
  5450. }
  5451. }
  5452. ///////////////////////////////////////////////////////////////////////////////
  5453. // ident2.htm
  5454. ///////////////////////////////////////////////////////////////////////////////
  5455. var IspAccountObj = new IspAccount();
  5456. function IspAccount()
  5457. {
  5458. this.REG_KEY = "\\ISPAccount";
  5459. this.USERNAME_REG_VAL = "ISPUserName";
  5460. this.USERFRIENDLYNAME_REG_VAL = "ISPUserFriendlyName";
  5461. this.PROFILENAME_REG_VAL = "ProfileName";
  5462. this.IspName = "";
  5463. this.UserName = "";
  5464. this.UserFriendlyName = "";
  5465. this.SignUp = false;
  5466. this.Init = false;
  5467. }
  5468. function IspAccountHasSignUp()
  5469. {
  5470. if (this.Init == false)
  5471. {
  5472. this.Check();
  5473. this.Init = true;
  5474. }
  5475. return this.SignUp;
  5476. }
  5477. IspAccount.prototype.HasSignUp = IspAccountHasSignUp;
  5478. function IspAccountCheck()
  5479. {
  5480. this.SignUp = false;
  5481. this.IspName = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE,
  5482. OOBE_MAIN_REG_KEY + this.REG_KEY,
  5483. null);
  5484. if (this.IspName)
  5485. {
  5486. this.UserName = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE,
  5487. OOBE_MAIN_REG_KEY + this.REG_KEY,
  5488. this.USERNAME_REG_VAL);
  5489. if (this.UserName)
  5490. {
  5491. this.SignUp = true;
  5492. this.UserFriendlyName = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE,
  5493. OOBE_MAIN_REG_KEY + this.REG_KEY,
  5494. this.USERFRIENDLYNAME_REG_VAL);
  5495. }
  5496. }
  5497. return this.SignUp;
  5498. }
  5499. IspAccount.prototype.Check = IspAccountCheck;
  5500. function IspAccountSetProfileName(ProfileName)
  5501. {
  5502. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE,
  5503. OOBE_MAIN_REG_KEY + this.REG_KEY,
  5504. this.PROFILENAME_REG_VAL,
  5505. ProfileName);
  5506. }
  5507. IspAccount.prototype.SetProfileName = IspAccountSetProfileName;
  5508. var g_fFirstLoadIdentities = true;
  5509. // Initialize the page
  5510. //
  5511. function Identities2_LoadMe()
  5512. {
  5513. try
  5514. {
  5515. InitFrameRef();
  5516. g_FirstFocusElement = g.txtUser.item(0);
  5517. g_FirstFocusElement.focus(0);
  5518. g_FirstFocusElement.select(0);
  5519. if (g_fFirstLoadIdentities)
  5520. {
  5521. if (IspAccountObj.HasSignUp() &&
  5522. IspAccountObj.UserFriendlyName != null &&
  5523. IspAccountObj.UserFriendlyName != "")
  5524. {
  5525. InfoObj.set_Identity(0, IspAccountObj.UserFriendlyName);
  5526. }
  5527. else
  5528. {
  5529. InfoObj.SuggestIdentity0();
  5530. }
  5531. g_fFirstLoadIdentities = false;
  5532. g_Identities2_OK = true;
  5533. }
  5534. if (IspAccountObj.HasSignUp())
  5535. {
  5536. g.Ident2_IspAccountName.innerText = IspAccountObj.UserName;
  5537. g.Ident2_IspAccountName.style.display="inline";
  5538. }
  5539. Identities2_LoadIdentities();
  5540. InitNewButtons();
  5541. if (Identities2_Required())
  5542. {
  5543. g.btnSkip.style.visibility = "hidden";
  5544. g.SkipBtnLocalText.style.visibility = "hidden";
  5545. }
  5546. }
  5547. catch (err)
  5548. {
  5549. logError("Identities2_LoadMe", err);
  5550. throw err;
  5551. }
  5552. }
  5553. function Identities2_Required()
  5554. {
  5555. // IsSetupUpgrade return if it is an NT upgrade or not
  5556. return (!window.external.IsSetupUpgrade());
  5557. }
  5558. var g_Identities2_None = true;
  5559. // Retrieve any currently existing identities and stuff them in edit boxes.
  5560. //
  5561. function Identities2_LoadIdentities()
  5562. {
  5563. try
  5564. {
  5565. g.Ident2_Explain.style.display="none";
  5566. g.Ident2_Explain2.style.display="none";
  5567. if (null != g.txtUser)
  5568. {
  5569. // Don't use more identities than can be displayed.
  5570. //
  5571. iMax = (g.txtUser.length <= g_cIdentitiesMax) ? g.txtUser.length
  5572. : g_cIdentitiesMax;
  5573. for (i = 0; i < iMax; i++)
  5574. {
  5575. g.txtUser.item(i).value = InfoObj.get_Identity(i);
  5576. g_FirstFocusElement = g.txtUser.item(i)
  5577. if (InfoObj.check_Identity(i))
  5578. {
  5579. g.lblUser[i].className="text-primary";
  5580. }
  5581. else
  5582. {
  5583. trace("Identities2_LoadIdentities: check_identitiy failed for identity " +
  5584. i + ": " + g.txtUser.item(i).value);
  5585. g.lblUser[i].className="text-error";
  5586. g_FirstFocusElement.focus();
  5587. g_FirstFocusElement.select();
  5588. }
  5589. }
  5590. if (!g_Identities2_OK)
  5591. {
  5592. if (g_Identities2_None)
  5593. {
  5594. g.Ident2_Explain2.style.display="inline";
  5595. }
  5596. else
  5597. {
  5598. var CompName = ApiObj.get_ComputerName();
  5599. if (CompName)
  5600. {
  5601. var L_txtIdentities218_Text = "Names must not be equal to \"%1\", \"Administrator\" or \"Guest\"";
  5602. g.spnIdentities218.innerText = ApiObj.FormatMessage(L_txtIdentities218_Text, CompName);
  5603. }
  5604. g.Ident2_Explain.style.display="inline";
  5605. }
  5606. }
  5607. }
  5608. }
  5609. catch (err)
  5610. {
  5611. logError("Identities2_LoadIdentities", err);
  5612. throw err;
  5613. }
  5614. }
  5615. // Cache the identities the user has entered in the edit boxes.
  5616. //
  5617. var g_NameToSaveIndex = 0;
  5618. function Identities2_OnLeave()
  5619. {
  5620. try
  5621. {
  5622. if (null != g.txtUser)
  5623. {
  5624. // Don't use more identities than can be displayed.
  5625. //
  5626. iMax = (g.txtUser.length <= g_cIdentitiesMax) ? g.txtUser.length
  5627. : g_cIdentitiesMax;
  5628. // check if every field is empty
  5629. g_Identities2_None = true;
  5630. for (i = 0; i < iMax; i++)
  5631. {
  5632. if ((g.txtUser.item(i).value != null) && (g.txtUser.item(i).value != ""))
  5633. {
  5634. g_Identities2_None = false;
  5635. g_NameToSaveIndex = i;
  5636. break;
  5637. }
  5638. }
  5639. g_Identities2_OK = (Identities2_Required() ? !g_Identities2_None : true);
  5640. for (i = 0; i < iMax; i++)
  5641. {
  5642. InfoObj.set_Identity(i, g.txtUser.item(i).value);
  5643. if (!InfoObj.check_Identity(i))
  5644. {
  5645. g_Identities2_OK = false;
  5646. }
  5647. }
  5648. }
  5649. }
  5650. catch (err)
  5651. {
  5652. logError("Identities2_OnLeave", err);
  5653. throw err;
  5654. }
  5655. }
  5656. function IsValidRegisteredOwnerName(strName)
  5657. {
  5658. // This regex says "find a character that is NOT valid in a computer name."
  5659. //
  5660. var re = new RegExp("[^A-Za-z0-9 ]"); // We have a "space" between "9" and "]" because a "space" is a valid character for Registered Owner Name.
  5661. return (-1 == strName.search(re));
  5662. }
  5663. // Set the name as the Registered Owner of this computer
  5664. function Save_Registered_owner(OwnerFirstName, OwnerLastName)
  5665. {
  5666. try
  5667. {
  5668. var OwnerName = null;
  5669. if (OwnerFirstName && OwnerLastName)
  5670. {
  5671. var L_FullNameFmt_Text = "%1 %2";
  5672. OwnerName = ApiObj.FormatMessage(L_FullNameFmt_Text, OwnerFirstName, OwnerLastName);
  5673. }
  5674. else if (OwnerFirstName)
  5675. {
  5676. OwnerName = OwnerFirstName;
  5677. }
  5678. else if (OwnerLastName)
  5679. {
  5680. OwnerName = OwnerLastName;
  5681. }
  5682. if (OwnerName)
  5683. {
  5684. InfoObj.set_OwnerName(OwnerName);
  5685. g_RegisteredOwnerDone = true;
  5686. }
  5687. }
  5688. catch (err)
  5689. {
  5690. logError("Save_Registered_owner", err);
  5691. throw err;
  5692. g_RegisteredOwnerDone = false;
  5693. }
  5694. }
  5695. ////////////////////////////////////////////////////////////////////
  5696. // DO NOT REMOVE THIS FUNCTION THIS WILL GET CALLED WHEN F1 IS
  5697. // PRESSED.
  5698. ////////////////////////////////////////////////////////////////////
  5699. function OnHelp()
  5700. {
  5701. // Invoke MSAgent
  5702. Agent_OnUserRequestAssistant();
  5703. }
  5704. ////////////////////////////////////////////////////////////////////
  5705. // Background music function
  5706. ////////////////////////////////////////////////////////////////////
  5707. var g_fMusicPlayed = false;
  5708. function PlayBackgroundMusic()
  5709. {
  5710. if (!g_fMusicPlayed)
  5711. {
  5712. g_fMusicPlayed = true;
  5713. window.external.PlayBackgroundMusic();
  5714. }
  5715. }
  5716. </script>
  5717. </HEAD>
  5718. <BODY ID=OOBEDocBody leftMargin=0 DIR=LTR onload="InitApplication();" scroll=auto tabIndex=-1 topMargin=0 language=javascript onhelp="Agent_OnUserRequestAssistant();">
  5719. <SPAN ID=junkspan style="height:2px; width:2px; background-color:black; z-index:99; display:none">
  5720. </SPAN>
  5721. <SPAN ID=MovieFrame style="height:1;width:1;display:none">
  5722. <OBJECT CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
  5723. ID=IntroAnimation WIDTH=1 HEIGHT=1 style="visibility:hidden">
  5724. <PARAM name="EnableContextMenu" value="false">
  5725. <PARAM NAME="UIMode" VALUE="none">
  5726. <PARAM NAME="Enabled" VALUE="false">
  5727. <PARAM NAME="autoStart" VALUE="false">
  5728. <PARAM NAME="fullScreen" VALUE="true">
  5729. <PARAM NAME="URL" VALUE="images\intro.wmv">
  5730. <PARAM NAME="WindowlessVideo" VALUE="true">
  5731. </OBJECT>
  5732. </SPAN>
  5733. <SPAN ID=ScreenFrame style="height:100%; width:100%; position:absolute; display:none">
  5734. <IMG ID=NewWatermarkBackground style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-99;" alt="">
  5735. <IMG ID=NewWatermarkTop style="display: inline; LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-98;" alt="">
  5736. <IMG ID=NewWatermarkBottom style="display: inline; LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-97;" alt="">
  5737. <IMG ID=NewMicrosoftLogo style="display: inline; LEFT: 20px; TOP: 5px; POSITION: absolute; z-index:-96;" alt="">
  5738. <SPAN id=spnOEMLogo style="visibility:hidden; position:absolute; TOP:7px; LEFT:525px; width:255px; HEIGHT:40px; z-index:10; background-repeat:no-repeat;">
  5739. </SPAN>
  5740. <TABLE border=0 ID=MainFrameTable cellpadding=0 cellspacing=0 style="z-index:6; position:absolute; left:0px; top:25px; width:100%; height:97%">
  5741. <TR>
  5742. <TD style="height:100%">
  5743. <SPAN id=spnPage style="VISIBILITY: hidden; z-index:4;" tabIndex=-1>
  5744. <SPAN id=spnMainFrame style="width: 100%; height:100%" tabIndex=-1>
  5745. <IFRAME ALLOWTRANSPARENCY="true" id=ifrmMainFrame frameBorder=no scrolling=no width="100%" height="97%" name=msoobeMain tabIndex=0></IFRAME>
  5746. <IFRAME ALLOWTRANSPARENCY="true" id=ifrmConnDelay frameBorder=no style="display:none; position:absolute; z-index:-1; left: 0px; top: 0px;" scrolling=no width="100%" height="100%" name=connDelay tabIndex=-1 src="setup/ISPWait.htm"></IFRAME>
  5747. </SPAN>
  5748. </SPAN>
  5749. </TD>
  5750. <TD WIDTH=20></TD>
  5751. </TR>
  5752. </TABLE>
  5753. <comment>Make sure the spnAssist area (coverage) does not cover the Next button</comment>
  5754. <SPAN id=spnAssist class="emphasis-lesser" style="visibility:hidden; POSITION: absolute; LEFT: 625px; TOP: 440px; WIDTH: 180px; z-index:9">
  5755. <TABLE width="95%" cellspacing=0 cellpadding=0 align=center class="emphasis-lesser" style="text-align:center;color:white;">
  5756. <TR>
  5757. <TD align=center>
  5758. <IMG align=middle id=AssistImg border=0 src="images/qmark.gif"
  5759. style="visibility:hidden;z-index:9" language=javascript
  5760. onclick="Agent_OnUserRequestAssistant()"><BR>
  5761. </TD>
  5762. </TR>
  5763. <TR>
  5764. <TD ID=MerlinStr1 class="text-primary"><span id="agentStr1" onclick="Agent_OnUserRequestAssistant()"><id id="L_AgentHelp1_Text">For help,</id></span></TD>
  5765. </TR>
  5766. <TR>
  5767. <TD ID=MerlinStr2 class="text-primary"><span id="agentStr2" onclick="Agent_OnUserRequestAssistant()"><id id="L_AgentHelp2_Text">click here or press F1.</id></span></TD>
  5768. </TR>
  5769. <TR>
  5770. <TD ID=MerlinStr3_Extra_line_for_localization class="text-primary"><span id="agentStr3"><id id="L_AgentHelp3OptionalLine_Text"></id></span></TD>
  5771. </TR>
  5772. </TABLE>
  5773. </SPAN>
  5774. </SPAN>
  5775. </BODY>
  5776. </HTML>