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.

1918 lines
50 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. <script language=jscript src="AgtCore.js"></script>
  7. <script language=jscript src="AgtScrpt.js"></script>
  8. <script language=jscript src="oobeutil.js"></script>
  9. <script language=jscript src="migrate.js"></script>
  10. <script language=jscript src="dialmgr.js"></script>
  11. <script language=jscript src="error.js"></script>
  12. <script language=jscript src="icsmgr.js"></script>
  13. <script language=jscript src="isptype.js"></script>
  14. <script language=jscript src="iconnect.js"></script>
  15. <script language=jscript>
  16. // This is intended to hold all the script needed
  17. // in the default & offline OOBE HTML pages.
  18. //
  19. // We want to separate the layout (HTML) from the script.
  20. // At the same time, it's helpful to have all the code
  21. // in one place to make it easier to understand the flow
  22. // from page to page.
  23. var APP_OOBE_MODE = 0;
  24. var APP_MSN_MODE = 4;
  25. var APP_DESKTOP_MODE = 2;
  26. // Status location constants
  27. var STATUS_ISP = 0; // Do either MSN or local OEM offer
  28. var STATUS_PRECONFIG = 1; // Do the pre-configured OEM INS file
  29. var STATUS_NONE = 2; // Don't do any ISP offer
  30. var STATUS_OFF = 3; // Don't connect to the Internet
  31. var STATUS_MAX = 4;
  32. // For the new status pane, don't allow half way status
  33. var SNDX_WELCOME = 0;
  34. var SNDX_HW = 1;
  35. var SNDX_LEGAL = 2;
  36. var SNDX_REG = 3;
  37. var SNDX_ISP = 4;
  38. var SNDX_IDENTITIES = 5;
  39. var SNDX_FINI = 6;
  40. // holds non-checkpoint next navigation
  41. var g_SimpleNavMap = null;
  42. var g_CountryIdx=-1;
  43. ///////////////////////////////////////////////////////////////////////////////
  44. // CheckPoint
  45. //
  46. // Constructor for CheckPoint object.
  47. //
  48. ///////////////////////////////////////////////////////////////////////////////
  49. function CheckPoint(strURL, i1, i2, i3, i4)
  50. {
  51. this.strURL = strURL;
  52. this.rgindex = new Array(STATUS_MAX);
  53. this.rgindex[STATUS_ISP] = i1;
  54. this.rgindex[STATUS_PRECONFIG] = i2;
  55. this.rgindex[STATUS_NONE] = i3;
  56. this.rgindex[STATUS_OFF] = i4;
  57. }
  58. var curCKPT = 1;
  59. var CKPT_ISPSIGNUP = curCKPT++;
  60. var CKPT_MIGLIST = curCKPT++;
  61. var CKPT_ISPDIAL = curCKPT++;
  62. var CKPT_REFDIAL = curCKPT++;
  63. var CKPT_MIGDIAL = curCKPT++;
  64. var CKPT_ICONNECT = curCKPT++;
  65. var CKPT_OEMISP = curCKPT++;
  66. var CKPT_OEMCUST = curCKPT++;
  67. var CKPT_DONE = curCKPT++;
  68. var CKPT_MAX = curCKPT; // ALWAYS set this to be the biggest value!
  69. var dnCKPT = new Array(CKPT_MAX);
  70. var CKPT_REGDIAL = CKPT_MAX+1;
  71. var CKPT_REGISTER1 = CKPT_MAX+2;
  72. var CKPT_REGISTER3 = CKPT_MAX+3;
  73. var CKPT_ACT_MSG = CKPT_MAX+4;
  74. // Checkpoint breadcrumbs
  75. var g_CurrentCKPT = null;
  76. var g_DialCKPT = null;
  77. var HKEY_LOCAL_MACHINE = 0x80000002;
  78. var OOBE_MAIN_REG_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OOBE";
  79. var CKPT_REG_KEY = "\\CKPT";
  80. var TOS_REG_VALUE = "TopOfStack";
  81. var POWERDOWN_SHUTDOWN = 0;
  82. var POWERDOWN_REBOOT = 1;
  83. // CheckDialReady errors
  84. var ERR_COMM_NO_ERROR = 0;
  85. var ERR_COMM_OOBE_COMP_MISSING = 1;
  86. var ERR_COMM_UNKNOWN = 2; // Unknown error, check input parameters
  87. var ERR_COMM_NOMODEM = 3; // There is no modem installed
  88. var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
  89. var ERR_COMM_ISDN = 5;
  90. var ERR_COMM_PHONE_AND_ISDN = 6;
  91. // Dialing errors. Look at raserror.h for details
  92. var DERR_DIALTONE = 680;
  93. var DERR_BUSY = 676;
  94. var DERR_VOICEANSWER = 677;
  95. var DERR_NOANSWER = 678;
  96. var DERR_NO_CARRIER = 679;
  97. var DERR_HARDWARE_FAILURE = 630; // modem turned off
  98. var DERR_PORT_ALREADY_OPEN = 602; // procomm/hypertrm/RAS has COM port
  99. var DERR_PORT_OR_DEVICE = 692; // got this when hypertrm had the device open -- jmazner
  100. var DERR_PPP_TIMEOUT = 718;
  101. var DERR_REMOTE_DISCONNECT = 629; // Connection interrupted
  102. // Types of dialing using ISP files. e.g. Dial to registration, ISP, referral server
  103. var CONNECTED_REFFERAL = 1
  104. var CONNECTED_ISP_SIGNUP = 2
  105. var CONNECTED_ISP_MIGRATE = 3
  106. var CONNECTED_REGISTRATION = 4
  107. // Finish errors
  108. //
  109. // These MUST be kept in sync with the values in MSOBMAIN.H.
  110. //
  111. var FINISH_OK = 0x00000000;
  112. var FINISH_REBOOT = 0x00000001;
  113. var FINISH_BAD_PID = 0x00000002;
  114. var FINISH_BAD_EULA = 0x00000004;
  115. var FINISH_BAD_STAMP = 0x00000008;
  116. // Dictionary compare modes
  117. var COMPAREMODE_BINARY = 0;
  118. var COMPAREMODE_TEXT = 1;
  119. // on-the-fly button hiding
  120. var HIDE_BACK = 0x0001;
  121. var HIDE_NEXT = 0x0002;
  122. var HIDE_CANCEL = 0x0004;
  123. var HIDE_RESTORE = 0x0008;
  124. // Language reboot return codes
  125. var LANGUAGE_REBOOT_NEVER = 0;
  126. var LANGUAGE_REBOOT_NOW = 1;
  127. var LANGUAGE_REBOOT_END = 2;
  128. // keycode consts
  129. var KeyEsc = 0x1B;
  130. var KeyEnter = 0xD;
  131. var KeyBackSpc = 0x8;
  132. var KeyDelete = 0x2E;
  133. var KeyTab = 0x9;
  134. var KeyDwnArrow = 0x28;
  135. var KeyUpArrow = 0x26;
  136. var KeyLeftArrow = 0x25;
  137. var KeyRightArrow = 0x27;
  138. // BUGBUG temp GUIDs
  139. var NOLAUNCHISPSIGNUP = "{C37D92A5-CA34-11d2-B71C-00C04F794977}";
  140. var MSNCOMPLETED = "{1C0A22F2-CB6B-11d2-B544-00A0C949DA70}";
  141. // window.external object caches
  142. var TapiObj = null;
  143. var InfoObj = null;
  144. var EulaObj = null;
  145. var LangObj = null;
  146. var PidObj = null;
  147. var StatusObj = null;
  148. var DirObj = null;
  149. var ApiObj = null;
  150. var RegisterObj = null;
  151. var FileSystemObj = null;
  152. var g_Identities2_OK;
  153. // general globals and status
  154. var g_strISPFile = "";
  155. var g_bStartup;
  156. var g_LastButtonText = null;
  157. var g_FirstFocusElement = null;
  158. var g = null;
  159. var g_SpecialChars = ".'-` ";
  160. var g_OOBEDir = "file://" + window.external.API.get_SystemDirectory() + "\\oobe\\";
  161. var g_OOBEDirPath = window.external.API.get_SystemDirectory() + "\\oobe\\";
  162. var g_WaterMarkFileNameStr= window.external.API.get_SystemDirectory() + "\\OOBE\\images\\watermrk.gif";
  163. var g_WaterMarkFileSize = 29683; // size of default watermrk.gif
  164. var g_bRedial = false;
  165. var g_LineProblem = 0;
  166. var g_bFirstServerError = true;
  167. var g_status = STATUS_OFF;
  168. var g_ServerErrorCount = 0;
  169. var g_OEMAddBackURL = "";
  170. var g_DialingAvailableInCountry = true;
  171. var g_ModalDialogUp = false;
  172. var g_OEMNameStr = window.external.Signup.get_OEMName();
  173. var g_bTapiDone = false;
  174. // Mandatory Initialization Code
  175. if (null == FileSystemObj) {
  176. FileSystemObj = new ActiveXObject("Scripting.FileSystemObject");
  177. }
  178. if (null == ApiObj)
  179. {
  180. ApiObj = new Object;
  181. ApiObj = window.external.API;
  182. }
  183. if (null == StatusObj)
  184. {
  185. StatusObj = new Object;
  186. StatusObj = window.external.Status;
  187. }
  188. if (null == DirObj)
  189. {
  190. DirObj = new Object;
  191. DirObj = window.external.Directions;
  192. }
  193. if (null == InfoObj)
  194. {
  195. InfoObj = new Object;
  196. InfoObj = window.external.UserInfo;
  197. }
  198. if (null == TapiObj)
  199. {
  200. TapiObj = new Object;
  201. TapiObj = window.external.Tapi;
  202. }
  203. if (null == RegisterObj)
  204. {
  205. RegisterObj = new Object;
  206. RegisterObj = window.external.Register;
  207. }
  208. if (null == LangObj)
  209. {
  210. LangObj = new Object;
  211. LangObj = window.external.Language;
  212. }
  213. // END Initialization Code
  214. // another global, need DirObj first though
  215. var g_AgentDisabled = true;
  216. var L_ContStr_Text="To continue, click";
  217. var L_NextStr_Text="Next";
  218. var L_Period_Text=".";
  219. var L_ClickNextLocStr_Text=""; // for localizers to add stuff without affecting L_Period_Text
  220. var L_NextStrTopPercent_Text="83%";
  221. var L_ClickNextStrTopPercent800_Text="78%";
  222. var L_ClickNextStrTopPercent1024_Text="84%";
  223. var L_ClickNextStrLeftPercent_Text="30%";
  224. var g_ClickNextStr = "&nbsp;"
  225. var g_ClickNextStrWelcome = "";
  226. // Set up labelS for various getting connected Congratulations.
  227. var L_ConnectedDefaultHeading_Text = "Congratulations";
  228. var L_ConnectedNoInternetHeading_Text = "Could not find the Internet";
  229. var L_ConnectedDefault_Text = "You are now connected to the Internet.";
  230. var L_ConnectedViaICS_Text = "You are now connected to the Internet using ICS connection.";
  231. var L_ConnectedViaDSLCable_Text = "You are now connected to the Internet via your DSL/Cable connection.";
  232. var L_ConnectedViaLAN_Text = "You are now connected to the Internet using your LAN connection.";
  233. 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.";
  234. var g_Congrats_Type_Heading = L_ConnectedDefaultHeading_Text;
  235. var g_Congrats_Type = L_ConnectedDefault_Text;
  236. ///////////////////////////////////////////////////////////////////////////////
  237. // logError
  238. //
  239. // Log information from an error object. trace will send the info to
  240. // setuplog.txt and the debugger. If
  241. // HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\OOBE\MsDebug=DWORD:1
  242. // an alert will be displayed as well.
  243. //
  244. ///////////////////////////////////////////////////////////////////////////////
  245. function logError(funcName, errObj)
  246. {
  247. trace( "Exception in " + funcName
  248. + " (" + errObj.number.toString(16) + ") "
  249. + errObj.description + "\n"
  250. );
  251. if (true == DebugObj.get_MsDebugMode())
  252. {
  253. alert("OOBE ERROR\n"
  254. + "\n Function: " + funcName
  255. + "\n Error: " + errObj.number.toString(16)
  256. + "\nDescription: " + errObj.description
  257. );
  258. }
  259. }
  260. function FormatRequiredFieldLabel(element,error)
  261. {
  262. if (error)
  263. {
  264. element.className = "text-error";
  265. if (!(element.innerHTML.charAt(0) == "*"))
  266. {
  267. element.innerHTML = "* " + element.innerHTML
  268. }
  269. }
  270. else
  271. {
  272. element.className = "text-primary";
  273. if ((element.innerHTML.charAt(0) == "*"))
  274. {
  275. element.innerHTML = element.innerHTML.substring(2,(element.innerHTML.length - 1));
  276. }
  277. }
  278. }
  279. ///////////////////////////////////////////////////////////////////////////////
  280. // General Default LoadMe function
  281. ///////////////////////////////////////////////////////////////////////////////
  282. function _Default_LoadMe(SimpleBack, SimpleNext)
  283. {
  284. InitFrameRef();
  285. InitButtons(SimpleBack, SimpleNext);
  286. if (g.btnNext.style.visibility == "visible")
  287. g_FirstFocusElement = g.btnNext;
  288. else if (g.btnSkip.style.visibility == "visible")
  289. g_FirstFocusElement = g.btnSkip;
  290. else if (g.btnBack.style.visibility == "visible")
  291. g_FirstFocusElement = g.btnBack;
  292. if (g_FirstFocusElement != null)
  293. g_FirstFocusElement.focus();
  294. else
  295. g.document.body.focus();
  296. }
  297. function New_Default_LoadMe(SimpleBack, SimpleNext)
  298. {
  299. InitFrameRef();
  300. InitNewButtons(SimpleBack, SimpleNext);
  301. if (g.btnNext.style.visibility == "visible")
  302. g_FirstFocusElement = g.btnNext;
  303. else if (g.btnSkip.style.visibility == "visible")
  304. g_FirstFocusElement = g.btnSkip;
  305. else if (g.btnBack.style.visibility == "visible")
  306. g_FirstFocusElement = g.btnBack;
  307. if (g_FirstFocusElement != null)
  308. g_FirstFocusElement.focus();
  309. else
  310. g.document.body.focus();
  311. }
  312. // fini.htm
  313. // These vars are set on oobeutil.jsx
  314. var g_IsActivationSuccessful = false;
  315. var g_IsMSRegistrationSuccessful = false;
  316. var g_IsOEMRegistrationSuccessful = false;
  317. var g_ShowParagraph = false;
  318. function ShowFinish_Paragraph_Header()
  319. {
  320. if (g_ShowParagraph)
  321. {
  322. g.FiniSummaryIntro2.style.display = "inline";
  323. }
  324. }
  325. function FinishPage_LoadMe()
  326. {
  327. InitFrameRef();
  328. if (g_IsActivationSuccessful)
  329. {
  330. var L_ActivateWindows_Text = "You activated your copy of Windows.<BR>";
  331. g_ShowParagraph = true;
  332. g.FiniSummary0.innerHTML = L_ActivateWindows_Text;
  333. g.FiniSummary0.style.display = "inline";
  334. }
  335. // OEM didn't Pre-reg the machine
  336. if (1 != window.external.get_RegStatus())
  337. {
  338. if (1 == RegisterObj.get_PostToOEM && g_IsOEMRegistrationSuccessful)
  339. {
  340. var strOEMName = g_OEMNameStr;
  341. if (strOEMName == null || (strOEMName != null && strOEMName.length == 0))
  342. {
  343. var L_RegisterdWith_Text = "You registered your computer with the OEM.<BR>";
  344. g.FiniSummary1.innerHTML = L_RegisterdWith_Text;
  345. }
  346. else
  347. {
  348. var L_RegisterdWith_Text = "You registered your computer with %1.<BR>";
  349. g.FiniSummary1.innerHTML = ApiObj.FormatMessage(L_RegisterdWith_Text, strOEMName);
  350. }
  351. g_ShowParagraph = true;
  352. g.FiniSummary1.style.display = "inline";
  353. }
  354. if (g_IsMSRegistrationSuccessful)
  355. {
  356. var L_RegisterdWithMS_Text = "You registered your copy of Windows with Microsoft.<BR>";
  357. g_ShowParagraph = true;
  358. g.FiniSummary2.innerHTML = L_RegisterdWithMS_Text;
  359. g.FiniSummary2.style.display = "inline";
  360. }
  361. }
  362. var bHasSignup = 0;
  363. try
  364. {
  365. bHasSignup = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "ISPSignup");
  366. }
  367. catch (e) { bHasSignup = 0;}
  368. if (bHasSignup || ConnectedToInternetEx(false))
  369. {
  370. var L_SignupWith_Text = "Your computer is configured for Internet access.<BR>";
  371. g_ShowParagraph = true;
  372. g.FiniSummary3.innerHTML = L_SignupWith_Text;
  373. g.FiniSummary3.style.display = "inline";
  374. }
  375. ShowFinish_Paragraph_Header();
  376. if (LANGUAGE_REBOOT_END == LangObj.get_RebootState())
  377. {
  378. g.finishmsg.style.display="none";
  379. g.rebootfinishmsg.style.display="inline";
  380. }
  381. g.msgspan.style.display="inline";
  382. if (g.btnNext != null)
  383. g_FirstFocusElement = g.btnNext;
  384. else if (g.btnBack != null)
  385. g_FirstFocusElement = g.btnBack;
  386. InitNewButtons();
  387. g_FirstFocusElement.focus();
  388. }
  389. ///////////////////////////////////////////////////////////////////////////////
  390. // hndshake.htm
  391. ///////////////////////////////////////////////////////////////////////////////
  392. function hndshake_OnKeyPress()
  393. {
  394. try
  395. {
  396. if (g.event == null)
  397. return;
  398. }
  399. catch(e)
  400. {
  401. return;
  402. }
  403. // Treat the enter key like the next button
  404. if ((g.event.keyCode == KeyEnter) &&
  405. (g.btnNext.disabled == false))
  406. {
  407. GoNext();
  408. }
  409. else
  410. {
  411. KeyPressIsValid();
  412. }
  413. }
  414. function hndshake_CheckEdits()
  415. {
  416. try
  417. {
  418. if (g.event == null)
  419. return;
  420. }
  421. catch(e)
  422. {
  423. return;
  424. }
  425. if (g.event.srcElement != g.edtMSNPhoneNumber)
  426. {
  427. hndshake_CheckEnableNextButton();
  428. }
  429. }
  430. function hndshake_CheckEnableNextButton()
  431. {
  432. try
  433. {
  434. if (g.event == null)
  435. return;
  436. }
  437. catch(e)
  438. {
  439. return;
  440. }
  441. if (g.edtMSNPhoneNumber.value.length)
  442. {
  443. g.btnNext.disabled = false;
  444. }
  445. else
  446. {
  447. g.btnNext.disabled = true;
  448. }
  449. InitNewButtons();
  450. }
  451. function hndshake_LoadMe()
  452. {
  453. InitFrameRef();
  454. g_FirstFocusElement = g.edtMSNPhoneNumber;
  455. hndshake_CheckEnableNextButton();
  456. g_FirstFocusElement.focus();
  457. }
  458. ///////////////////////////////////////////////////////////////////////////////
  459. // MISC Functions
  460. ///////////////////////////////////////////////////////////////////////////////
  461. // Page Navigation
  462. // InitCKPT, PushCKPT, PopCKPT, CKPTFromVal are meant to handle the behavior for GoBack.
  463. // We only go back to certain pages (i.e., Sound Check).
  464. // And on some of the pages, we only go back if they haven't been
  465. // completed (i.e., EULA, PID).
  466. //
  467. // So, we push checkpoints if we intend to all coming back to that page.
  468. // We pop checkpoints if we no longer want to come back (e.g., we've
  469. // completed that page.
  470. function InitCKPT()
  471. {
  472. // STATUS_ISP(0) STATUS_PRECONFIG STATUS_NONE STATUS_OFF
  473. // ------------ ------------- ------------- --------------
  474. dnCKPT[CKPT_ISPSIGNUP] = new CheckPoint("setup\\isp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  475. dnCKPT[CKPT_MIGLIST] = new CheckPoint("setup\\miglist.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  476. dnCKPT[CKPT_ISPDIAL] = new CheckPoint("setup\\drdyisp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  477. dnCKPT[CKPT_REFDIAL] = new CheckPoint("setup\\drdyref.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  478. dnCKPT[CKPT_MIGDIAL] = new CheckPoint("setup\\drdymig.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  479. dnCKPT[CKPT_ICONNECT] = new CheckPoint("html\\iconnect\\iconnect.htm",SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  480. dnCKPT[CKPT_OEMISP] = new CheckPoint("html\\ispsgnup\\ispsgnup.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  481. dnCKPT[CKPT_OEMCUST] = new CheckPoint("html\\oemcust\\oemcust.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  482. dnCKPT[CKPT_DONE] = new CheckPoint("setup\\fini.htm", SNDX_FINI, SNDX_FINI, SNDX_FINI, SNDX_FINI);
  483. PopCKPT();
  484. // init simple navigation mappings
  485. g_SimpleNavMap= new ActiveXObject("Scripting.Dictionary");
  486. g_SimpleNavMap.CompareMode = COMPAREMODE_TEXT;
  487. iconnect_InitSimpleNavMap();
  488. }
  489. function PushCKPT(ckpt)
  490. {
  491. if (ckpt > 0 && ckpt < CKPT_MAX)
  492. {
  493. var tos = 0;
  494. try
  495. {
  496. tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  497. }
  498. catch (e) {}
  499. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString(), ckpt);
  500. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, ++tos);
  501. ApiObj.FlushRegKey(HKEY_LOCAL_MACHINE);
  502. g_CurrentCKPT = ckpt;
  503. }
  504. }
  505. function ClearStatusBar()
  506. {
  507. StatusBar1.style.backgroundColor = "#bbbbbb";
  508. StatusBar2.style.backgroundColor = "#bbbbbb";
  509. StatusBar3.style.backgroundColor = "#bbbbbb";
  510. StatusBar4.style.backgroundColor = "#bbbbbb";
  511. StatusBar5.style.backgroundColor = "#bbbbbb";
  512. }
  513. function PaintStatusBar(WhatBar)
  514. {
  515. // We use this method so that whenever we skip a step, that step is highlighted as well.
  516. var HighlightColor = "#00cc00"; // Green
  517. if (WhatBar == "1")
  518. {
  519. StatusBar1.style.backgroundColor = HighlightColor;
  520. }
  521. if (WhatBar == "2")
  522. {
  523. StatusBar1.style.backgroundColor = HighlightColor;
  524. StatusBar2.style.backgroundColor = HighlightColor;
  525. }
  526. if (WhatBar == "3")
  527. {
  528. StatusBar1.style.backgroundColor = HighlightColor;
  529. StatusBar2.style.backgroundColor = HighlightColor;
  530. StatusBar3.style.backgroundColor = HighlightColor;
  531. }
  532. if (WhatBar == "4")
  533. {
  534. StatusBar1.style.backgroundColor = HighlightColor;
  535. StatusBar2.style.backgroundColor = HighlightColor;
  536. StatusBar3.style.backgroundColor = HighlightColor;
  537. StatusBar4.style.backgroundColor = HighlightColor;
  538. }
  539. if (WhatBar == "5")
  540. {
  541. StatusBar1.style.backgroundColor = HighlightColor;
  542. StatusBar2.style.backgroundColor = HighlightColor;
  543. StatusBar3.style.backgroundColor = HighlightColor;
  544. StatusBar4.style.backgroundColor = HighlightColor;
  545. StatusBar5.style.backgroundColor = HighlightColor;
  546. }
  547. }
  548. function PopCKPT(ckptCheck)
  549. {
  550. var ckpt = 0;
  551. try
  552. {
  553. var tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  554. if (tos > 0)
  555. {
  556. ckpt = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, (tos - 1).toString());
  557. if (null == ckptCheck || ckpt == ckptCheck)
  558. {
  559. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, --tos);
  560. ApiObj.DeleteRegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString());
  561. ApiObj.FlushRegKey(HKEY_LOCAL_MACHINE);
  562. }
  563. }
  564. }
  565. catch (e) {}
  566. if (ckpt > 0 && ckpt < CKPT_MAX)
  567. {
  568. g_CurrentCKPT = ckpt;
  569. }
  570. else
  571. g_CurrentCKPT = null;
  572. }
  573. function EmptyCKPTStack()
  574. {
  575. while (null != g_CurrentCKPT)
  576. {
  577. PopCKPT();
  578. }
  579. }
  580. function URLFromCKPT(ckpt)
  581. {
  582. var str = "";
  583. if (ckpt > 0 && ckpt < CKPT_MAX)
  584. {
  585. str = dnCKPT[ckpt].strURL;
  586. }
  587. return str;
  588. }
  589. function IndexFromCKPT(ckpt, status)
  590. {
  591. var index = 0;
  592. if (ckpt > 0 && ckpt < CKPT_MAX)
  593. {
  594. var checkpoint = dnCKPT[ckpt];
  595. index = checkpoint.rgindex[status];
  596. }
  597. return index;
  598. }
  599. function IsLocalFile()
  600. {
  601. try
  602. {
  603. return (-1 != g.location.protocol.indexOf("file"));
  604. }
  605. catch (e)
  606. {
  607. return false;
  608. }
  609. }
  610. ///////////////////////////////////////////////////////////////////////////////
  611. // public navigation APIs
  612. ///////////////////////////////////////////////////////////////////////////////
  613. function SetBack(strURL)
  614. {
  615. g_OEMAddBackURL = strURL;
  616. }
  617. // this handles the user's "Skip" requests
  618. ///////////////////////////////////////////////////////////////////////////////
  619. // GoCancel
  620. //
  621. // This function is responsible for
  622. // * Saving state for a page when the Skip button is clicked.
  623. // * Calling GoNavigate with the checkpoint id of the next checkpoint
  624. //
  625. // This function is NOT responsible for
  626. // * Setting state for the next page. That should be done in GoNavigate.
  627. //
  628. // Default behavior is to navigate to the first page of the next checkpoint.
  629. //
  630. ///////////////////////////////////////////////////////////////////////////////
  631. function GoCancel(ckpt)
  632. {
  633. try
  634. {
  635. if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
  636. return;
  637. }
  638. catch(e)
  639. {
  640. return;
  641. }
  642. DisableAllButtons();
  643. switch (g_CurrentCKPT)
  644. {
  645. case CKPT_ISPSIGNUP:
  646. GoNavigate(CKPT_OEMCUST);
  647. break;
  648. case CKPT_MIGLIST:
  649. // When skip on the referral dialing, go to finish
  650. GoNavigate(CKPT_OEMCUST);
  651. break;
  652. case CKPT_REFDIAL:
  653. case CKPT_MIGDIAL:
  654. case CKPT_ISPDIAL:
  655. // When skip on the referral dialing, go to finish
  656. GoNavigate(CKPT_OEMCUST);
  657. break;
  658. default:
  659. GoNext();
  660. break;
  661. }
  662. }
  663. ///////////////////////////////////////////////////////////////////////////////
  664. // GoBack
  665. //
  666. // This function is responsible for
  667. // * Saving state for a page when the Back button is clicked.
  668. // * Popping the current checkpoint off the checkpoint stack
  669. // * Navigating to the previous checkpoint
  670. //
  671. // This function is NOT responsible for
  672. // * Setting state for the next page. That should be done in GoNavigate.
  673. //
  674. ///////////////////////////////////////////////////////////////////////////////
  675. function GoBack(ckpt)
  676. {
  677. try
  678. {
  679. if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
  680. return;
  681. }
  682. catch(e)
  683. {
  684. return;
  685. }
  686. DisableAllButtons();
  687. if(g_CurrentCKPT == g_DialCKPT)
  688. ResetDialing();
  689. else if(g_CurrentCKPT == CKPT_ISPSIGNUP)
  690. ResetDialing();
  691. // end if
  692. {
  693. var ckptPrevious = g_CurrentCKPT;
  694. PopCKPT();
  695. if (ckptPrevious == g_CurrentCKPT)
  696. {
  697. // This handles the case where the current page pushed itself on the stack.
  698. PopCKPT();
  699. }
  700. if (g_CurrentCKPT > 0 && g_CurrentCKPT < CKPT_MAX)
  701. {
  702. GoNavigate(g_CurrentCKPT);
  703. }
  704. }
  705. }
  706. function StatusNavigate()
  707. {
  708. window.external.set_StatusIndex(IndexFromCKPT(g_CurrentCKPT, g_status));
  709. }
  710. ///////////////////////////////////////////////////////////////////////////////
  711. // GoNavigate
  712. //
  713. // This function is responsible for setting state prior to navigating to the
  714. // first page of a checkpoint. This includes:
  715. // * determining whether the page should be displayed
  716. // * pushing the checkpoint id on the checkpoint stack
  717. // * calling Navigate to navigate to the page
  718. //
  719. // Default behavior is to push the checkpoint id and navigate to the first page
  720. // of the checkpoint. If this is the only processing required, use the
  721. // default case instead of adding a case for the checkpoint.
  722. //
  723. // Calling GoNavigate recursively can cause navigation problems. If a page
  724. // will not be displayed for a checkpoint, the code should fall through to the
  725. // next case statement instead of calling GoNavigate.
  726. //
  727. // DON'T MUCK WITH THE ORDER OF THE CASES IN THE SWITCHES BELOW WITHOUT
  728. // CONSIDERING FALL-THROUGH
  729. ///////////////////////////////////////////////////////////////////////////////
  730. function GoNavigate(ckptGoHere)
  731. {
  732. try
  733. {
  734. if (g_bStartup == false)
  735. {
  736. if (IsLocalFile())
  737. {
  738. if (g.event != null)
  739. {
  740. g.event.returnValue = false;
  741. g.event.cancelBubble = true;
  742. }
  743. }
  744. }
  745. else
  746. g_bStartup = false;
  747. }
  748. catch(e)
  749. {
  750. return;
  751. }
  752. switch (ckptGoHere)
  753. {
  754. case CKPT_ISPSIGNUP:
  755. trace("GoNavigate: CKPT_ISPSIGNUP");
  756. if (HasAnalogModem())
  757. {
  758. PushCKPT(CKPT_ISPSIGNUP);
  759. if (window.external.CalledFromMsn())
  760. {
  761. trace("GoNavigate: CKPT_ISPDIAL");
  762. PushCKPT(CKPT_ISPDIAL);
  763. Navigate(URLFromCKPT(CKPT_ISPDIAL));
  764. }
  765. else
  766. {
  767. Navigate(URLFromCKPT(CKPT_ISPSIGNUP));
  768. }
  769. break;
  770. }
  771. // fall through...
  772. // BEGIN OEM CASES. DO NOT ADD CASES between here and CKPT_DONE. Doing so
  773. // will break navigation.
  774. //
  775. case CKPT_OEMISP: // PreConfig case
  776. trace("GoNavigate: CKPT_OEMISP");
  777. if ( (STATUS_PRECONFIG == g_status) && !window.external.GetNoIspPreconfig())
  778. {
  779. ResetDialing();
  780. PushCKPT(CKPT_OEMISP);
  781. Navigate(URLFromCKPT(CKPT_OEMISP));
  782. break;
  783. }
  784. // fall through...
  785. case CKPT_OEMCUST:
  786. trace("GoNavigate: CKPT_OEMCUST");
  787. // Next line of code added by TandyT to support special ISP signup process commands
  788. // Calls to function in agtcore.js
  789. ResetDialing();
  790. if (1 == DirObj.get_OEMCust)
  791. {
  792. PushCKPT(CKPT_OEMCUST);
  793. Navigate(URLFromCKPT(CKPT_OEMCUST));
  794. break;
  795. }
  796. // fall through...
  797. //
  798. // END OEM CASES
  799. case CKPT_DONE:
  800. trace("GoNavigate: CKPT_DONE");
  801. ResetDialing();
  802. PushCKPT(CKPT_DONE);
  803. Navigate(URLFromCKPT(CKPT_DONE));
  804. break;
  805. default:
  806. trace("GoNavigate: default (" + ckptGoHere + ")");
  807. PushCKPT(ckptGoHere); // sets g_CurrentCKPT = ckptGoHere;
  808. Navigate(URLFromCKPT(ckptGoHere));
  809. break;
  810. }
  811. StatusNavigate();
  812. }
  813. ///////////////////////////////////////////////////////////////////////////////
  814. // GoNext
  815. //
  816. // This function is responsible for
  817. // * Saving state for a page when the Next button is clicked.
  818. // * Calling GoNavigate with the checkpoint id of the next checkpoint
  819. //
  820. // This function is NOT responsible for
  821. // * Setting state for the next page. That should be done in GoNavigate.
  822. //
  823. // Default behavior is to call GoNavigate with an invalid checkpoint id.
  824. // Therefore each checkpoint MUST have a case in the switch statement.
  825. //
  826. ///////////////////////////////////////////////////////////////////////////////
  827. function GoNext()
  828. {
  829. try
  830. {
  831. if (IsLocalFile() && g.event == null)
  832. return;
  833. }
  834. catch(e)
  835. {
  836. return;
  837. }
  838. DisableAllButtons();
  839. switch (g_CurrentCKPT)
  840. {
  841. case CKPT_ISPSIGNUP:
  842. trace("GoNext: CKPT_ISPSIGNUP");
  843. if (g.radioGetNewISP.checked)
  844. {
  845. if (window.external.CheckOnlineStatus && window.external.CheckStayConnected("msobe.isp"))
  846. {
  847. PushCKPT(CKPT_ISPDIAL);
  848. g_IgnoreDialErr = false;
  849. window.external.Connect(CONNECTED_ISP_SIGNUP, "msobe.isp");
  850. }
  851. else
  852. {
  853. window.external.Hangup();
  854. GoNavigate(CKPT_ISPDIAL); // Getting Online
  855. }
  856. }
  857. else if (g.radioMigrateISP.checked)
  858. {
  859. // We want the default behavior to be showing the migration path if ISPMigrate = 0 or
  860. // is not specified
  861. if (!DirObj.get_ShowISPMigration())
  862. {
  863. if (window.external.CheckOnlineStatus && window.external.CheckStayConnected("migrate.isp"))
  864. {
  865. g_bTapiDone = false;
  866. GoNavigate(CKPT_REFDIAL);
  867. }
  868. else
  869. {
  870. window.external.Hangup();
  871. GoNavigate(CKPT_REFDIAL);
  872. }
  873. }
  874. else
  875. {
  876. GoNavigate(CKPT_ICONNECT);
  877. }
  878. }
  879. else
  880. {
  881. GoCancel(); // skip checked
  882. }
  883. break;
  884. case CKPT_REFDIAL:
  885. GoNavigate(CKPT_ICONNECT);
  886. break;
  887. case CKPT_ICONNECT:
  888. GoNavigate(CKPT_OEMCUST);
  889. break;
  890. case CKPT_ISPDIAL:
  891. GoNavigate(CKPT_OEMCUST);
  892. break;
  893. case CKPT_OEMISP:
  894. GoNavigate(CKPT_OEMCUST);
  895. break;
  896. case CKPT_OEMCUST:
  897. GoNavigate(CKPT_DONE);
  898. break;
  899. case CKPT_DONE:
  900. window.external.Finish();
  901. break;
  902. default:
  903. // BUGBUG should we remove the default altogether?
  904. GoNavigate(Need_to_handle_this_CKPT_in_GoNext);
  905. break;
  906. }
  907. }
  908. // BUGBUG temporary until MSN changes code
  909. function GoOffline()
  910. {
  911. GoNext();
  912. }
  913. function GetCurrentPageName() {
  914. var re = new RegExp("\\\\([^\\\\]+)$");
  915. re.exec(g.window.location.pathname);
  916. return RegExp.$1;
  917. }
  918. // these handle next/back navigation for non-checkpoint pages
  919. function SimpleNavBack()
  920. {
  921. g.window.history.back();
  922. }
  923. /*
  924. This version of SimpleNavNext contains the workaround for IE 90257. not enabled yet
  925. another part of 90527 fix is in InitButtons()
  926. */
  927. function SimpleNavNext() // original version that does not fix IE 90257
  928. {
  929. var CurPage = GetCurrentPageName();
  930. var NextPage = g_SimpleNavMap.Item(CurPage);
  931. Navigate(NextPage);
  932. }
  933. // Description: Disable all the buttons
  934. // Used to prevent script error caused by
  935. // double clicking or rapid clicking
  936. // of two different buttons. E.g. when someone click
  937. // next and back quickly.
  938. //
  939. function DisableAllButtons()
  940. {
  941. try
  942. {
  943. if(g.btnNext!=null)
  944. {
  945. g.btnNext.onclick=null;
  946. }
  947. } catch (e) {}
  948. try
  949. {
  950. if(g.btnBack!=null)
  951. {
  952. g.btnBack.onclick=null;
  953. }
  954. } catch (e) {}
  955. try
  956. {
  957. if(g.btnSkip!=null)
  958. {
  959. g.btnSkip.onclick=null;
  960. }
  961. } catch (e) {}
  962. try
  963. {
  964. g.btnNext.disabled=true;
  965. g.btnNext.className="newbuttonsNext-disabled";
  966. }
  967. catch(e) {}
  968. try
  969. {
  970. g.btnBack.disabled=true;
  971. g.btnBack.className="newbuttonsBack-disabled";
  972. }
  973. catch(e) {}
  974. try
  975. {
  976. g.btnSkip.disabled=true;
  977. g.btnSkip.className="newbuttonsSkip-disabled";
  978. }
  979. catch(e) {}
  980. }
  981. function GetAncestorByTag(elem, tagName)
  982. {
  983. if (elem == null || tagName == null)
  984. {
  985. return null;
  986. }
  987. var aNode = elem.parentNode;
  988. var tagNameUpperCase = tagName.toUpperCase();
  989. while (aNode != null && aNode.nodeName != tagNameUpperCase)
  990. {
  991. aNode = aNode.parentNode;
  992. }
  993. return aNode;
  994. }
  995. // Function: InitFrameRef
  996. // Description: Sets up globals to point to buttons
  997. // Since the buttons exist on the child frame,
  998. // we want to have quick access to them without
  999. // going through the collections.
  1000. //
  1001. // WARNING: Call this function at the top of XXX_LoadMe()
  1002. //
  1003. // SIDE-EFFECT: This function also sets the watermark appropriate for the screen size.
  1004. //
  1005. function InitFrameRef(ExternalModule)
  1006. {
  1007. trace("GoNext: InitFrameRef");
  1008. try
  1009. {
  1010. document.frames("connDelay").frameElement.style.display="none";
  1011. document.frames("connDelay").frameElement.style.zIndex=-1;
  1012. // We want to see a black frame around OOBE if our res. is > 1024.
  1013. // We initially set it to blue so that we will have a smooth transition from
  1014. // our animation to OOBE.
  1015. OOBEDocBody.style.backgroundColor="#000000";
  1016. }
  1017. catch (e)
  1018. {
  1019. }
  1020. g_LastButtonText = null;
  1021. g_FirstFocusElement = null;
  1022. g_LastKeyDown = null;
  1023. g = document.frames("msoobeMain");
  1024. try
  1025. {
  1026. g.document.body.style.backgroundColor = "transparent";
  1027. }
  1028. catch(e){}
  1029. try
  1030. {
  1031. if (g != null)
  1032. {
  1033. if(g.btnNext!=null)
  1034. g.btnNext.disabled=false;
  1035. if(g.btnBack!=null)
  1036. g.btnBack.disabled=false;
  1037. if(g.btnSkip!=null)
  1038. g.btnSkip.disabled=false;
  1039. }
  1040. g.document.body.onkeydown = OnKeyDown;
  1041. g.document.body.style.cursor = 'auto';
  1042. }
  1043. catch(e){}
  1044. }
  1045. function HideButtons(buttons)
  1046. {
  1047. if (null != g.btnBack && (buttons & HIDE_BACK))
  1048. {
  1049. g.btnBack.Hide = true;
  1050. }
  1051. if (null != g.btnNext && (buttons & HIDE_NEXT))
  1052. {
  1053. g.btnNext.Hide = true;
  1054. }
  1055. if (null != g.spanCancel && (buttons & HIDE_CANCEL))
  1056. {
  1057. g.btnSkip.Hide = true;
  1058. }
  1059. /*
  1060. if (null != g.spanRestore && (buttons & HIDE_RESTORE))
  1061. {
  1062. g.btnRestore.Hide = true;
  1063. }
  1064. */
  1065. }
  1066. function HandleButtonMouseOver()
  1067. {
  1068. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1069. this.className="buttons-hover";
  1070. }
  1071. function HandleButtonMouseOut()
  1072. {
  1073. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1074. this.className="buttons";
  1075. }
  1076. function InitButtons(SimpleBack, SimpleNext)
  1077. {
  1078. // Some js files like dialmgr.js are both being used by OOBE and desktop activation,
  1079. // and the call to Initbuttons could either be in msobshel.htx or actshell.htx, so it's best to leave
  1080. // the initbuttons in the js files as it is and perform a checking here if we are in full screen OOBE or not.
  1081. if (!InReminderMode())
  1082. {
  1083. InitNewButtons(SimpleBack, SimpleNext);
  1084. }
  1085. else
  1086. {
  1087. if(g.btnSkip!=null) {
  1088. g.btnSkip.onmouseover = HandleButtonMouseOver;
  1089. g.btnSkip.onmouseout = HandleButtonMouseOut;
  1090. if(!g.btnSkip.disabled) {
  1091. g.btnSkip.onclick = GoCancel;
  1092. // dont enable onfocus,onblur handlers until issues in 88615 are resolved
  1093. // g.btnSkip.onfocus = HandleButtonMouseOver;
  1094. // g.btnSkip.onblur = HandleButtonMouseOut;
  1095. g.btnSkip.className="buttons";
  1096. } else {
  1097. g.btnSkip.className="buttons-disabled";
  1098. }
  1099. }
  1100. if (g.btnNext != null)
  1101. {
  1102. g.btnNext.onmouseover = HandleButtonMouseOver;
  1103. g.btnNext.onmouseout = HandleButtonMouseOut;
  1104. if (!g.btnNext.disabled)
  1105. {
  1106. if (SimpleNext == null)
  1107. {
  1108. g.btnNext.onclick = GoNext;
  1109. }
  1110. else
  1111. {
  1112. g.btnNext.onclick = SimpleNavNext;
  1113. }
  1114. g.btnNext.className="buttons";
  1115. }
  1116. else
  1117. {
  1118. g.btnNext.className="buttons-disabled";
  1119. }
  1120. }
  1121. if (g.btnBack != null)
  1122. {
  1123. g.btnBack.onmouseover = HandleButtonMouseOver;
  1124. g.btnBack.onmouseout = HandleButtonMouseOut;
  1125. if (!g.btnBack.disabled)
  1126. {
  1127. if (SimpleBack == null)
  1128. {
  1129. g.btnBack.onclick = GoBack;
  1130. }
  1131. else
  1132. {
  1133. g.btnBack.onclick = SimpleNavBack;
  1134. }
  1135. g.btnBack.className="buttons";
  1136. }
  1137. else
  1138. {
  1139. g.btnBack.className="buttons-disabled";
  1140. }
  1141. }
  1142. }
  1143. }
  1144. // New OOBE buttons
  1145. // -----------------------------------------------
  1146. function HandleBackButtonMouseOver()
  1147. {
  1148. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1149. this.className="newbuttonsBack-hover";
  1150. }
  1151. function HandleBackButtonMouseOut()
  1152. {
  1153. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1154. this.className="newbuttonsBack";
  1155. }
  1156. function HandleBackButtonMouseDown()
  1157. {
  1158. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1159. this.className="newbuttonsBack-down";
  1160. }
  1161. function HandleSkipButtonMouseOver()
  1162. {
  1163. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1164. this.className="newbuttonsSkip-hover";
  1165. }
  1166. function HandleSkipButtonMouseOut()
  1167. {
  1168. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1169. this.className="newbuttonsSkip";
  1170. }
  1171. function HandleSkipButtonMouseDown()
  1172. {
  1173. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1174. this.className="newbuttonsSkip-down";
  1175. }
  1176. function HandleNextButtonMouseOver()
  1177. {
  1178. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1179. this.className="newbuttonsNext-hover";
  1180. }
  1181. function HandleNextButtonMouseOut()
  1182. {
  1183. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1184. this.className="newbuttonsNext";
  1185. }
  1186. function HandleNextButtonMouseDown()
  1187. {
  1188. if((!this.disabled)&&(this.tagName=="BUTTON"))
  1189. this.className="newbuttonsNext-down";
  1190. }
  1191. function InitNewButtons(NewSimpleBack, NewSimpleNext)
  1192. {
  1193. if(g.btnSkip!=null)
  1194. {
  1195. g.btnSkip.onmouseover = HandleSkipButtonMouseOver;
  1196. g.btnSkip.onmouseout = HandleSkipButtonMouseOut;
  1197. g.btnSkip.onmousedown = HandleSkipButtonMouseDown;
  1198. if(!g.btnSkip.disabled)
  1199. {
  1200. g.btnSkip.onclick = GoCancel;
  1201. g.btnSkip.className="newbuttonsSkip";
  1202. }
  1203. else
  1204. {
  1205. g.btnSkip.className="newbuttonsSkip-disabled";
  1206. }
  1207. }
  1208. if (g.btnNext != null)
  1209. {
  1210. g.btnNext.onmouseover = HandleNextButtonMouseOver;
  1211. g.btnNext.onmouseout = HandleNextButtonMouseOut;
  1212. g.btnNext.onmousedown = HandleNextButtonMouseDown;
  1213. if (!g.btnNext.disabled)
  1214. {
  1215. if (NewSimpleNext == null)
  1216. g.btnNext.onclick = GoNext;
  1217. else
  1218. g.btnNext.onclick = SimpleNavNext;
  1219. g.btnNext.className="newbuttonsNext";
  1220. }
  1221. else
  1222. {
  1223. g.btnNext.className="newbuttonsNext-disabled";
  1224. }
  1225. }
  1226. if (g.btnBack != null)
  1227. {
  1228. g.btnBack.onmouseover = HandleBackButtonMouseOver;
  1229. g.btnBack.onmouseout = HandleBackButtonMouseOut;
  1230. g.btnBack.onmousedown = HandleBackButtonMouseDown;
  1231. if (!g.btnBack.disabled)
  1232. {
  1233. if (NewSimpleBack == null)
  1234. g.btnBack.onclick = GoBack;
  1235. else
  1236. g.btnBack.onclick = SimpleNavBack;
  1237. g.btnBack.className="newbuttonsBack";
  1238. }
  1239. else
  1240. {
  1241. g.btnBack.className="newbuttonsBack-disabled";
  1242. }
  1243. }
  1244. var btn;
  1245. if (g.btnNext!=null)
  1246. {
  1247. btn = g.btnNext;
  1248. }
  1249. else if (g.btnBack!=null)
  1250. {
  1251. btn = g.btnBack;
  1252. }
  1253. else (g.btnSkip!=null)
  1254. {
  1255. btn = g.btnSkip;
  1256. }
  1257. var ButtonLayoutTable = GetAncestorByTag(btn, "table");
  1258. if ((ButtonLayoutTable != null) &&
  1259. (ButtonLayoutTable.className == "newbuttonposition"))
  1260. {
  1261. var styleObj = ButtonLayoutTable.style;
  1262. if (g.document.body.scrollHeight > g.document.body.clientHeight)
  1263. {
  1264. styleObj.position = "relative";
  1265. styleObj.top = "0%";
  1266. styleObj.width = "98%";
  1267. }
  1268. if (g.document.body.scrollHeight <= g.document.body.clientHeight)
  1269. {
  1270. styleObj.position = "absolute";
  1271. styleObj.top =
  1272. (parseInt(100 - 35 * 100 / parseInt(MainFrameTable.style.height)) + "%");
  1273. styleObj.width = "110%";
  1274. }
  1275. }
  1276. }
  1277. var g_LastKeyDown = null;
  1278. function OnKeyDown()
  1279. {
  1280. try
  1281. {
  1282. if (IsLocalFile() && g.event == null)
  1283. return;
  1284. }
  1285. catch(e)
  1286. {
  1287. return;
  1288. }
  1289. if (g.event.altKey)
  1290. {
  1291. g_LastKeyDown = String.fromCharCode(g.event.keyCode);
  1292. if (g_LastKeyDown != null)
  1293. g_LastKeyDown = g_LastKeyDown.toUpperCase();
  1294. }
  1295. else
  1296. g_LastKeyDown = null;
  1297. }
  1298. // AGENT: SelectClick is used by Agent
  1299. function OnSelectClick()
  1300. {
  1301. }
  1302. // AGENT: OnClick is used by Agent
  1303. function OnClick()
  1304. {
  1305. }
  1306. // AGENT: Focus functions are used by Agent
  1307. function OnFocus()
  1308. {
  1309. // Put other code here that needs access to the focus event
  1310. }
  1311. // VALIDATION ROUTINES
  1312. function KeyPressIsNumeric()
  1313. {
  1314. try
  1315. {
  1316. if (IsLocalFile() && g.event == null)
  1317. return;
  1318. }
  1319. catch(e)
  1320. {
  1321. return;
  1322. }
  1323. if (!IsNumeric(g.event.keyCode))
  1324. {
  1325. g.event.keyCode = 0;
  1326. g.event.returnValue = false;
  1327. }
  1328. }
  1329. function IsNumeric(keyCode)
  1330. {
  1331. if ((keyCode >= 48/*0*/) && (keyCode <= 57/*9*/))
  1332. return true;
  1333. else
  1334. return false;
  1335. }
  1336. function IsSpecial(keyCode)
  1337. {
  1338. // BUGBUG DISABLED FOR BETA
  1339. /*
  1340. var bFound = false;
  1341. var iPosition = 0;
  1342. for (;iPosition < g_SpecialChars.length; iPosition++)
  1343. {
  1344. if (g_SpecialChars.charCodeAt(iPosition) == keyCode)
  1345. {
  1346. bFound = true;
  1347. break;
  1348. }
  1349. }
  1350. return bFound;
  1351. */
  1352. return false;
  1353. }
  1354. function KeyPressIsValid()
  1355. {
  1356. try
  1357. {
  1358. if (IsLocalFile() && g.event == null)
  1359. return;
  1360. }
  1361. catch(e)
  1362. {
  1363. return;
  1364. }
  1365. if (!IsAlpha(g.event.keyCode) &&
  1366. !IsSpecial(g.event.keyCode) &&
  1367. !IsNumeric(g.event.keyCode))
  1368. {
  1369. g.event.keyCode = 0;
  1370. g.event.returnValue = false;
  1371. }
  1372. }
  1373. function KeyPressIsAlpha()
  1374. {
  1375. try
  1376. {
  1377. if (IsLocalFile() && g.event == null)
  1378. return;
  1379. }
  1380. catch(e)
  1381. {
  1382. return;
  1383. }
  1384. if (!IsAlpha(g.event.keyCode))
  1385. {
  1386. g.event.keyCode = 0;
  1387. g.event.returnValue = false;
  1388. }
  1389. }
  1390. function IsAlpha(keyCode)
  1391. {
  1392. // BUGBUG DISABLED FOR BETA
  1393. /*
  1394. var strKeyCode = String.fromCharCode(keyCode);
  1395. var re1 = new RegExp("\w"); // BUGBUG: should \ be escaped?
  1396. var re2 = new RegExp("\D"); // BUGBUG: should \ be escaped?
  1397. strKeyCode.match(re1);
  1398. strKeyCode.match(re2);
  1399. //return ((strKeyCode.match(re1) != null) && (strKeyCode.match(re2) != null));
  1400. */
  1401. // if ((keyCode >= 97/*a*/ && keyCode <= 122/*z*/) ||
  1402. // (keyCode >= 65/*A*/ && keyCode <= 90 /*Z*/))
  1403. return true;
  1404. // else
  1405. // return false;
  1406. }
  1407. function NumberOfSpaces(strValue)
  1408. {
  1409. /*
  1410. var NASexp = RegExp("\s"); // BUGBUG: should \ be escaped?
  1411. var result = strValue.match(NASexp);
  1412. return ((result == null) || (result.length != strValue.length));
  1413. */
  1414. var iSpaceCount = 0;
  1415. for (iPosition = 0; iPosition < strValue.length; iPosition ++)
  1416. {
  1417. if (strValue.charAt(iPosition) == ' ')
  1418. {
  1419. iSpaceCount++;
  1420. }
  1421. }
  1422. return iSpaceCount;
  1423. }
  1424. function KeyCodeToUpper()
  1425. {
  1426. var strKeyCode = String.fromCharCode(g.event.keyCode);
  1427. strKeyCode = strKeyCode.toUpperCase();
  1428. g.event.keyCode = strKeyCode.charCodeAt(0);
  1429. }
  1430. // END VALIDATION ROUTINES
  1431. function SetupPageLayout()
  1432. {
  1433. var DTWindowHeight = document.body.clientHeight;
  1434. var DTWindowWidth = document.body.clientWidth;
  1435. ScreenFrame.style.height = DTWindowHeight - 30;
  1436. ScreenFrame.style.width = DTWindowWidth;
  1437. NewMicrosoftLogo.src = 'images/mslogo.jpg';
  1438. NewWatermarkBackground.src = 'images/newmark1.jpg';
  1439. NewWatermarkTop.src = 'images/newtop1.jpg';
  1440. NewWatermarkBottom.src = 'images/newbtm1.jpg';
  1441. NewWatermarkTop.style.top = -8;
  1442. NewWatermarkBottom.style.top = parseInt(ScreenFrame.style.height) - 19;
  1443. MainFrameTable.style.top = parseInt(NewWatermarkTop.style.top) +
  1444. 56; // NewWatermarkTop.style.height
  1445. MainFrameTable.style.height = parseInt(NewWatermarkBottom.style.top) -
  1446. parseInt(MainFrameTable.style.top);
  1447. if (window.parent.document.dir == "rtl")
  1448. spnAssist.style.left = 10;
  1449. }
  1450. function InitApplication()
  1451. {
  1452. OOBEDocBody.style.cursor = "wait"; // show "wait" cursor while initializing
  1453. OOBEDocBody.style.backgroundColor="black";
  1454. g_bStartup = true;
  1455. InitFrameRef();
  1456. // Check if oemlogo under [Branding] is present in oobeinfo.ini,
  1457. // If so, check if that file does exists, and then use it.
  1458. var OEMLogoFile = null;
  1459. OEMLogoFile = ApiObj.get_INIKey("branding", "oemlogo");
  1460. if ( (OEMLogoFile != null)
  1461. && (OEMLogoFile.length>0)
  1462. && FileSystemObj.FileExists(g_OOBEDirPath+"images\\"+OEMLogoFile) )
  1463. {
  1464. spnOEMLogo.style.visibility="visible";
  1465. spnOEMLogo.style.backgroundImage = 'url(images/' + OEMLogoFile + ')';
  1466. }
  1467. SetupPageLayout();
  1468. InitCKPT();
  1469. EmptyCKPTStack();
  1470. spnPage.style.visibility = "visible";
  1471. g_PreferredConnection = CONNECTIONTYPE_MODEM;
  1472. window.external.SetICWCompleted();
  1473. // Navigate to proper page
  1474. InitStatusMenu();
  1475. OOBEDocBody.style.cursor = "default";
  1476. ScreenFrame.style.display = "inline";
  1477. GoNavigate(CKPT_ISPSIGNUP);
  1478. // Now that we've navigated, make sure we show the OOBE window.
  1479. window.external.ShowOOBEWindow();
  1480. }
  1481. function InitStatusMenu()
  1482. {
  1483. trace("InitStatusMenu");
  1484. if ( (1 == DirObj.get_Offline() || false == InternetCapabilityExists() ))
  1485. {
  1486. g_status = STATUS_OFF;
  1487. StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
  1488. window.external.LoadStatusItems("No Modem");
  1489. }
  1490. else
  1491. {
  1492. if (UseIcs())
  1493. {
  1494. window.external.TriggerIcsCallback(true);
  1495. }
  1496. else
  1497. {
  1498. window.external.TriggerIcsCallback(false);
  1499. }
  1500. var str = DirObj.get_ISPSignup().toUpperCase();
  1501. if ("MSN" == str)
  1502. {
  1503. g_status = STATUS_ISP;
  1504. if ( window.external.get_RegStatus() )
  1505. window.external.LoadStatusItems("MSN(No Reg)");
  1506. else
  1507. window.external.LoadStatusItems("MSN");
  1508. }
  1509. else if ("OFFLINE" == str)
  1510. {
  1511. g_status = STATUS_ISP;
  1512. if ( window.external.get_RegStatus() )
  1513. window.external.LoadStatusItems("Offline(No Reg)");
  1514. else
  1515. window.external.LoadStatusItems("Offline");
  1516. }
  1517. else if ("PRECONFIG" == str)
  1518. {
  1519. g_status = STATUS_PRECONFIG;
  1520. if ( window.external.get_RegStatus() )
  1521. window.external.LoadStatusItems("Preconfig(No Reg)");
  1522. else
  1523. window.external.LoadStatusItems("Preconfig");
  1524. }
  1525. else
  1526. {
  1527. g_status = STATUS_NONE;
  1528. StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
  1529. if ( window.external.get_RegStatus() )
  1530. window.external.LoadStatusItems("None(No Reg)");
  1531. else
  1532. window.external.LoadStatusItems("None");
  1533. }
  1534. }
  1535. }
  1536. function ProcessQueuedEvents() {
  1537. // flush all WM_ events in windows queue.
  1538. // workaround for IE 103880, 'white flashes in statpane & button on page unload'
  1539. window.external.ProcessQueuedEvents();
  1540. }
  1541. ///////////////////////////////////////////////////////////////////////////////
  1542. // isp.htm
  1543. ///////////////////////////////////////////////////////////////////////////////
  1544. var g_bRadioMigrateISP=false;
  1545. var g_MSNISP=false;
  1546. var g_ExistISP=false;
  1547. var g_NoISP=false;
  1548. function IspLoadMe()
  1549. {
  1550. InitFrameRef();
  1551. if (g_status == STATUS_ISP || g_status == STATUS_OFF)
  1552. {
  1553. g.radioGetNewISP.style.display = "inline";
  1554. g.ISP_New.style.display = "inline";
  1555. g.radioGetNewISP.checked=true;
  1556. g_FirstFocusElement = g.radioGetNewISP;
  1557. }
  1558. else
  1559. {
  1560. g.radioGetNewISP.style.display = "none";
  1561. g.ISP_New.style.display = "none";
  1562. g.radioMigrateISP.checked=true;
  1563. g_FirstFocusElement = g.radioMigrateISP;
  1564. }
  1565. InitNewButtons();
  1566. g.btnBack.style.visibility = "hidden";
  1567. g.BackBtnLocalText.style.visibility = "hidden";
  1568. g_FirstFocusElement.focus();
  1569. }
  1570. function IspUnLoad()
  1571. {
  1572. try
  1573. {
  1574. g_bRadioMigrateISP = (g.event.srcElement==g.radioMigrateISP);
  1575. }
  1576. catch (e) {}
  1577. }
  1578. ////////////////////////////////////////////////////////////////////
  1579. // DO NOT REMOVE THIS FUNCTION THIS WILL GET CALLED WHEN F1 IS
  1580. // PRESSED.
  1581. ////////////////////////////////////////////////////////////////////
  1582. function OnHelp()
  1583. {
  1584. // Invoke MSAgent
  1585. }
  1586. </script>
  1587. </HEAD>
  1588. <BODY ID=OOBEDocBody leftMargin=0 DIR=LTR onload="InitApplication();" scroll=no tabIndex=-1 topMargin=0 language=javascript onhelp="Agent_OnUserRequestAssistant();">
  1589. <SPAN ID=junkspan style="height:2px; width:2px; background-color:black; z-index:99; display:none">
  1590. </SPAN>
  1591. <SPAN ID=ScreenFrame style="height:100%; width:100%; position:absolute; display:none">
  1592. <IMG ID=NewWatermarkBackground style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-99;" alt="">
  1593. <IMG ID=NewWatermarkTop style="display: inline; LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-98;" alt="">
  1594. <IMG ID=NewWatermarkBottom style="display: inline; LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-97;" alt="">
  1595. <IMG ID=NewMicrosoftLogo style="display: inline; LEFT: 20px; TOP: 5px; POSITION: absolute; z-index:-96;" alt="">
  1596. <SPAN id=spnOEMLogo style="visibility:hidden; position:absolute; TOP:7px; LEFT:525px; width:255px; HEIGHT:40px; z-index:10; background-repeat:no-repeat;">
  1597. </SPAN>
  1598. <TABLE border=0 ID=MainFrameTable cellpadding=0 cellspacing=0 style="z-index:6; position:absolute; left:0px; top:25px; width:100%; height:97%">
  1599. <TR>
  1600. <TD style="height:100%">
  1601. <SPAN id=spnPage style="VISIBILITY: hidden; z-index:4; width: 100%; height:100%;" tabIndex=-1>
  1602. <SPAN id=spnMainFrame style="width: 100%; height:100%" tabIndex=-1>
  1603. <IFRAME ALLOWTRANSPARENCY="true" id=ifrmMainFrame frameBorder=no scrolling=auto width="100%" height="100%" name=msoobeMain tabIndex=0></IFRAME>
  1604. <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/dtiwait.htm"></IFRAME>
  1605. </SPAN>
  1606. </SPAN>
  1607. </TD>
  1608. </TR>
  1609. </TABLE>
  1610. </SPAN>
  1611. </BODY>
  1612. </HTML>