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.

4430 lines
123 KiB

  1. <!--
  2. TODO:
  3. * replace _MODULE_ with the name of your module.
  4. * replace %windir%\system32\oobe\msobshel.htm on your test system with
  5. this file.
  6. -->
  7. <HTML>
  8. <HEAD>
  9. <TITLE>Microsoft Out-of-Box Experience</TITLE>
  10. <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  11. <LINK REL="stylesheet" TYPE="text/css" HREF="setup\oobestyl.css">
  12. <!-- Begin Agent Specific Code -->
  13. <!-- The majority of the Agent code is in AgtCore.js -->
  14. <!-- The AgtXXXX.js files contain all of the script -->
  15. <!-- code that needs to be localized. -->
  16. <!-- NOTE: Agent is not initialized until the first -->
  17. <!-- time someone clicks on the Assistant image. -->
  18. <script language=jscript src="AgtCore.js"></script>
  19. <script language=jscript src="AgtScrpt.js"></script>
  20. <!-- Agent Event Handler Declarations -->
  21. <script language=jscript for=Agent event="Command(userInput)")>
  22. Agent_OnCommand(userInput);
  23. </script>
  24. <script language=jscript for=Agent event="Hide(characterID)">
  25. Agent_OnHide(characterID);
  26. </script>
  27. <script language=jscript for=Agent event="IdleStart(characterID)">
  28. Agent_OnIdleStart(characterID);
  29. </script>
  30. <script language=jscript for=Agent event="IdleComplete(characterID)">
  31. Agent_OnIdleComplete(characterID);
  32. </script>
  33. <script language=jscript for=Agent event="Bookmark(id)">
  34. Agent_OnBookmark(id);
  35. </script>
  36. <script language=jscript for=Agent event="Click(characterID, button, shift, x, y)">
  37. Agent_OnClick(characterID, button, shift, x, y);
  38. </script>
  39. <script language=jscript for=Agent event="DragComplete(characterID, button, shift, x, y)">
  40. Agent_OnDragComplete(characterID, button, shift, x, y);
  41. </script>
  42. <script language=jscript for=Agent event="RequestComplete(request)">
  43. Agent_OnRequestComplete(request);
  44. </script>
  45. <!-- End Agent Specific Code -->
  46. <script language=jscript src="_MODULE_.js"></script>
  47. <script language=jscript src="mousetut.js"></script>
  48. <script language=jscript src="migrate.js"></script>
  49. <script language=jscript src="dialmgr.js"></script>
  50. <script language=jscript src="error.js"></script>
  51. <script language=jscript src="icsmgr.js"></script>
  52. <script language=jscript>
  53. // This is intended to hold all the script needed
  54. // in the default & offline OOBE HTML pages.
  55. //
  56. // We want to separate the layout (HTML) from the script.
  57. // At the same time, it's helpful to have all the code
  58. // in one place to make it easier to understand the flow
  59. // from page to page.
  60. var APP_OOBE_MODE = 0;
  61. var APP_MSN_MODE = 1;
  62. var APP_DESKTOP_MODE = 2;
  63. // Status location constants
  64. var STATUS_ISP = 0;
  65. var STATUS_OEM = 1;
  66. var STATUS_NONE = 2;
  67. var STATUS_OFF = 3;
  68. var STATUS_MAX = 4;
  69. // var SNDX_WELCOME = 0;
  70. var SNDX_MSN_ISP = 1;
  71. var SNDX_MSN_REG = 2;
  72. var SNDX_MSN_FINISH = 3;
  73. var SNDX_OEM_REG = 1;
  74. var SNDX_OEM_ISP = 2;
  75. var SNDX_OEM_FINISH = 3;
  76. var SNDX_NONE_REG = 1;
  77. var SNDX_NONE_FINISH = 2;
  78. var SNDX_OFF_EULA = 1;
  79. var SNDX_OFF_PID = 2;
  80. var SNDX_OFF_FINISH = 3;
  81. // OLD STATUS PANE FOR B1
  82. // var SNDX_WELCOME = 0;
  83. // var SNDX_HW1 = 1;
  84. // var SNDX_HW2 = 2;
  85. // var SNDX_HW3 = 3;
  86. // var SNDX_LEGAL1 = 4;
  87. // var SNDX_LEGAL2 = 5;
  88. // var SNDX_REG1 = 6;
  89. // var SNDX_REG2 = 7;
  90. // var SNDX_ISP = 8;
  91. // var SNDX_FINI = 9;
  92. // For the new status pane, don't allow half way status
  93. var SNDX_WELCOME = 0;
  94. var SNDX_HW = 1;
  95. var SNDX_LEGAL = 2;
  96. var SNDX_REG = 3;
  97. var SNDX_ISP = 4;
  98. var SNDX_FINI = 6;
  99. // holds non-checkpoint next navigation
  100. var g_SimpleNavMap = null;
  101. function CheckPoint(strURL, i1, i2, i3, i4)
  102. {
  103. this.strURL = strURL;
  104. this.rgindex = new Array(STATUS_MAX);
  105. this.rgindex[STATUS_ISP] = i1;
  106. this.rgindex[STATUS_OEM] = i2;
  107. this.rgindex[STATUS_NONE] = i3;
  108. this.rgindex[STATUS_OFF] = i4;
  109. }
  110. var curCKPT=1;
  111. var CKPT_HWCHK = curCKPT++;
  112. var CKPT_WELCOME = curCKPT++;
  113. var CKPT__MODULE_ = curCKPT++;
  114. var CKPT_MOUSETUT1 = curCKPT++;
  115. var CKPT_IMETUTORIAL = curCKPT++;
  116. var CKPT_OEMHW = curCKPT++;
  117. var CKPT_REGION_KEYBD = curCKPT++;
  118. var CKPT_REGKB_COMMIT = curCKPT++;
  119. var CKPT_TIMEZONE = curCKPT++;
  120. var CKPT_EULA = curCKPT++;
  121. var CKPT_EULA_DECLINE = curCKPT++;
  122. var CKPT_PRODUCTKEY = curCKPT++;
  123. var CKPT_BADPRODUCTKEY = curCKPT++;
  124. var CKPT_ICSCHOICE = curCKPT++;
  125. var CKPT_REGISTER1 = curCKPT++;
  126. var CKPT_REGISTER3 = curCKPT++;
  127. var CKPT_ISPSIGNUP = curCKPT++;
  128. var CKPT_MIGLIST = curCKPT++;
  129. var CKPT_ISPDIAL = curCKPT++;
  130. var CKPT_REFDIAL = curCKPT++;
  131. var CKPT_MIGDIAL = curCKPT++;
  132. var CKPT_REGDIAL = curCKPT++;
  133. var CKPT_OEMISP = curCKPT++;
  134. var CKPT_OEMCUST = curCKPT++;
  135. var CKPT_DONE = curCKPT++;
  136. var CKPT_MAX = curCKPT; // ALWAYS set this to be the biggest value!
  137. var dnCKPT = new Array(CKPT_MAX);
  138. var g_LastMouseTutPage="mouse_k.htm";
  139. var g_Last_MODULE_Page = "";
  140. // Checkpoint breadcrumbs
  141. var g_CurrentCKPT = null;
  142. var g_DialCKPT = null;
  143. var HKEY_LOCAL_MACHINE = 0x80000002;
  144. var OOBE_MAIN_REG_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OOBE";
  145. var CLSID_FLASH_PLAYER = "{D27CDB6E-AE6D-11cf-96B8-444553540000}";
  146. var PROGID_FLASH_PLAYER = "ShockwaveFlash.ShockwaveFlash";
  147. var CKPT_REG_KEY = "\\CKPT";
  148. var TOS_REG_VALUE = "TopOfStack";
  149. // CheckDialReady errors
  150. var ERR_COMM_NO_ERROR = 0;
  151. var ERR_COMM_OOBE_COMP_MISSING = 1;
  152. var ERR_COMM_UNKNOWN = 2; // Unknown error, check input parameters
  153. var ERR_COMM_NOMODEM = 3; // There is no modem installed
  154. var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
  155. // Dialing errors. Look at raserror.h for details
  156. var DERR_DIALTONE = 680;
  157. var DERR_BUSY = 676;
  158. var DERR_VOICEANSWER = 677;
  159. var DERR_NOANSWER = 678;
  160. var DERR_NO_CARRIER = 679;
  161. var DERR_HARDWARE_FAILURE = 630; // modem turned off
  162. var DERR_PORT_ALREADY_OPEN = 602; // procomm/hypertrm/RAS has COM port
  163. var DERR_PORT_OR_DEVICE = 692; // got this when hypertrm had the device open -- jmazner
  164. var DERR_PPP_TIMEOUT = 718;
  165. var DERR_REMOTE_DISCONNECT = 629; // Connection interrupted
  166. // Types of dialing using ISP files. e.g. Dial to registration, ISP, referral server
  167. var CONNECTED_REFFERAL = 1
  168. var CONNECTED_ISP_SIGNUP = 2
  169. var CONNECTED_ISP_MIGRATE = 3
  170. var CONNECTED_REGISTRATION = 4
  171. // Finish errors
  172. var FINISH_OK = 0x00000000;
  173. var FINISH_REBOOT = 0x00000001;
  174. var FINISH_BAD_PID = 0x00000002;
  175. var FINISH_BAD_EULA = 0x00000004;
  176. var FINISH_BAD_STAMP = 0x00000008;
  177. // Language reboot return codes
  178. var LANGUAGE_REBOOT_NEVER = 0;
  179. var LANGUAGE_REBOOT_NOW = 1;
  180. var LANGUAGE_REBOOT_END = 2;
  181. // on-the-fly button hiding
  182. var HIDE_BACK = 0x0001;
  183. var HIDE_NEXT = 0x0002;
  184. var HIDE_CANCEL = 0x0004;
  185. var HIDE_RESTORE = 0x0008;
  186. // keycode consts
  187. var KeyEsc = 0x1B;
  188. var KeyEnter = 0xD;
  189. var KeyBackSpc = 0x8;
  190. var KeyDelete = 0x2E;
  191. var KeyTab = 0x9;
  192. var KeyDwnArrow = 0x28;
  193. var KeyUpArrow = 0x26;
  194. var KeyLeftArrow = 0x25;
  195. var KeyRightArrow = 0x27;
  196. // Data comparison modes
  197. var CompareModeBinary = 0;
  198. var CompareModeText = 1;
  199. // BUGBUG temp GUIDs
  200. var NOLAUNCHISPSIGNUP = "{C37D92A5-CA34-11d2-B71C-00C04F794977}";
  201. var MSNCOMPLETED = "{1C0A22F2-CB6B-11d2-B544-00A0C949DA70}";
  202. var LANGUAGECOMPLETED = "{F744DA40-617C-11D3-8B99-00A0C91E7F3C}";
  203. var MS_REGISTRATION = "{1C956940-8617-11D3-8B99-00A0C91E7F3C}";
  204. var OEM_REGISTRATION = "{ECD24360-B210-11D3-8B99-00A0C91E7F3C}";
  205. var ICS_FOR_INTERNET = "{67252E44-C8B7-4b6c-B6CC-E3D0E1D3BF9B}";
  206. var ICS_FOR_OOBE = "{7664797B-1A07-4755-AF19-2A73EC92E03B}";
  207. // LANGUAGE SETTINGS
  208. // sort order
  209. var SORT_DEFAULT = 0x0; // sorting default
  210. // primary languages
  211. var LANG_JAPANESE = 0x11;
  212. var LANG_KOREAN = 0x12;
  213. var LANG_CHINESE = 0x04;
  214. // sub languages
  215. var SUBLANG_KOREAN = 0x01; // Korean (Extended Wansung)
  216. var SUBLANG_CHINESE_TRADITIONAL = 0x01; // Taiwan
  217. var SUBLANG_CHINESE_SIMPLIFIED = 0x02; // Chinese (PR China)
  218. var SUBLANG_DEFAULT = 0x01; // user default
  219. // window.external object caches
  220. var TapiObj = null;
  221. var InfoObj = null;
  222. var EulaObj = null;
  223. var LangObj = null;
  224. var PidObj = null;
  225. var StatusObj = null;
  226. var DirObj = null;
  227. var ApiObj = null;
  228. var SysClockObj = null;
  229. var RegisterObj = null;
  230. var FileSystemObj = null;
  231. var DebugObj = null;
  232. // Localizeable strings for welcome.htm
  233. var L_StrVowelBeginningPrepender_Text = "an";
  234. var L_StrPrepender_Text = "a";
  235. // general globals and status
  236. var g_strISPFile = "";
  237. var g_bStartup;
  238. var g_LastButtonText = null;
  239. var g_FirstFocusElement = null;
  240. var g = null;
  241. var g_SpecialChars = ".'-` ";
  242. var g_OOBEDir = "file://" + window.external.API.get_SystemDirectory() + "\\oobe\\";
  243. var g_OOBEDirPath = window.external.API.get_SystemDirectory() + "\\oobe\\";
  244. var g_WaterMarkFileNameStr= window.external.API.get_SystemDirectory() + "\\OOBE\\images\\watermrk.gif";
  245. var g_WaterMarkFileSize = 29683; // size of default watermrk.gif
  246. var g_bRedial = false;
  247. var g_LineProblem = 0;
  248. var g_bFirstServerError = true;
  249. var g_status = STATUS_OFF;
  250. var g_ServerErrorCount = 0;
  251. var g_IMEExists = false;
  252. var g_OEMAddBackURL = "";
  253. var g_DialingAvailableInCountry = true;
  254. var g_ModalDialogUp = false;
  255. var bKeyboardPresent = true;
  256. var bMousePresent = true;
  257. var g_OEMNameStr = window.external.Signup.get_OEMName();
  258. var g_bTapiDone = false;
  259. // Mandatory Initialization Code
  260. if (null == DebugObj){
  261. DebugObj = new Object;
  262. DebugObj = window.external.Debug;
  263. }
  264. if (null == FileSystemObj) {
  265. FileSystemObj = new ActiveXObject("Scripting.FileSystemObject");
  266. }
  267. if (null == ApiObj)
  268. {
  269. ApiObj = new Object;
  270. ApiObj = window.external.API;
  271. }
  272. if (null == StatusObj)
  273. {
  274. StatusObj = new Object;
  275. StatusObj = window.external.Status;
  276. }
  277. if (null == DirObj)
  278. {
  279. DirObj = new Object;
  280. DirObj = window.external.Directions;
  281. }
  282. if (null == InfoObj)
  283. {
  284. InfoObj = new Object;
  285. InfoObj = window.external.UserInfo;
  286. }
  287. if (null == TapiObj)
  288. {
  289. TapiObj = new Object;
  290. TapiObj = window.external.Tapi;
  291. }
  292. if (null == RegisterObj)
  293. {
  294. RegisterObj = new Object;
  295. RegisterObj = window.external.Register;
  296. }
  297. if (null == SysClockObj)
  298. {
  299. SysClockObj = new Object;
  300. SysClockObj = window.external.SystemClock;
  301. SysClockObj.Init();
  302. }
  303. if (null == LangObj)
  304. {
  305. LangObj = new Object;
  306. LangObj = window.external.Language;
  307. }
  308. // END Initialization Code
  309. // make standard ClickNext Str
  310. var L_ContStr_Text="To continue, click";
  311. var L_NextStr_Text="Next";
  312. var L_Period_Text=".";
  313. var L_ClickNextLocStr_Text=""; // for localizers to add stuff without affecting L_Period_Text
  314. var L_ClickNextStrTopPercent800_Text="87%";
  315. var L_ClickNextStrTopPercent1024_Text="84%";
  316. var L_ClickNextStrLeftPercent_Text="62%";
  317. var g_ClickNextStr = "<table tabindex=-1 border=0 style=\"position:absolute; top: " + ((window.top.screen.width < 1024) ? L_ClickNextStrTopPercent800_Text : L_ClickNextStrTopPercent1024_Text) + "; left:2%;\"><tr><td width="+L_ClickNextStrLeftPercent_Text+"></td>"
  318. +"<td class=\"text-primary\" ID=NextText>"+L_ContStr_Text+" <span class=\"emphasis-lesser\">"
  319. +L_NextStr_Text+"</span>"+L_ClickNextLocStr_Text+L_Period_Text+"</td></tr></table>";
  320. var L_NextStrTopPercent_Text="83%";
  321. function trace(sMsg)
  322. {
  323. DebugObj.Trace(sMsg + "\n");
  324. }
  325. function logError(funcName, err)
  326. {
  327. trace( "Exception in " + funcName + ": "
  328. + err.number.toString(16) + ": "
  329. + err.description
  330. );
  331. if (DebugObj.get_MsDebugMode())��
  332. {
  333. alert("OOBE Exception\n"
  334. + "\nFunction: " + funcName
  335. + "\nError: " + err.number.toString(16)
  336. + "\nDescription: " + err.description
  337. );
  338. }
  339. }
  340. //////////////////////////////////////////////////////////////////////////////////////
  341. // IMETut1.htm
  342. //////////////////////////////////////////////////////////////////////////////////////
  343. function imetut_LoadMe()
  344. {
  345. InitFrameRef();
  346. g_FirstFocusElement = g.btnNextText;
  347. if (1 != DirObj.get_DoRegionalKeyboard())
  348. HideButtons(HIDE_BACK);
  349. InitButtons();
  350. g_FirstFocusElement.focus();
  351. }
  352. //////////////////////////////////////////////////////////////////////////////////////
  353. // theatre.htm
  354. //////////////////////////////////////////////////////////////////////////////////////
  355. function Theatre_LoadMe( )
  356. {
  357. InitFrameRef( );
  358. g_FirstFocusElement = g.btnNext;
  359. InitButtons( );
  360. }
  361. function Theatre_OnFSCommand(command, args)
  362. {
  363. if ("MOVIE_COMPLETE" == command)
  364. {
  365. g.btnNext.click( );
  366. }
  367. }
  368. //////////////////////////////////////////////////////////////////////////////////////
  369. // welcome.htm
  370. //////////////////////////////////////////////////////////////////////////////////////
  371. function Start_OnKeyPress()
  372. {
  373. try
  374. {
  375. if (g.event == null)
  376. return;
  377. }
  378. catch(e)
  379. {
  380. return;
  381. }
  382. // Treat the enter key like the next button
  383. // since the user hasn't gone through the mouse tutorial yet
  384. if ((g.event.keyCode == KeyEnter) &&
  385. (g.btnNext.disabled == false))
  386. {
  387. GoNext();
  388. }
  389. else
  390. {
  391. KeyPressIsValid();
  392. }
  393. }
  394. function MAKELANGID(p, s)
  395. {
  396. return (( s << 10) | p);
  397. }
  398. function MAKELCID(lgid, srtid)
  399. {
  400. return ((srtid << 16) | lgid);
  401. }
  402. function IsKoreanLocale() {
  403. var language = ApiObj.get_UserDefaultLCID();
  404. if (language == MAKELCID(MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN), SORT_DEFAULT)) {
  405. return true;
  406. }
  407. return false;
  408. }
  409. function IsFarEastLocale()
  410. {
  411. // if local is Korean, Simplified Chinese,
  412. // Traditional Chinese,or Japanese then we return true
  413. var language = ApiObj.get_UserDefaultLCID();
  414. if (language == MAKELCID(MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN), SORT_DEFAULT) ||
  415. language == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL), SORT_DEFAULT) ||
  416. language == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT) ||
  417. language == MAKELCID(MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT), SORT_DEFAULT))
  418. return true
  419. else
  420. return false;
  421. }
  422. // Function: Start_LoadMe
  423. // Description: This function is called after start.htm is
  424. // loaded. we then initialize Items on the page.
  425. // we also populate the edits with any values already
  426. // found in the registry.
  427. //
  428. var L_Thanks1_Text="thank you";
  429. var L_Welc_Text="Welcome";
  430. var L_Comma_Text=",";
  431. var g_bNeedtoRunWelcomeFadeIn= (DirObj.get_DoWelcomeFadeIn()>0);
  432. var g_bNeedtoRunAnimation=false; // will be set in InitApplication
  433. var g_RunAnimInitVal = DirObj.get_DoRunAnimation();
  434. var g_bAnimationRunning = false;
  435. function Start_LoadMe()
  436. {
  437. InitFrameRef();
  438. var WaterMarkFileHandle=FileSystemObj.GetFile(g_WaterMarkFileNameStr);
  439. if(WaterMarkFileHandle.size != g_WaterMarkFileSize) {
  440. g.WelcomeImg.style.display="none";
  441. }
  442. g_FirstFocusElement = g.btnNext;
  443. g.btnNext.disabled = false;
  444. var strOEMName = g_OEMNameStr;
  445. var strPrepend = "";
  446. var FirstName=window.external.UserInfo.get_FirstName();
  447. var LastName=window.external.UserInfo.get_LastName();
  448. if((FirstName.length>0) || (LastName.length>0)) {
  449. var NameStr="";
  450. if (IsFarEastLocale()) {
  451. // switch first & last name order
  452. var tmpstr=FirstName;
  453. FirstName=LastName;
  454. LastName=tmpstr;
  455. }
  456. // get the right # of spaces b/w words
  457. if(FirstName!=null) {
  458. NameStr=FirstName;
  459. }
  460. if(LastName!=null && LastName!="") {
  461. if(NameStr!="") {
  462. NameStr=NameStr+" "+LastName;
  463. } else {
  464. NameStr=LastName;
  465. }
  466. }
  467. g.welcome_namestr.innerText = L_Welc_Text+ " " +NameStr+L_Comma_Text + " " + L_Thanks1_Text + " ";
  468. }
  469. // put an "a" or an "an" before the OEM name in welcome page
  470. if (strOEMName.length != 0)
  471. {
  472. var Query = strOEMName.charAt(0);
  473. if (Query.match(/A|E|I|O|U|a|e|i|o|u/) != null)
  474. strPrepend = L_StrVowelBeginningPrepender_Text;
  475. else
  476. strPrepend = L_StrPrepender_Text;
  477. g.spanOEMName.innerText = strPrepend + " " + strOEMName;
  478. }
  479. g.WelcomePageText.style.display="inline";
  480. InitButtons();
  481. if(g_bNeedtoRunWelcomeFadeIn) {
  482. // this entire 'junkspan' sequence is done so that the necessary DLL's for blendtrans
  483. //(ddraw.dll/ddrawex.dll/dxtmsft.dll/dxtrans.dll/atl.dll) are preloaded before the
  484. // real blend is done after the movie
  485. junkspan.style.filter="blendTrans(duration=10.0)"; // 10.0 is junk placeholder
  486. junkspan.filters[0].duration=0.1;
  487. junkspan.filters[0].enabled=true;
  488. junkspan.filters[0].Apply();
  489. junkspan.style.backgroundColor="red";
  490. junkspan.style.display="inline";
  491. junkspan.filters[0].Play();
  492. junkspan.style.display="none";
  493. junkspan.filters[0].enabled=false;
  494. junkspan.style.filter=null;
  495. }
  496. window.external.ShowOOBEWindow(); // we've done all the init preprocessing we can
  497. // see if we need to run movie
  498. if((g_RunAnimInitVal>0) && (g_bNeedtoRunAnimation || (g_RunAnimInitVal==99))) {
  499. g_bAnimationRunning = true;
  500. MovieFrame.style.display="inline"; // start movie
  501. ScreenFrame.style.visibility = "visible";
  502. ScreenFrame.style.display = "inline";
  503. } else if(g_bNeedtoRunWelcomeFadeIn) {
  504. // transition still not visible on direct boot, too much disk activity
  505. // 7 seconds appears to be visible. may need to fine tune that 4.5 number.
  506. // want to consider machine speed as well, longer number may be too long
  507. // for slow machine? (or you may need longer, since it takes longer to load?)
  508. // want fast machine to work well
  509. RunWelcomeFadeIn(3.0);
  510. } else {
  511. ScreenFrame.style.visibility = "visible";
  512. ScreenFrame.style.display = "inline";
  513. OOBEDocBody.style.cursor = "default";
  514. g_FirstFocusElement.focus();
  515. window.setTimeout("Agent_Activate('Welcome');",1000);
  516. }
  517. g_bNeedtoRunAnimation=false;
  518. g_RunAnimInitVal=0;
  519. }
  520. function RunWelcomeFadeIn(duration) {
  521. // need to turn off so fade transition is visible
  522. // needed if nav'ing from USB pages
  523. if(ScreenFrame.style.display!="none") {
  524. ScreenFrame.style.display="none";
  525. ScreenFrame.style.visibility = "hidden";
  526. }
  527. ScreenFrame.style.filter="blendTrans(duration=10.0)"; // 10.0 is junk placeholder
  528. ScreenFrame.filters[0].duration=duration;
  529. ScreenFrame.filters[0].enabled=true;
  530. ScreenFrame.onfilterchange=DisableScreenTransition;
  531. ScreenFrame.filters[0].Apply();
  532. MovieFrame.style.display="none"; // dont know if this works w/transition below
  533. ScreenFrame.style.visibility = "visible";
  534. ScreenFrame.style.display = "inline";
  535. ScreenFrame.filters[0].Play();
  536. }
  537. function PostMovieWelcomeInit() {
  538. if(g_bNeedtoRunWelcomeFadeIn && (g_CurrentCKPT==CKPT_WELCOME)) {
  539. g_bAnimationRunning = false;
  540. RunWelcomeFadeIn(3.0);
  541. } else {
  542. MovieFrame.style.display="none"; // dont know if this works w/transition below
  543. ScreenFrame.style.visibility = "visible";
  544. ScreenFrame.style.display = "inline";
  545. g_FirstFocusElement.focus();
  546. OOBEDocBody.style.cursor = "default";
  547. // want to make sure screen is drawn before agent pops up
  548. if(g_CurrentCKPT==CKPT_WELCOME) {
  549. window.setTimeout("Agent_Activate('Welcome');",1000);
  550. } else if(g_CurrentCKPT==CKPT_HWCHK) {
  551. g_bAnimationRunning = false; // want to prevent OnDeviceArrival from doing anything until now
  552. // check if USB device was attached during movie, possible nav to welcome
  553. OnDeviceArrival();
  554. }
  555. }
  556. g_bAnimationRunning = false;
  557. }
  558. function DisableScreenTransition() {
  559. // called when transition completed
  560. g_bNeedtoRunWelcomeFadeIn=false;
  561. ScreenFrame.filters[0].enabled=false;
  562. ScreenFrame.style.filter=null;
  563. g_FirstFocusElement.focus(); // bugbug need to add this back to filter too
  564. OOBEDocBody.style.cursor = "default";
  565. window.setTimeout("Agent_Activate('Welcome');",700);
  566. }
  567. // Function: Start_CheckEdits
  568. // Description: This function is called everytime an OnClick
  569. // event fires on the page. This is done so if the user
  570. // loses focus from one of the edits we can push them
  571. // in the right direction and hint them along the way
  572. // Or if all elements are filled then we enabled
  573. // the next button or if any value is 0 then we
  574. // disable the next button
  575. //
  576. function Start_CheckEdits()
  577. {
  578. try
  579. {
  580. if (g.event == null)
  581. return;
  582. }
  583. catch(e)
  584. {
  585. return;
  586. }
  587. if ((g.event.srcElement != g.edt_FirstName) &&
  588. (g.event.srcElement != g.edt_LastName))
  589. {
  590. Start_CheckEnableNextButton();
  591. }
  592. }
  593. // Function: Start_CheckEnableNextButton
  594. // Description: This function is called everytime a keyup
  595. // event fires on a edit box for first, middle, or last
  596. // name. We then see if we should enable or disable the
  597. // next button based on if every field has a value.
  598. // First || Last
  599. //
  600. function Start_CheckEnableNextButton()
  601. {
  602. try
  603. {
  604. if (g.event == null)
  605. return;
  606. }
  607. catch(e)
  608. {
  609. return;
  610. }
  611. if (Start_CheckLengthRequirement() &&
  612. Start_CheckLengthNotEqualSpaces())
  613. {
  614. g.btnNext.disabled = false;
  615. }
  616. else
  617. {
  618. g.btnNext.disabled = true;
  619. }
  620. InitButtons();
  621. }
  622. function Start_CheckLengthRequirement()
  623. {
  624. if ((g.edt_FirstName.value.length != 0) ||
  625. (g.edt_LastName.value.length != 0))
  626. return true;
  627. else
  628. return false;
  629. }
  630. function Start_CheckLengthNotEqualSpaces()
  631. {
  632. if ((g.edt_FirstName.value.length != NumberOfSpaces(g.edt_FirstName.value)) ||
  633. (g.edt_LastName.value.length != NumberOfSpaces(g.edt_LastName.value)))
  634. return true;
  635. else
  636. return false;
  637. }
  638. // END welcome.htm
  639. // reg1.htm ////
  640. var g_Reg1Yes=true;
  641. function HandleReg1Click() {
  642. g_Reg1Yes=(g.event.srcElement==g.radioRegNeedPP);
  643. }
  644. function Reg1_LoadMe()
  645. {
  646. InitFrameRef();
  647. if (1 == RegisterObj.get_PostToOEM) {
  648. g.OEMName.innerText=g_OEMNameStr+ " " + L_And_Text + " " ;
  649. g.OEMName5.innerText=g.OEMName.innerText;
  650. if(g.OEMName.innerText=="") {
  651. g.OEMName.innerText="Error: Missing OEM Name in oobeinfo.ini [Branding] section ";
  652. }
  653. }
  654. g.Reg1Title.style.visibility="visible";
  655. g.Reg1Intro.style.visibility="visible";
  656. g_FirstFocusElement = g.btnNext;
  657. if(g_Reg1Yes) {
  658. g.radioRegNeedPP.checked=true;
  659. } else {
  660. g.radioRegLater.checked=true;
  661. }
  662. g.radioRegNeedPP.onclick=HandleReg1Click;
  663. g.radioRegLater.onclick=HandleReg1Click;
  664. InitButtons();
  665. if (g_FirstFocusElement != null)
  666. g_FirstFocusElement.focus();
  667. }
  668. // reg2.htm //////
  669. var g_Reg2EmailName="";
  670. var g_Reg2MachineName="";
  671. var g_Reg2PW="";
  672. function Reg2SaveSettings() {
  673. // restore fields
  674. g_Reg2EmailName= g.emailname.value;
  675. g_Reg2MachineName= g.machinename.value;
  676. g_Reg2PW=g.passwd.value;
  677. }
  678. function Reg2_LoadMe() {
  679. InitFrameRef();
  680. g_FirstFocusElement = g.emailname;
  681. // restore fields
  682. g.emailname.value = g_Reg2EmailName;
  683. g.machinename.value = g_Reg2MachineName;
  684. g.passwd.value = g_Reg2PW;
  685. InitButtons();
  686. if (g_FirstFocusElement != null)
  687. g_FirstFocusElement.focus();
  688. }
  689. function Reg2_RemindMe()
  690. {
  691. // BUGBUG: need to fill in later
  692. /*
  693. 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.
  694. */
  695. }
  696. function Default_radioClicked()
  697. {
  698. try
  699. {
  700. if (g.event == null)
  701. return;
  702. }
  703. catch(e)
  704. {
  705. return;
  706. }
  707. g.btnNext.disabled = false;
  708. InitButtons();
  709. }
  710. //// reg3.htm ///////////////////////
  711. 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");
  712. 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");
  713. var ProvinceNames = new Array("","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon");
  714. // need ability to map state name string to index into StateAbbrevs
  715. var g_StateName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  716. g_StateName2IndexMap.CompareMode = CompareModeText;
  717. var g_ProvinceName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  718. g_ProvinceName2IndexMap.CompareMode = CompareModeText;
  719. // windows scripting host -- used to send fake keybd events for keyboard helper on PID page
  720. var WshShell = new ActiveXObject("WScript.Shell");
  721. // init hash table
  722. var ii;
  723. for(ii=1;ii<=FullStateNames.length;ii++) {
  724. // add both full name and abbrev to hash table
  725. g_StateName2IndexMap.Add(FullStateNames[ii-1].toUpperCase(),ii);
  726. g_StateName2IndexMap.Add(StateAbbrevs[ii].toUpperCase(),ii);
  727. if(ii < ProvinceNames.length) {
  728. g_ProvinceName2IndexMap.Add(ProvinceNames[ii].toUpperCase(),ii);
  729. }
  730. }
  731. var L_Postal_Text = "Postal or <u>Z</u>IP code:";
  732. var L_AsteriskPostal_Text = "*Postal or <u>Z</u>IP code:";
  733. var L_Province_Text= "State/<u>P</u>rovince:";
  734. var L_AsteriskProvince_Text= "*State/<u>P</u>rovince:";
  735. var L_Canada_Text="Canada";
  736. var L_UnitedStates_Text="United States of America";
  737. function Reg3UserCountryChanged() {
  738. // AGENT: notify Agent of the change
  739. Agent_OnSelectChange(g.selCountry);
  740. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  741. if(g_Country == L_UnitedStates_Text) {
  742. // when changing to US, try to translate any textbox string to state index
  743. if(g.UserStateTextBox.value!="") {
  744. var res=g_StateName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  745. if(res!=null) {
  746. g.selUSState.selectedIndex=res;
  747. }
  748. }
  749. g.selCAProvince.style.display="none";
  750. g.UserStateTextBox.style.display="none";
  751. if(g.selUSState.style.display!="inline") {
  752. g.selUSState.style.display="inline";
  753. }
  754. g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  755. g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  756. g.StateLabel.htmlFor="selUSState";
  757. } else if(g_Country == L_Canada_Text) {
  758. // when changing to Canada, try to translate any textbox string to province index
  759. if(g.UserStateTextBox.value!="") {
  760. var res=g_ProvinceName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  761. if(res!=null) {
  762. g.selCAProvince.selectedIndex=res;
  763. }
  764. }
  765. g.selUSState.style.display="none";
  766. g.UserStateTextBox.style.display="none";
  767. g.selCAProvince.style.display="inline";
  768. g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  769. g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  770. g.StateLabel.htmlFor="selCAProvince";
  771. } else {
  772. g.selUSState.style.display="none";
  773. g.selCAProvince.style.display="none";
  774. g.UserStateTextBox.style.display="inline";
  775. g.LabelZIP.innerHTML = L_Postal_Text;
  776. g.StateLabel.innerHTML = L_Province_Text;
  777. g.StateLabel.htmlFor="UserStateTextBox";
  778. }
  779. g_CountryIdx=g.selCountry.selectedIndex;
  780. Reg3UserStateChanged();
  781. }
  782. function Reg3UserStateChanged() {
  783. // AGENT: notify Agent of the change
  784. // BUGBUG: ok for no notify on change to textbox?
  785. Agent_OnSelectChange((g.selUSState.style.display != "none") ? g.selUSState : g.selCAProvince);
  786. if(g.selUSState.style.display!="none")
  787. {
  788. g_StateIdx=g.selUSState.selectedIndex;
  789. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  790. }
  791. else if (g.selCAProvince.style.display!="none")
  792. {
  793. g_StateIdx=g.selCAProvince.selectedIndex;
  794. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  795. }
  796. else
  797. {
  798. g_State = g.UserStateTextBox.value;
  799. }
  800. }
  801. // store field info here:
  802. var g_FirstName=InfoObj.get_FirstName();
  803. var g_MiddleName=InfoObj.get_MiddleInitial(); // InfoObj.get_MiddleName(); BUGBUG need to add this fn
  804. var g_LastName=InfoObj.get_LastName();
  805. var g_Address1=InfoObj.get_Address1();
  806. var g_Address2=InfoObj.get_Address2();
  807. var g_City=InfoObj.get_City();
  808. var g_ZipCode=InfoObj.get_Zip();
  809. var g_EmailAddr= InfoObj.get_PrimaryEmail();
  810. var g_Country=InfoObj.get_Country();
  811. var g_CountryIdx=-1;
  812. var g_State=InfoObj.get_State();
  813. var g_StateIdx=0;
  814. function Reg3SaveSettings() {
  815. g_FirstName=g.UserFirstName.value;
  816. g_MiddleName=g.UserMiddleName.value;
  817. g_LastName=g.UserLastName.value;
  818. g_Address1=g.UserAddress.value;
  819. g_Address2=g.UserAddress2.value;
  820. g_ZipCode=g.UserZipCode.value;
  821. g_EmailAddr=g.UserEmailAddress.value;
  822. g_City=g.UserCity.value;
  823. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  824. if(g.UserStateTextBox.style.display!="none")
  825. {
  826. g_State=g.UserStateTextBox.value;
  827. }
  828. else if (g.selUSState.style.display!="none")
  829. {
  830. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  831. }
  832. else
  833. {
  834. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  835. }
  836. InfoObj.set_FirstName(g_FirstName);
  837. InfoObj.set_LastName(g_LastName);
  838. InfoObj.set_MiddleInitial(g_MiddleName);
  839. InfoObj.set_Country(g_Country);
  840. InfoObj.set_State(g_State);
  841. InfoObj.set_Address1(g_Address1);
  842. InfoObj.set_Address2(g_Address2);
  843. InfoObj.set_PrimaryEmail(g_EmailAddr);
  844. InfoObj.set_Zip(g_ZipCode);
  845. InfoObj.set_City(g_City);
  846. TapiObj.set_CountryIndex(g.selCountry.selectedIndex);
  847. }
  848. var L_FullName_Text="*<u>F</u>ull Name:";
  849. function Reg3_LoadMe()
  850. {
  851. // AGENT: we don't want Agent to process any events
  852. // that might occur as a result of initializing the
  853. // controls.
  854. Agent_IgnoreEvents(true);
  855. InitFrameRef();
  856. if (1 == RegisterObj.get_PostToOEM) {
  857. g.OEMName.innerText=g_OEMNameStr+ " " + L_And_Text + " " ;
  858. if(g.OEMName.innerText=="") {
  859. g.OEMName.innerText="Error: Missing OEM Name in oobeinfo.ini [Branding] section ";
  860. }
  861. }
  862. var fTapi = TapiObj.IsTAPIConfigured(); // init TAPI
  863. var CountryOptStr=TapiObj.get_AllCountryName();
  864. // we used to do a document.write() to put this into selCountry. IE 5.5 seems to
  865. // have redraw probs with long doc.writes, so parse it out and add it once in onload
  866. var i;
  867. var oOption;
  868. var regexp1=/<OPTION>/g;
  869. var tmpOptsStr = CountryOptStr.replace(regexp1, ""); //delete <OPTION>
  870. var OptStrArray = tmpOptsStr.split("</OPTION>");
  871. for(i=0; i < OptStrArray.length; i++) {
  872. oOption = g.document.createElement("OPTION");
  873. oOption.text = OptStrArray[i];
  874. g.selCountry.add(oOption);
  875. }
  876. g.selCountry.onchange=Reg3UserCountryChanged;
  877. g.Reg3Title.style.visibility="visible";
  878. g_FirstFocusElement = g.UserFirstName;
  879. if (IsFarEastLocale())
  880. {
  881. /*For JPN, CHT, CHS,
  882. Last Name
  883. First Name
  884. Country/Region
  885. Province
  886. City
  887. Address
  888. Zip
  889. E-Mail
  890. For KOR only,
  891. Full Name
  892. Country/Region
  893. Province
  894. City
  895. Address
  896. Zip
  897. E-Mail
  898. */
  899. g.MainPageCell.style.display="none"; // hide while we change order
  900. // no middle name for far east langs
  901. g.MiddleNameRow.style.display="none";
  902. g.FieldTable.moveRow(2,0); // move lastname in front of first
  903. g.FieldTable.moveRow(7,3); // move country to after firstname
  904. g.FieldTable.moveRow(7,4); // move province to after country
  905. g.FieldTable.moveRow(7,5); // move city to after province
  906. g.FE_ZIPLabel.innerHTML=g.LabelRight.innerHTML;
  907. g.FE_ZIPInput.innerHTML=g.MenuRight.innerHTML;
  908. g.FE_ZIPRow.style.display="inline";
  909. g.LabelRight.innerHTML="";
  910. g.MenuRight.innerHTML="";
  911. // no reason to limit these lengths for FE, so just make them match others
  912. g.UserZipCode.size=30;
  913. g.UserZipCode.maxlength=120;
  914. g.UserStateTextBox.size=30;
  915. g.UserStateTextBox.maxlength=120;
  916. g_FirstFocusElement = g.UserLastName;
  917. if (IsKoreanLocale()) {
  918. g.LastNameRow.style.display="none";
  919. g.LabelFirstName.innerHTML=L_FullName_Text;
  920. g_FirstFocusElement = g.UserFirstName;
  921. }
  922. g.MainPageCell.style.display="inline";
  923. }
  924. // limit width of country menu since some text options are very long
  925. g.selCountry.style.width=g.UserEmailAddress.offsetWidth;
  926. g.UserFirstName.value=g_FirstName;
  927. g.UserMiddleName.value=g_MiddleName;
  928. g.UserLastName.value=g_LastName;
  929. g.UserAddress.value=g_Address1;
  930. g.UserAddress2.value=g_Address2;
  931. g.UserZipCode.value=g_ZipCode;
  932. g.UserEmailAddress.value=g_EmailAddr;
  933. g.UserCity.value=g_City;
  934. // placeholder idx 0 option is needed to fix 101447
  935. // Due to a possible mshtml bug, the cursor is shifted right when the menu
  936. // expands to its full width.
  937. g.selUSState.remove(0);
  938. for (var i = 0; i < StateAbbrevs.length; i++) {
  939. var oOption = g.document.createElement("OPTION");
  940. oOption.text = StateAbbrevs[i];
  941. if (StateAbbrevs[i] == g_State)
  942. {
  943. g_StateIdx = i;
  944. }
  945. g.selUSState.add(oOption);
  946. }
  947. for (i = 0; i < ProvinceNames.length; i++) {
  948. oOption = g.document.createElement("OPTION");
  949. oOption.text = ProvinceNames[i];
  950. if (ProvinceNames[i] == g_State)
  951. {
  952. g_StateIdx = i;
  953. }
  954. g.selCAProvince.add(oOption);
  955. }
  956. // Note: the way code below is written, g_CountryIdx always >=0 so 2nd branch never
  957. // taken. causes no probs though
  958. g_CountryIdx = TapiObj.get_CountryIndex();
  959. if(g_CountryIdx>=0)
  960. {
  961. g.selCountry.selectedIndex=g_CountryIdx;
  962. if(g_Country == L_UnitedStates_Text)
  963. {
  964. g.selUSState.selectedIndex=g_StateIdx;
  965. }
  966. else if(g_Country == L_Canada_Text)
  967. {
  968. g.selCAProvince.selectedIndex=g_StateIdx;
  969. }
  970. else
  971. g.UserStateTextBox.value=g_State;
  972. }
  973. else
  974. {
  975. // get default value
  976. g.selCountry.selectedIndex = TapiObj.get_CountryIndex();
  977. }
  978. Reg3UserCountryChanged();
  979. g.MainPageCell.style.visibility="visible";
  980. if (1 == RegisterObj.get_PostToOEM)
  981. {
  982. if (bPostChkBxStateSaved)
  983. {
  984. g.sharems.checked = g_PostToMS;
  985. g.shareoem.checked = g_PostToOEM;
  986. if(!g_PostToMS && !g_PostToOEM) {
  987. g.btnNext.onclick = GoCancel; // convert to Skip if nothing checked
  988. } else {
  989. g.btnNext.onclick = GoNext;
  990. }
  991. }
  992. g.OEMName2.innerText=g_OEMNameStr;
  993. g.OEMName3.innerText=g_OEMNameStr;
  994. g.RegChkBxGrp.style.display = "inline";
  995. }
  996. else
  997. {
  998. g.MSPrivatePolicyLink.style.display = "inline";
  999. g_PostToOEM = false;
  1000. }
  1001. InitButtons();
  1002. g_FirstFocusElement.focus();
  1003. // AGENT: now we want event processing
  1004. Agent_IgnoreEvents(false);
  1005. }
  1006. function GetCurrentProvince() {
  1007. if(g.selCountry.options(g.selCountry.selectedIndex).text == L_UnitedStates_Text) {
  1008. return g.selUSState.options(g.selUSState.selectedIndex).text;
  1009. } else if(g.selCountry.options(g.selCountry.selectedIndex).text == L_Canada_Text) {
  1010. return g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  1011. } else return g.UserStateTextBox.value;
  1012. }
  1013. function GetCurrentCountry() {
  1014. return g.selCountry.options(g.selCountry.selectedIndex).text;
  1015. }
  1016. var L_EnterValid_Text="Please fill in the required fields.";
  1017. var L_Email_Text="Please enter a valid E-mail address or leave the E-mail text box empty.";
  1018. var L_And_Text="and";
  1019. var g_PostToMS = true;
  1020. var g_PostToOEM = true;
  1021. var POST_TO_OEM = 1
  1022. var POST_TO_MS = 2
  1023. var bPostChkBxStateSaved = false;
  1024. function RegChkBoxOnClick()
  1025. {
  1026. g_PostToMS = g.sharems.checked;
  1027. g_PostToOEM = g.shareoem.checked;
  1028. bPostChkBxStateSaved = true;
  1029. if(!g_PostToMS && !g_PostToOEM) {
  1030. g.btnNext.onclick = GoCancel; // convert to Skip if nothing checked
  1031. } else {
  1032. g.btnNext.onclick = GoNext;
  1033. }
  1034. InitButtons();
  1035. }
  1036. function VerifyReg3Fields() {
  1037. g.error_mesg.style.display="none";
  1038. var LastErrorField = null;
  1039. var CurReg3ErrStringArray = new Array();
  1040. // user needs to complete input of address/name
  1041. // this dynamically builds the list of erroneous fields to give to the user
  1042. if(g.UserEmailAddress.value != "") {
  1043. // do some validation on email address
  1044. // Note special regexpr char like '\S' must be double-\'d because they are inside a string
  1045. var re = new RegExp("^\\s*\\S+@\\S+\\.\\S\\S+","");
  1046. if(re.exec(g.UserEmailAddress.value) == null) {
  1047. LastErrorField = g.UserEmailAddress;
  1048. g.LabelEmail.style.color = "red";
  1049. } else {
  1050. g.LabelEmail.style.color = "black";
  1051. }
  1052. }
  1053. var CurCountry=GetCurrentCountry();
  1054. // dont require state or zip except for US/Canada
  1055. if ((CurCountry == L_UnitedStates_Text)||(CurCountry == L_Canada_Text)) {
  1056. if(g.UserZipCode.value == "") {
  1057. LastErrorField = g.UserZipCode;
  1058. g.LabelZIP.style.color = "red";
  1059. } else {
  1060. g.LabelZIP.style.color = "black";
  1061. }
  1062. if(GetCurrentProvince() == "") {
  1063. if(g.selUSState.style.display!="none") {
  1064. LastErrorField = g.selUSState;
  1065. } else {
  1066. LastErrorField = g.selCAProvince;
  1067. }
  1068. g.StateLabel.style.color = "red";
  1069. } else {
  1070. g.StateLabel.style.color = "black";
  1071. }
  1072. }
  1073. if(g.UserCity.value == "") {
  1074. LastErrorField = g.UserCity;
  1075. g.LabelCity.style.color = "red";
  1076. } else {
  1077. g.LabelCity.style.color = "black";
  1078. }
  1079. if(g.UserAddress.value == "") {
  1080. LastErrorField = g.UserAddress;
  1081. g.LabelAddress.style.color = "red";
  1082. } else {
  1083. g.LabelAddress.style.color = "black";
  1084. }
  1085. if((g.UserLastName.value == "") && (g.LastNameRow.style.display!="none")) {
  1086. LastErrorField = g.UserLastName;
  1087. g.LabelLastName.style.color = "red";
  1088. } else {
  1089. g.LabelLastName.style.color = "black";
  1090. }
  1091. if((g.UserFirstName.value == "")&&(g.UserMiddleName.value == "")) {
  1092. g.LabelFirstName.style.color = "red";
  1093. LastErrorField = g.UserFirstName;
  1094. } else {
  1095. g.LabelFirstName.style.color = "black";
  1096. }
  1097. if(LastErrorField==null) {
  1098. return true;
  1099. }
  1100. // handle error
  1101. if(LastErrorField==g.UserEmailAddress) {
  1102. g.error_mesg.innerText = L_Email_Text;
  1103. } else {
  1104. g.error_mesg.innerText = L_EnterValid_Text;
  1105. }
  1106. g.error_mesg.style.color = "red";
  1107. g.error_mesg.style.display="inline";
  1108. try
  1109. {
  1110. g.btnNext.disabled=false;
  1111. }
  1112. catch(e) {}
  1113. try
  1114. {
  1115. g.btnBack.disabled=false;
  1116. }
  1117. catch(e) {}
  1118. try
  1119. {
  1120. g.btnSkip.disabled=false;
  1121. }
  1122. catch(e) {}
  1123. InitButtons();
  1124. LastErrorField.focus();
  1125. return false;
  1126. }
  1127. //////////////////////////////////////////////////////////////////////////////////////
  1128. // tapi.htm
  1129. //////////////////////////////////////////////////////////////////////////////////////
  1130. function TapiLoadMe()
  1131. {
  1132. InitFrameRef();
  1133. ResetDialing();
  1134. g_FirstFocusElement = g.selCountry;
  1135. if (null == TapiObj)
  1136. {
  1137. TapiObj = new Object;
  1138. TapiObj = window.external.Tapi;
  1139. }
  1140. RetrieveTapi();
  1141. Tapi_CountryChange();
  1142. g_FirstFocusElement.focus();
  1143. }
  1144. function Tapi_AreaCodeChange()
  1145. {
  1146. try
  1147. {
  1148. if (g.event == null)
  1149. return;
  1150. }
  1151. catch(e)
  1152. {
  1153. return;
  1154. }
  1155. if (window.external.Tapi.IsAreaCodeRequired(g.selCountry.selectedIndex) &&
  1156. window.external.CheckPhoneBook("msobe.isp") &&
  1157. g.edtAreaCode.value.length == 0)
  1158. g.btnNext.disabled = true;
  1159. else
  1160. g.btnNext.disabled = false;
  1161. InitButtons();
  1162. }
  1163. function Tapi_CountryChange()
  1164. {
  1165. try
  1166. {
  1167. if (g.event == null)
  1168. return;
  1169. }
  1170. catch(e)
  1171. {
  1172. return;
  1173. }
  1174. TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
  1175. if (window.external.CheckPhoneBook("msobe.isp"))
  1176. {
  1177. g.div_MSNNotAvailable.style.visibility = "hidden";
  1178. g.spn_AdditionalSettings.style.visibility = "visible";
  1179. g_DialingAvailableInCountry = true;
  1180. }
  1181. else
  1182. {
  1183. g.div_MSNNotAvailable.style.visibility = "visible";
  1184. g.spn_AdditionalSettings.style.visibility = "hidden";
  1185. g_DialingAvailableInCountry = false;
  1186. }
  1187. tapi_OutsideLineClicked();
  1188. Tapi_AreaCodeChange();
  1189. }
  1190. function StoreTapi()
  1191. {
  1192. TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
  1193. TapiObj.set_AreaCode = g.edtAreaCode.value;
  1194. if(g.radioTouchToneYes.checked)
  1195. TapiObj.set_PhoneSystem = 1; //touch tone
  1196. else
  1197. TapiObj.set_PhoneSystem = 0; //rotary
  1198. TapiObj.set_DialOut = g.edtOutsideLine.value;
  1199. }
  1200. function RetrieveTapi()
  1201. {
  1202. var fTapi = TapiObj.IsTAPIConfigured;
  1203. g.selCountry.selectedIndex = TapiObj.get_CountryIndex;
  1204. g.edtAreaCode.value = TapiObj.get_AreaCode;
  1205. if(1 == TapiObj.get_PhoneSystem)
  1206. g.radioTouchToneYes.checked = true; //touch tone
  1207. else
  1208. g.radioTouchToneNo.checked = true; //rotary
  1209. g.edtOutsideLine.value = TapiObj.get_DialOut;
  1210. if(g.edtOutsideLine.value != "")
  1211. g.radioOutSideLineYes.checked = true; //use a number to dial out
  1212. else
  1213. g.radioOutSideLineNo.checked = true; //don't use a number to dial out
  1214. }
  1215. function tapi_OutsideLineClicked()
  1216. {
  1217. try
  1218. {
  1219. if (g.event == null)
  1220. return;
  1221. }
  1222. catch(e)
  1223. {
  1224. return;
  1225. }
  1226. if (g.radioOutSideLineYes.checked == true &&
  1227. g.spn_AdditionalSettings.style.visibility == "visible")
  1228. {
  1229. g.spanOutsideLine.style.visibility = "visible";
  1230. g.edtOutsideLine.style.visibility = "visible";
  1231. g.edtOutsideLine.value = TapiObj.get_DialOut;
  1232. if (g.edtOutsideLine.value.length == 0)
  1233. g.edtOutsideLine.value = "9";
  1234. }
  1235. else
  1236. {
  1237. g.spanOutsideLine.style.visibility = "hidden";
  1238. g.edtOutsideLine.style.visibility = "hidden";
  1239. g.spanOutsideLine.style.visibility = "hidden";
  1240. g.edtOutsideLine.value = ""; //nuke out any outside line value
  1241. }
  1242. }
  1243. // END tapi.htm
  1244. // EULAWarn.htm
  1245. var L_BadEulaOEM1_TEXT = "You have chosen not to agree to the ";
  1246. var L_BadEulaOEM2_TEXT = " terms of the license agreement. If you do not accept the End User License Agreement, you cannot use Windows Whistler.";
  1247. var L_BadEulaMSOEM1_TEXT = "You have chosen not to agree to the Microsoft or ";
  1248. var L_BadEulaMSOEM2_TEXT = " terms of the license agreement. If you do not accept the End User License Agreements, you cannot use Windows Whistler.";
  1249. var BadEulaOEMStr = L_BadEulaOEM1_TEXT + g_OEMNameStr + L_BadEulaOEM2_TEXT;
  1250. var BadEulaMSOEMStr = L_BadEulaMSOEM1_TEXT + g_OEMNameStr + L_BadEulaMSOEM2_TEXT;
  1251. function EULAWarn_LoadMe()
  1252. {
  1253. InitFrameRef();
  1254. g_FirstFocusElement = g.btnBack;
  1255. if (!g_AcceptMS_EULA && !g_AcceptOEM_EULA)
  1256. g.EULAWarn_INFO1.innerText = BadEulaMSOEMStr;
  1257. else if (!g_AcceptOEM_EULA) // just didn't accept OEM
  1258. g.EULAWarn_INFO1.innerText = BadEulaOEMStr;
  1259. InitButtons();
  1260. g_FirstFocusElement.focus();
  1261. }
  1262. // END EULAWarn.htm
  1263. //////////////////////////////////////////////////////////////////////////////////////
  1264. // General Default LoadMe function
  1265. //////////////////////////////////////////////////////////////////////////////////////
  1266. function _Default_LoadMe(UseSimpleNavArg)
  1267. {
  1268. InitFrameRef();
  1269. if (g.btnNext != null)
  1270. g_FirstFocusElement = g.btnNext;
  1271. else if (g.btnSkip != null)
  1272. g_FirstFocusElement = g.btnSkip;
  1273. else if (g.btnBack != null)
  1274. g_FirstFocusElement = g.btnBack;
  1275. InitButtons(UseSimpleNavArg);
  1276. if (g_FirstFocusElement != null)
  1277. g_FirstFocusElement.focus();
  1278. else
  1279. g.document.body.focus();
  1280. /*
  1281. // small piddly things I dont want to create a new onload fn for
  1282. switch(g_CurrentCKPT) {
  1283. case CKPT_REGKB_COMMIT:
  1284. break;
  1285. }
  1286. */
  1287. }
  1288. //////////////////////////////////////////////////////////////////////////////////////
  1289. // eula.htm
  1290. //////////////////////////////////////////////////////////////////////////////////////
  1291. function HandleTextAreaFocus() {
  1292. g.event.srcElement.style.borderStyle="ridge";
  1293. }
  1294. function HandleTextAreaBlur() {
  1295. g.event.srcElement.style.borderStyle="";
  1296. }
  1297. function EulaLoadMe()
  1298. {
  1299. if (window.external.GetNoWelcomeFinish())
  1300. {
  1301. g.btnNext = g.btnFinish;
  1302. g.btnFinish.style.display = "inline";
  1303. g.ToContinueFinishSpn.style.display = "inline";
  1304. }
  1305. else
  1306. {
  1307. g.ToContinueNextSpn.style.display = "inline";
  1308. g.btnNext.style.display = "inline";
  1309. }
  1310. InitFrameRef();
  1311. if (1 == window.external.GetOEMEula()) // Show both MS and OEM Eula
  1312. {
  1313. g.txtEULA.rows = 5; // shorten the MS Eula txt to make room
  1314. g.txtEULA2.innerText = ApiObj.LoadFile(window.external.GetOEMEulaText());
  1315. g.OEMEulaSpan.style.display = "inline";
  1316. }
  1317. else
  1318. {
  1319. g.radioAgree2.checked = true;
  1320. }
  1321. g.MSEulaSpan.style.display = "inline";
  1322. g_FirstFocusElement = g.txtEULA;
  1323. var fileEULA = EulaObj.ValidateEULA();
  1324. var L_strBadEULA_Text = "Setup was unable to display the User License Agreement. Setup will now close.";
  1325. if (0 == fileEULA.length)
  1326. {
  1327. alert(L_strBadEULA_Text);
  1328. window.external.PowerDown(0);
  1329. }
  1330. g.txtEULA.innerText = ApiObj.LoadFile(fileEULA);
  1331. if (0 == g.txtEULA.innerText.length)
  1332. {
  1333. alert(L_strBadEULA_Text);
  1334. window.external.PowerDown(0);
  1335. }
  1336. // disable if both unchecked, in case we ever persist the radio click
  1337. if(!(g.radioAgree.checked || g.radioDisAgree.checked))
  1338. g.btnNext.disabled = true;
  1339. InitButtons();
  1340. g.btnNext.onclick = EulaNextBtnHandler;
  1341. g_FirstFocusElement.focus();
  1342. try
  1343. {
  1344. g.document.body.onkeydown = EulaOnKeyDown;
  1345. }
  1346. catch(e){}
  1347. }
  1348. function EulaNextBtnHandler() {
  1349. StoreEula();
  1350. GoNext();
  1351. }
  1352. function EulaOnKeyDown()
  1353. {
  1354. if (KeyEsc == g.event.keyCode)
  1355. {
  1356. g.event.returnValue = false;
  1357. g.event.keyCode = 0;
  1358. }
  1359. OnKeyDown();
  1360. }
  1361. var g_AcceptMS_EULA = false;
  1362. var g_AcceptOEM_EULA = false;
  1363. function EulaRadioClicked()
  1364. {
  1365. // if they click on either button, enable next
  1366. if(g.btnNext.disabled && ((g.radioAgree.checked || g.radioDisAgree.checked) &&
  1367. (g.radioAgree2.checked || g.radioDisAgree2.checked)))
  1368. {
  1369. g.btnNext.onmouseover = HandleButtonMouseOver;
  1370. g.btnNext.onmouseout = HandleButtonMouseOut;
  1371. g.btnNext.className="buttons";
  1372. g.btnNext.disabled = false;
  1373. g.btnNext.onclick = EulaNextBtnHandler;
  1374. g.btnNext.focus();
  1375. }
  1376. g_AcceptMS_EULA = g.radioAgree.checked;
  1377. g_AcceptOEM_EULA = g.radioAgree2.checked;
  1378. }
  1379. function StoreEula()
  1380. {
  1381. EulaObj.set_EULAAcceptance = (g.radioAgree.checked && g.radioAgree2.checked);
  1382. }
  1383. // END eula.htm
  1384. var g_daylight=SysClockObj.get_AutoDaylight();
  1385. var g_CurTimeZoneIdx = SysClockObj.get_TimeZoneIdx();
  1386. function HandleTZChkBox()
  1387. {
  1388. g_daylight = g.daylight.checked; // this just persists on nav back
  1389. OnClick();
  1390. }
  1391. function HandleSelTZChange()
  1392. {
  1393. g_CurTimeZoneIdx = g.selTimeZone.selectedIndex;
  1394. g.daylight.disabled = !SysClockObj.get_DaylightEnabled(g_CurTimeZoneIdx);
  1395. }
  1396. function TimeZone_LoadMe()
  1397. {
  1398. InitFrameRef();
  1399. g_FirstFocusElement = g.selTimeZone;
  1400. InitButtons();
  1401. g.daylight.checked = g_daylight;
  1402. g.daylight.onclick = HandleTZChkBox;
  1403. g.selTimeZone.onchange=HandleSelTZChange;
  1404. g.selTimeZone.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  1405. g.selTimeZone.selectedIndex = g_CurTimeZoneIdx;
  1406. g.daylight.disabled = !SysClockObj.get_DaylightEnabled(g_CurTimeZoneIdx);
  1407. g_FirstFocusElement.focus();
  1408. }
  1409. //////////////////////////////////////////////////////////////////////////////////////
  1410. // keybdcmt.htm
  1411. //////////////////////////////////////////////////////////////////////////////////////
  1412. var g_RegionSelIdx=LangObj.get_RegionIndex();
  1413. var g_LangSelIdx=LangObj.get_LangIndex();
  1414. var g_KeyboardSelIdx=LangObj.get_KeyboardLayoutIndex();
  1415. function RegKBCmt_LoadMe()
  1416. {
  1417. InitFrameRef();
  1418. g_FirstFocusElement = g.btnNext;
  1419. InitButtons();
  1420. g.newkeybdname.innerText=LangObj.get_KeyboardLayoutName(g_KeyboardSelIdx);
  1421. g.newregionname.innerText=LangObj.get_RegionName(g_RegionSelIdx);
  1422. g.newlangname.innerText=LangObj.get_LangName(g_LangSelIdx);
  1423. g_FirstFocusElement.focus();
  1424. }
  1425. // END keybdcmt.htm
  1426. //////////////////////////////////////////////////////////////////////////////////////
  1427. // keybd.htm
  1428. //////////////////////////////////////////////////////////////////////////////////////
  1429. var iMaxKeybdNameLen=1;
  1430. var iMaxRegionNameLen=1;
  1431. var iMaxLangNameLen=1;
  1432. function HandleKeybdPageSelMenuChange() {
  1433. var namestr=g.event.srcElement.id.slice(3);
  1434. eval('g.'+namestr+'Name.value=g.event.srcElement.options(g.event.srcElement.selectedIndex).text;');
  1435. eval('g_'+namestr+'SelIdx='+'g.event.srcElement.selectedIndex;');
  1436. }
  1437. function SetKeybdFocus() {
  1438. g.selKeyboard.focus();
  1439. }
  1440. function SetRegionFocus() {
  1441. g.selRegion.focus();
  1442. }
  1443. function SetLangFocus() {
  1444. g.selLang.focus();
  1445. }
  1446. // keep separating mechanism in case we need to shorten these strings
  1447. var L_LangStr_Text="Select your preferred language.";
  1448. var LangStrSmall=L_LangStr_Text;
  1449. var L_RegionStr_Text="Select the region closest to where you live.";
  1450. var RegionStrSmall=L_RegionStr_Text;
  1451. var L_KeybdStr_Text="The keyboard that came with your computer is designed for typing in a particular language and may have special function keys. Select the type of keyboard you have. (For a standard English language keyboard, click United States 101)";
  1452. var KeybdStrSmall=L_KeybdStr_Text;
  1453. var L_KeybdTitleSmall_Text="Select Your System Settings";
  1454. function RegKBLoadMe()
  1455. {
  1456. InitFrameRef();
  1457. g_FirstFocusElement = g.selRegion;
  1458. InitButtons();
  1459. RetrieveRegKB();
  1460. g.selKeyboard.onchange = HandleKeybdPageSelMenuChange;
  1461. g.selRegion.onchange = HandleKeybdPageSelMenuChange;
  1462. g.selLang.onchange = HandleKeybdPageSelMenuChange;
  1463. // fix 110160
  1464. g.KeyboardName.onfocus = SetKeybdFocus;
  1465. g.RegionName.onfocus = SetRegionFocus;
  1466. g.LangName.onfocus = SetLangFocus;
  1467. // init name boxes
  1468. g.RegionName.value=g.selRegion.options(g.selRegion.selectedIndex).text;
  1469. g_RegionSelIdx=g.selRegion.selectedIndex;
  1470. g.LangName.value=g.selLang.options(g.selLang.selectedIndex).text;
  1471. g_LangSelIdx=g.selLang.selectedIndex;
  1472. g.KeyboardName.value=g.selKeyboard.options(g.selKeyboard.selectedIndex).text;
  1473. g_KeyboardSelIdx=g.selKeyboard.selectedIndex;
  1474. // need to shorten text for small screen to make things fit
  1475. if(window.top.screen.width<1024) {
  1476. g.KeybdStr.innerText=KeybdStrSmall;
  1477. g.RegionStr.innerText=RegionStrSmall;
  1478. g.LangStr.innerText=LangStrSmall;
  1479. for(i=3;i<=5;i++) {
  1480. eval("g.LargeResSpc"+i.toString()+".style.display='none';");
  1481. }
  1482. g.KeyBdTitle.innerText=L_KeybdTitleSmall_Text;
  1483. } else {
  1484. g.KeybdStr.innerText=L_KeybdStr_Text;
  1485. g.RegionStr.innerText=L_RegionStr_Text;
  1486. g.LangStr.innerText=L_LangStr_Text;
  1487. }
  1488. g.LangStr.style.visibility="visible";
  1489. g.KeybdStr.style.visibility="visible";
  1490. g.RegionStr.style.visibility="visible";
  1491. g.selRegion.style.visibility="visible";
  1492. g.selKeyboard.style.visibility="visible";
  1493. g.selLang.style.visibility="visible";
  1494. g.KeyboardName.style.visibility="visible";
  1495. g.RegionName.style.visibility="visible";
  1496. g.LangName.style.visibility="visible";
  1497. g.KeyboardName.style.cursor="default";
  1498. g.RegionName.style.cursor="default";
  1499. g.LangName.style.cursor="default";
  1500. g_FirstFocusElement.focus();
  1501. }
  1502. // use this to enable "Enter" key as Next Button.
  1503. // but I really need to select focus'd button with enter.
  1504. // have next button be focused by default?? or is enter better, since
  1505. // they might not click on next
  1506. function RegKB_KeyPress()
  1507. {
  1508. try
  1509. {
  1510. if (g.event == null)
  1511. return;
  1512. }
  1513. catch(e)
  1514. {
  1515. return;
  1516. }
  1517. if (g.event.keyCode == KeyEnter)
  1518. GoNext();
  1519. }
  1520. function RetrieveRegKB()
  1521. {
  1522. if(LangObj.get_RegionIndex() > 20000) {
  1523. alert("error loading default region index: possible problem in locale.inf");
  1524. }
  1525. if(LangObj.get_KeyboardLayoutIndex() > 20000) {
  1526. alert("error loading default keybd index: possible problem in locale.inf");
  1527. }
  1528. if(LangObj.get_LangIndex() > 20000 ) {
  1529. alert("error loading default lang index: possible problem in locale.inf/content.inf");
  1530. }
  1531. var ilen = LangObj.get_NumOfRegions();
  1532. for (var i = 0; i < ilen; i++)
  1533. {
  1534. var oOption = g.document.createElement("OPTION");
  1535. oOption.text = LangObj.get_RegionName(i);
  1536. g.selRegion.add(oOption);
  1537. if(oOption.text.length > iMaxRegionNameLen) {
  1538. iMaxRegionNameLen=oOption.text.length;
  1539. }
  1540. }
  1541. ilen = LangObj.get_NumOfLangs();
  1542. for (var i = 0; i < ilen; i++)
  1543. {
  1544. var oOption = g.document.createElement("OPTION");
  1545. oOption.text = LangObj.get_LangName(i);
  1546. g.selLang.add(oOption);
  1547. if(oOption.text.length > iMaxLangNameLen) {
  1548. iMaxLangNameLen=oOption.text.length;
  1549. }
  1550. }
  1551. ilen = LangObj.get_NumOfKeyboardLayouts();
  1552. for (i = 0; i < ilen; i++)
  1553. {
  1554. var oOption = g.document.createElement("OPTION");
  1555. oOption.text = LangObj.get_KeyboardLayoutName(i);
  1556. g.selKeyboard.add(oOption);
  1557. if(oOption.text.length > iMaxKeybdNameLen)
  1558. iMaxKeybdNameLen=oOption.text.length;
  1559. }
  1560. // BUGBUG
  1561. g.selRegion.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  1562. g.selRegion.selectedIndex= g_RegionSelIdx; // BUGBUG: these hacks dont work anymore
  1563. g.selKeyboard.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  1564. g.selKeyboard.selectedIndex= g_KeyboardSelIdx;
  1565. g.selLang.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
  1566. g.selLang.selectedIndex= g_LangSelIdx;
  1567. }
  1568. // END keybd.htm
  1569. // fini.htm
  1570. var L_RegisterdWithMS_Text = "You registered your copy of Windows Codename Whistler with Microsoft.";
  1571. var L_NotRegisterdWithMS_Text = "You did not register your copy of Windows Codename Whistler with Microsoft.";
  1572. var L_RegisterdWith_Text = "You registered your computer with ";
  1573. var L_NotRegisterdWith_Text = "You did not register your computer with ";
  1574. var L_SignupWith_Text = "Your computer is configured for Internet access.";
  1575. var L_NotSignupWith_Text = "Your computer is not configured for Internet access.";
  1576. var L_NotSignupButChoseIcs_Text = "Selected the shared Internet Connection to access the Internet";
  1577. var L_DefaultOEM_Text = "the OEM";
  1578. function FinishPage_LoadMe() {
  1579. InitFrameRef();
  1580. var WaterMarkFileHandle=FileSystemObj.GetFile(g_WaterMarkFileNameStr);
  1581. if(WaterMarkFileHandle.size != g_WaterMarkFileSize) {
  1582. g.ThanksImg.style.display="none";
  1583. }
  1584. if (LANGUAGE_REBOOT_END == LangObj.get_RebootState()) {
  1585. g.finishmsg.style.display="none";
  1586. g.rebootfinishmsg.style.display="inline";
  1587. }
  1588. if (STATUS_NONE != g_status && STATUS_OFF != g_status)
  1589. {
  1590. g.FiniSummaryIntro2.style.display = "inline";
  1591. g.FiniSummaryWrapper.style.display = "inline";
  1592. if (1 != window.external.get_RegStatus()) // OEM didn't Pre-reg the machine
  1593. {
  1594. if (1 == RegisterObj.get_PostToOEM)
  1595. {
  1596. var strOEMName = g_OEMNameStr;
  1597. if (strOEMName == null || (strOEMName != null && strOEMName.length == 0))
  1598. strOEMName = L_DefaultOEM_Text;
  1599. if (StatusObj.get_Status(OEM_REGISTRATION))
  1600. g.FiniSummary1.innerText = L_RegisterdWith_Text + strOEMName + L_Period_Text;
  1601. else
  1602. g.FiniSummary1.innerText = L_NotRegisterdWith_Text + strOEMName + L_Period_Text;
  1603. g.FiniSummaryBreak.style.display = "inline";
  1604. }
  1605. if (StatusObj.get_Status(MS_REGISTRATION))
  1606. g.FiniSummary2.innerText = L_RegisterdWithMS_Text;
  1607. else
  1608. g.FiniSummary2.innerText = L_NotRegisterdWithMS_Text;
  1609. }
  1610. var bHasSignup = 0;
  1611. try
  1612. {
  1613. bHasSignup = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "ISPSignup");
  1614. }
  1615. catch (e) { bHasSignup = 0;}
  1616. if (bHasSignup)
  1617. g.FiniSummary3.innerText = L_SignupWith_Text;
  1618. else if (StatusObj.get_Status(ICS_FOR_INTERNET))
  1619. {
  1620. g.FiniSummary3.innerText = L_NotSignupButChoseIcs_Text;
  1621. }
  1622. else
  1623. {
  1624. g.FiniSummary3.innerText = L_NotSignupWith_Text;
  1625. }
  1626. }
  1627. g.msgspan.style.display="inline";
  1628. if (g.btnNext != null)
  1629. g_FirstFocusElement = g.btnNext;
  1630. else if (g.btnBack != null)
  1631. g_FirstFocusElement = g.btnBack;
  1632. InitButtons();
  1633. g_FirstFocusElement.focus();
  1634. }
  1635. //////////////////////////////////////////////////////////////////////////////////////
  1636. // badpid.htm
  1637. //////////////////////////////////////////////////////////////////////////////////////
  1638. function badpid_LoadMe()
  1639. {
  1640. InitFrameRef();
  1641. g_FirstFocusElement=g.btnBack;
  1642. if (null == PidObj)
  1643. {
  1644. PidObj = new Object;
  1645. PidObj = window.external.ProductID;
  1646. }
  1647. var strPid = PidObj.get_PID();
  1648. for (var i = 0; i < 5; i++)
  1649. {
  1650. g.lblPID[i].innerText = strPid.substr(i * 6, 5);
  1651. }
  1652. if (strPid.length == 0)
  1653. g.PidEntered.style.visibility = "hidden";
  1654. else
  1655. g.PidEntered.style.visibility = "visible";
  1656. InitButtons();
  1657. g_FirstFocusElement.focus();
  1658. g_CameFromBadPkeyPage=true;
  1659. }
  1660. //////////////////////////////////////////////////////////////////////////////////////
  1661. // prodkey.htm
  1662. //////////////////////////////////////////////////////////////////////////////////////
  1663. var g_CameFromBadPkeyPage=false;
  1664. var g_LastFocusedPidBox;
  1665. var g_SelectionExistsBeforeKeyPress=null;
  1666. function PIDBox_HandleBlur() {
  1667. g_LastFocusedPidBox=g.event.srcElement;
  1668. }
  1669. function PIDBox_HandleFocus() {
  1670. g_LastFocusedPidBox=g.event.srcElement;
  1671. OnFocus();
  1672. }
  1673. function PID_LoadMe()
  1674. {
  1675. InitFrameRef();
  1676. g_FirstFocusElement = g.edtProductKey[0];
  1677. RetrievePid();
  1678. g_FirstFocusElement.focus();
  1679. var rangefocus = g_FirstFocusElement.createTextRange();
  1680. rangefocus.collapse();
  1681. rangefocus.moveStart("word", 0);
  1682. rangefocus.select();
  1683. g_TabForward = false;
  1684. g_TabBackward = false;
  1685. PID_CheckLength(false);
  1686. if(DebugObj.get_MsDebugMode) {
  1687. g.btnSkip.style.visibility="visible";
  1688. }
  1689. for (i = 0; i <= 4; i++)
  1690. {
  1691. g.edtProductKey[i].onblur=PIDBox_HandleBlur;
  1692. g.edtProductKey[i].onfocus=PIDBox_HandleFocus;
  1693. }
  1694. g_LastFocusedPidBox=g.edtProductKey[0];
  1695. InitButtons();
  1696. if(g_CameFromBadPkeyPage) {
  1697. g.edtProductKey[0].select();
  1698. g_CameFromBadPkeyPage=false;
  1699. }
  1700. }
  1701. var g_CharCode0_plus1=("0".charCodeAt(0))+1;
  1702. function KeyboardHelperClick()
  1703. {
  1704. try
  1705. {
  1706. if (g.event == null)
  1707. return;
  1708. }
  1709. catch(e)
  1710. {
  1711. return;
  1712. }
  1713. g.event.returnValue = false; // if false, cancels default action on button
  1714. g.event.cancelBubble = true;
  1715. if (g.event.srcElement.tagName == "BUTTON") {
  1716. g_LastFocusedPidBox.focus();
  1717. if(g.document.selection.type=="Text") {
  1718. g.document.execCommand("Delete");
  1719. if(g.event.srcElement.name=="{BACKSPACE}")
  1720. return;
  1721. }
  1722. if(g.event.srcElement.name=="{BACKSPACE}") {
  1723. var tr=g_LastFocusedPidBox.createTextRange();
  1724. tr.collapse(false);
  1725. tr.moveStart("character",-1);
  1726. tr.execCommand("Delete");
  1727. return;
  1728. }
  1729. var i=g_LastFocusedPidBox.id.charCodeAt(3)-g_CharCode0_plus1;
  1730. if((i<4) && (g_LastFocusedPidBox.value.length == 5) && CursorAtEndOfField(i) && (!g_SelectionExistsBeforeKeyPress)) {
  1731. TabForward(i,false);
  1732. // 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)
  1733. }
  1734. if (g_LastFocusedPidBox.value.length != 5) {
  1735. g_LastFocusedPidBox.value+=g.event.srcElement.name;
  1736. // AGENT: notify Agent of the event, NOTE: code in AgtScrpt.js.
  1737. Agent_OnProductKeyKeyboardHelper(g_LastFocusedPidBox, g.event.srcElement.name);
  1738. if (g_TabBackward) {
  1739. TabBackward(i,false);
  1740. } else if(g_TabForward) {
  1741. TabForward(i,false);
  1742. }
  1743. g_TabForward = false;
  1744. g_TabBackward = false;
  1745. }
  1746. }
  1747. }
  1748. function PID_CheckLength(KnownIncomplete)
  1749. {
  1750. // call this only if box reaches length 5 for speed?
  1751. if(KnownIncomplete) {
  1752. g.btnNext.onclick = null;
  1753. g.btnNext.disabled = true;
  1754. g.btnNext.className="buttons-disabled";
  1755. return;
  1756. }
  1757. var TotLength=g.edtProductKey[0].value.length+g.edtProductKey[1].value.length+
  1758. g.edtProductKey[2].value.length+g.edtProductKey[3].value.length+
  1759. g.edtProductKey[4].value.length;
  1760. if (TotLength == 25)
  1761. {
  1762. g.btnNext.disabled = false;
  1763. g.btnNext.className="buttons";
  1764. g.btnNext.onclick = GoNext;
  1765. }
  1766. else
  1767. {
  1768. g.btnNext.onclick = null;
  1769. g.btnNext.disabled = true;
  1770. g.btnNext.className="buttons-disabled";
  1771. }
  1772. }
  1773. function RetrievePid()
  1774. {
  1775. // retrieves the pid if avialable.
  1776. var strPid = PidObj.get_PID();
  1777. // if there is no PID then we set the
  1778. // focus to the first field
  1779. if (strPid.length == 0)
  1780. {
  1781. g.edtProductKey[0].focus();
  1782. }
  1783. // else we populate the fields with the
  1784. // sections of the PID
  1785. else
  1786. {
  1787. var re = new RegExp("(.*)-(.*)-(.*)-(.*)-(.*)","");
  1788. if(re.exec(strPid) == null) {
  1789. throw "Internal error: RegExp pattmatch failed!";
  1790. }
  1791. g.edtProductKey[0].value = RegExp.$1;
  1792. g.edtProductKey[1].value = RegExp.$2;
  1793. g.edtProductKey[2].value = RegExp.$3;
  1794. g.edtProductKey[3].value = RegExp.$4;
  1795. g.edtProductKey[4].value = RegExp.$5;
  1796. }
  1797. }
  1798. function StorePid()
  1799. {
  1800. var strPid = "";
  1801. for (var i = 0; i < 4; i++)
  1802. {
  1803. strPid += g.edtProductKey[i].value;
  1804. strPid += '-';
  1805. }
  1806. strPid += g.edtProductKey[i].value;
  1807. PidObj.set_PID(strPid);
  1808. }
  1809. var g_TabForward = false;
  1810. function TabForward(currentEdit,DoSelectAll)
  1811. {
  1812. g_TabForward = false;
  1813. if(currentEdit==4) {
  1814. // deselect any existing selection before moving focus to back button
  1815. if(g.document.selection.type!="None") {
  1816. g.document.selection.empty();
  1817. }
  1818. g.btnBack.focus();
  1819. return;
  1820. }
  1821. currentEdit++;
  1822. g.edtProductKey[currentEdit].focus();
  1823. if(DoSelectAll) {
  1824. g.edtProductKey[currentEdit].select();
  1825. return;
  1826. }
  1827. var tr = g.edtProductKey[currentEdit].createTextRange();
  1828. tr.collapse(true);
  1829. tr.moveStart("word", 0);
  1830. tr.select();
  1831. }
  1832. var g_TabBackward = false;
  1833. function TabBackward(currentEdit,DoSelectAll)
  1834. {
  1835. g_TabBackward = false;
  1836. if (currentEdit == 0) {
  1837. // deselect any existing selection before moving focus to button
  1838. if(g.document.selection.type!="None") {
  1839. g.document.selection.empty();
  1840. }
  1841. if(g.btnNext.disabled) {
  1842. g.btnBack.focus();
  1843. } else {
  1844. g.btnNext.focus();
  1845. }
  1846. return;
  1847. }
  1848. currentEdit--;
  1849. g.edtProductKey[currentEdit].focus();
  1850. if(DoSelectAll) {
  1851. g.edtProductKey[currentEdit].select();
  1852. return;
  1853. }
  1854. var tr = g.edtProductKey[currentEdit].createTextRange();
  1855. tr.collapse(false);
  1856. tr.moveStart("word", 1);
  1857. tr.select();
  1858. }
  1859. function CursorAtStartOfField(currentEdit) {
  1860. var tr = g.edtProductKey[currentEdit].createTextRange();
  1861. var tr2 = g.document.selection.createRange();
  1862. tr2.moveEnd("textedit",1);
  1863. if(tr.isEqual(tr2)){
  1864. return true;
  1865. } else {
  1866. return false;
  1867. }
  1868. }
  1869. function CursorAtEndOfField(currentEdit) {
  1870. // assumes selection is current edit field
  1871. var tr = g.edtProductKey[currentEdit].createTextRange();
  1872. var tr2 = g.document.selection.createRange();
  1873. tr2.moveStart("textedit",-1);
  1874. if(tr.isEqual(tr2)){
  1875. return true;
  1876. } else {
  1877. return false;
  1878. }
  1879. }
  1880. function IsProductIDKey(keyCode)
  1881. {
  1882. var str = String.fromCharCode(keyCode);
  1883. 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/);
  1884. return (null != result);
  1885. }
  1886. var g_keyPressKeyCode = 0;
  1887. function ProductIDPropertyChange()
  1888. {
  1889. try
  1890. {
  1891. if (g.event == null)
  1892. return;
  1893. }
  1894. catch(e)
  1895. {
  1896. return;
  1897. }
  1898. // enable Next Btn when PID is full, and automatically move to
  1899. // next/previous field when entering/deleting chars
  1900. if ("value" == g.event.propertyName) {
  1901. // find the index at which we are.
  1902. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  1903. // our g_Tab variables can be booleans instead of counts because they can
  1904. // have a max value of 1, becase there will only ever be 1 call to OnPropertyChange if the
  1905. // length of the edit is 0 or 5
  1906. switch(g.edtProductKey[i].value.length) {
  1907. case 5:
  1908. g_TabForward = (i<4); // dont tab forward if on last PID box
  1909. PID_CheckLength(false);
  1910. break;
  1911. case 4:
  1912. case 0:
  1913. case 1:
  1914. PID_CheckLength(true); //change from 25char-state could have occurred with any of these lengths
  1915. }
  1916. // see if we want to tab backward
  1917. // if pixbox is empty, and last keypress was not a pidkey (which adds a char),
  1918. // and nothing was selected.
  1919. // BUGBUG: this currently only fully works for the delete key. when backspace
  1920. // is pressed, g.document.selection.type is always "None" even if there was a selection
  1921. if ((g.edtProductKey[i].value.length == 0) && (i > 0) &&
  1922. (g_keyPressKeyCode==KeyBackSpc)&&(g_keyPressKeyCode==KeyDelete)&&
  1923. (g.document.selection.type=="None")) {
  1924. g_TabBackward = true; // IsProd check is to handle the case where they select everything then press a 2, etc.
  1925. }
  1926. }
  1927. g_keyPressKeyCode = 0;
  1928. }
  1929. //As of IE 4.0, the onkeypress event fires and can be canceled for the following keys:
  1930. //
  1931. //Letters: a - z
  1932. //Numerals: 0 - 9
  1933. //Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
  1934. //System: ESCAPE, SPACE, SHIFT
  1935. function ProductIDKeyPress()
  1936. {
  1937. try
  1938. {
  1939. if (g.event == null)
  1940. return;
  1941. }
  1942. catch(e)
  1943. {
  1944. return;
  1945. }
  1946. // BUGBUG: hack workaround: KeyBackSpc event should arrive at KeyDown handler, but it comes here instead
  1947. // I dont know why
  1948. if (g.event.keyCode == KeyBackSpc) {
  1949. ProductIDKeyDown();
  1950. return;
  1951. }
  1952. KeyCodeToUpper();
  1953. g_keyPressKeyCode = g.event.keyCode;
  1954. if (!IsProductIDKey(g_keyPressKeyCode)) {
  1955. g.event.keyCode = 0;
  1956. return;
  1957. } else {
  1958. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  1959. if((i<4) && (g.edtProductKey[i].value.length == 5) && CursorAtEndOfField(i) && (!g_SelectionExistsBeforeKeyPress)) {
  1960. TabForward(i,false);
  1961. }
  1962. }
  1963. }
  1964. //In IE 5.0, the onkeydown event fires for the following keys:
  1965. //
  1966. //Editing: DELETE, INSERT,BACKSPACE
  1967. //Function: F1 - F12
  1968. //Letters: a - z
  1969. //Navigation: HOME, END, Left Arrow, Right Arrow, Up Arrow, Down Arrow, PAGE UP, PAGE DOWN
  1970. //Numerals: 0 - 9
  1971. //Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
  1972. //System: ESCAPE, SPACE, SHIFT, TAB, SHIFT+TAB
  1973. //
  1974. // the following keys and key combinations can be canceled by specifying event.returnValue=false:
  1975. //
  1976. //Editing: BACKSPACE, DELETE
  1977. //Letters: a - z
  1978. //Navigation: PAGE UP, PAGE DOWN, END, HOME, Left Arrow, Right Arrow, Up Arrow, Down Arrow
  1979. //Numerals: 0 - 9
  1980. //Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
  1981. //System: SPACE, ESCAPE, TAB, SHIFT+TAB
  1982. function ProductIDKeyDown()
  1983. {
  1984. try
  1985. {
  1986. if (g.event == null)
  1987. return;
  1988. }
  1989. catch(e)
  1990. {
  1991. return;
  1992. }
  1993. var keyCode = g.event.keyCode;
  1994. g_SelectionExistsBeforeKeyPress=(g.document.selection.type!="None");
  1995. if(g.event.srcElement.tagName=="INPUT") {
  1996. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  1997. } else {
  1998. var i=-1;
  1999. }
  2000. switch(keyCode) {
  2001. case KeyTab:
  2002. if(g.event.srcElement == g.edtProductKey[i]) {
  2003. if(g.event.shiftKey)
  2004. TabBackward(i,true);
  2005. else TabForward(i,true);
  2006. g.event.returnValue = false;
  2007. g.event.keyCode = 0;
  2008. g.event.cancelBubble = true;
  2009. break;
  2010. }
  2011. break;
  2012. case KeyLeftArrow:
  2013. if((i>0) && CursorAtStartOfField(i)) {
  2014. TabBackward(i,false);
  2015. g.event.returnValue = false;
  2016. }
  2017. break;
  2018. case KeyRightArrow:
  2019. if((i<4) && CursorAtEndOfField(i)) {
  2020. TabForward(i,false);
  2021. g.event.returnValue = false;
  2022. }
  2023. break;
  2024. case KeyBackSpc:
  2025. case KeyDelete:
  2026. // if there is already 5 characters in a field, and the user puts the cursor in it, we want to
  2027. // fill in the next box with the character. we have to do this here because there is no propertychange,
  2028. // and keyup is too late
  2029. //if(g.edtProductKey[i].value.length == 5 && IsProductIDKey(keyCode) && g.document.selection==null)
  2030. // TabForward(i);
  2031. // cgeorges note: I enabled this feature tried it and didnt like it
  2032. ////////
  2033. // we want the delete/backspace to move the previous edit box if:
  2034. // there is 0 characters, and the user puts the cursor in it, and selection is non-null
  2035. // OR backspc && cursor is at start of field
  2036. if ((i > 0) &&
  2037. ( ((g.document.selection.type=="None") && (g.edtProductKey[i].value.length == 0))
  2038. ||((keyCode==KeyBackSpc)&& CursorAtStartOfField(i)))) {
  2039. TabBackward(i,false);
  2040. g.event.returnValue = false; // so no deletion occurs when backspace moves to prev pidbox
  2041. g.event.keyCode = 0;
  2042. }
  2043. break;
  2044. case KeyEnter:
  2045. if((g.btnNext.disabled == false)&&(g.event.srcElement!=g.btnBack)) {
  2046. g.btnNext.click();
  2047. g.event.returnValue = false;
  2048. g.event.keyCode = 0;
  2049. g.event.cancelBubble = true;
  2050. }
  2051. break;
  2052. }
  2053. }
  2054. function ProductIDKeyUp()
  2055. {
  2056. try
  2057. {
  2058. if (g.event == null)
  2059. return;
  2060. }
  2061. catch(e)
  2062. {
  2063. return;
  2064. }
  2065. if((!g_TabForward) && (!g_TabBackward)) {
  2066. return;
  2067. }
  2068. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  2069. if (g_TabBackward) {
  2070. TabBackward(i,false);
  2071. return;
  2072. } else
  2073. if(g_TabForward) {
  2074. TabForward(i,false);
  2075. }
  2076. }
  2077. // called on every mouse click into PID page body, to make sure focus never leaves PID fields
  2078. function PID_SetCorrectFocus()
  2079. {
  2080. try
  2081. {
  2082. if (g.event == null)
  2083. return;
  2084. }
  2085. catch(e)
  2086. {
  2087. return;
  2088. }
  2089. if((g.event.srcElement.tagName == "INPUT")||(g.event.srcElement.tagName == "BUTTON")) {
  2090. return;
  2091. }
  2092. // only get here if we clicked on something unexpected
  2093. for (var i = 0; i < 5; i++)
  2094. {
  2095. if (g.event.srcElement == g.edtProductKey[i])
  2096. {
  2097. return;
  2098. }
  2099. }
  2100. // if full key is entered then pass events directly to buttons without doing the stuff below
  2101. if((g.btnNext.disabled == false) && (g.btnNext.contains(g.event.srcElement) ||
  2102. g.btnBack.contains(g.event.srcElement) ||
  2103. g.btnSkip.contains(g.event.srcElement)))
  2104. return;
  2105. for (var i = 4; i >= 0; i--)
  2106. {
  2107. if (g.edtProductKey[i].value.length < 5 && g.edtProductKey[i].value.length > 0)
  2108. {
  2109. g.edtProductKey[i].focus();
  2110. var range = g.edtProductKey[i].createTextRange();
  2111. range.collapse();
  2112. range.moveStart("word", 1);
  2113. range.select();
  2114. return;
  2115. }
  2116. }
  2117. if (i < 0)
  2118. {
  2119. g.edtProductKey[0].focus();
  2120. var range = g.edtProductKey[0].createTextRange();
  2121. range.collapse();
  2122. range.moveStart("word", 0);
  2123. range.select();
  2124. return;
  2125. }
  2126. }
  2127. // END pid.htm
  2128. //////////////////////////////////////////////////////////////////////////////////////
  2129. // hndshake.htm
  2130. //////////////////////////////////////////////////////////////////////////////////////
  2131. function hndshake_OnKeyPress()
  2132. {
  2133. try
  2134. {
  2135. if (g.event == null)
  2136. return;
  2137. }
  2138. catch(e)
  2139. {
  2140. return;
  2141. }
  2142. // Treat the enter key like the next button
  2143. // since the user hasn't gone through the mouse tutorial yet.
  2144. if ((g.event.keyCode == KeyEnter) &&
  2145. (g.btnNext.disabled == false))
  2146. {
  2147. GoNext();
  2148. }
  2149. else
  2150. {
  2151. KeyPressIsValid();
  2152. }
  2153. }
  2154. function hndshake_CheckEdits()
  2155. {
  2156. try
  2157. {
  2158. if (g.event == null)
  2159. return;
  2160. }
  2161. catch(e)
  2162. {
  2163. return;
  2164. }
  2165. if (g.event.srcElement != g.edtMSNPhoneNumber)
  2166. {
  2167. hndshake_CheckEnableNextButton();
  2168. }
  2169. }
  2170. function hndshake_CheckEnableNextButton()
  2171. {
  2172. try
  2173. {
  2174. if (g.event == null)
  2175. return;
  2176. }
  2177. catch(e)
  2178. {
  2179. return;
  2180. }
  2181. if (g.edtMSNPhoneNumber.value.length)
  2182. {
  2183. g.btnNext.disabled = false;
  2184. }
  2185. else
  2186. {
  2187. g.btnNext.disabled = true;
  2188. }
  2189. InitButtons();
  2190. }
  2191. function hndshake_LoadMe()
  2192. {
  2193. InitFrameRef();
  2194. g_FirstFocusElement = g.edtMSNPhoneNumber;
  2195. hndshake_CheckEnableNextButton();
  2196. g_FirstFocusElement.focus();
  2197. }
  2198. //////////////////////////////////////////////////////////////////////////////////////
  2199. // MISC Functions
  2200. //////////////////////////////////////////////////////////////////////////////////////
  2201. // Page Navigation
  2202. // InitCKPT, PushCKPT, PopCKPT, CKPTFromVal are meant to handle the behavior for GoBack.
  2203. // We only go back to certain pages (i.e., Mouse Tutorial, Sound Check).
  2204. // And on some of the pages, we only go back if they haven't been
  2205. // completed (i.e., EULA, PID).
  2206. //
  2207. // So, we push checkpoints if we intend to all coming back to that page.
  2208. // We pop checkpoints if we no longer want to come back (e.g., we've
  2209. // completed that page.
  2210. function InitCKPT()
  2211. {
  2212. // STATUS_ISP(0) STATUS_OEM STATUS_NONE STATUS_OFF
  2213. // ------------ ------------- ------------- --------------
  2214. dnCKPT[CKPT_HWCHK] = new CheckPoint("", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
  2215. dnCKPT[CKPT_WELCOME] = new CheckPoint("setup\\welcome.htm", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
  2216. dnCKPT[CKPT__MODULE_] = new
  2217. CheckPoint("html\\_MODULE_\\_MODULE_.htm", SNDX_WELCOME,
  2218. SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
  2219. dnCKPT[CKPT_MOUSETUT1] = new CheckPoint("html\\mouse\\mouse.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  2220. dnCKPT[CKPT_IMETUTORIAL] = new CheckPoint("html\\IME\\IMETut1.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  2221. dnCKPT[CKPT_OEMHW] = new CheckPoint("html\\oemhw\\oemhw.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  2222. dnCKPT[CKPT_REGION_KEYBD] = new CheckPoint("setup\\keybd.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  2223. dnCKPT[CKPT_REGKB_COMMIT] = new CheckPoint("setup\\keybdcmt.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  2224. dnCKPT[CKPT_TIMEZONE] = new CheckPoint("setup\\timezone.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
  2225. dnCKPT[CKPT_EULA] = new CheckPoint("setup\\neweula.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  2226. dnCKPT[CKPT_EULA_DECLINE] = new CheckPoint("setup\\badeula.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  2227. dnCKPT[CKPT_PRODUCTKEY] = new CheckPoint("setup\\prodkey.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  2228. dnCKPT[CKPT_BADPRODUCTKEY] = new CheckPoint("setup\\badpkey.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
  2229. dnCKPT[CKPT_ICSCHOICE] = new CheckPoint("setup\\ics.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  2230. dnCKPT[CKPT_REGISTER1] = new CheckPoint("setup\\reg1.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  2231. dnCKPT[CKPT_REGISTER3] = new CheckPoint("setup\\reg3.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  2232. dnCKPT[CKPT_REGDIAL] = new CheckPoint("setup\\drdyoem.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
  2233. dnCKPT[CKPT_ISPSIGNUP] = new CheckPoint("setup\\isp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  2234. dnCKPT[CKPT_MIGLIST] = new CheckPoint("setup\\miglist.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  2235. dnCKPT[CKPT_ISPDIAL] = new CheckPoint("setup\\drdyisp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  2236. dnCKPT[CKPT_REFDIAL] = new CheckPoint("setup\\drdyref.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  2237. dnCKPT[CKPT_MIGDIAL] = new CheckPoint("setup\\drdymig.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  2238. dnCKPT[CKPT_OEMISP] = new CheckPoint("html\\ispsgnup\\ispsgnup.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  2239. dnCKPT[CKPT_OEMCUST] = new CheckPoint("html\\oemcust\\oemcust.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
  2240. dnCKPT[CKPT_DONE] = new CheckPoint("setup\\fini.htm", SNDX_FINI, SNDX_FINI, SNDX_FINI, SNDX_FINI);
  2241. PopCKPT();
  2242. // init simple navigation mappings
  2243. g_SimpleNavMap= new ActiveXObject("Scripting.Dictionary");
  2244. g_SimpleNavMap.CompareMode = CompareModeText;
  2245. InitSimpleNavMap_MouseTut();
  2246. _MODULE__InitSimpleNavMap();
  2247. g_Last_MODULE_Page = _MODULE_GetLastPage();
  2248. }
  2249. function PushCKPT(ckpt)
  2250. {
  2251. if (ckpt > 0 && ckpt < CKPT_MAX)
  2252. {
  2253. var tos = 0;
  2254. try
  2255. {
  2256. tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  2257. }
  2258. catch (e) {}
  2259. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString(), ckpt);
  2260. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, ++tos);
  2261. g_CurrentCKPT = ckpt;
  2262. }
  2263. }
  2264. function PopCKPT(ckptCheck)
  2265. {
  2266. var ckpt = 0;
  2267. try
  2268. {
  2269. var tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  2270. if (tos > 0)
  2271. {
  2272. ckpt = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, (tos - 1).toString());
  2273. if (null == ckptCheck || ckpt == ckptCheck)
  2274. {
  2275. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, --tos);
  2276. ApiObj.DeleteRegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString());
  2277. }
  2278. }
  2279. }
  2280. catch (e) {}
  2281. if (ckpt > 0 && ckpt < CKPT_MAX)
  2282. {
  2283. g_CurrentCKPT = ckpt;
  2284. }
  2285. else
  2286. g_CurrentCKPT = null;
  2287. }
  2288. function URLFromCKPT(ckpt)
  2289. {
  2290. var str = "";
  2291. if (ckpt > 0 && ckpt < CKPT_MAX)
  2292. {
  2293. str = dnCKPT[ckpt].strURL;
  2294. }
  2295. return str;
  2296. }
  2297. function IndexFromCKPT(ckpt, status)
  2298. {
  2299. var index = 0;
  2300. if (ckpt > 0 && ckpt < CKPT_MAX)
  2301. {
  2302. var checkpoint = dnCKPT[ckpt];
  2303. index = checkpoint.rgindex[status];
  2304. }
  2305. return index;
  2306. }
  2307. function IsLocalFile()
  2308. {
  2309. try
  2310. {
  2311. return (-1 != g.location.protocol.indexOf("file"));
  2312. }
  2313. catch (e)
  2314. {
  2315. return false;
  2316. }
  2317. }
  2318. //////////////////////////////////////////////////////////////////////////////////////
  2319. // public navigation APIs
  2320. //////////////////////////////////////////////////////////////////////////////////////
  2321. function SetBack(strURL)
  2322. {
  2323. g_OEMAddBackURL = strURL;
  2324. }
  2325. // this handles the user's "Skip" requests
  2326. function GoCancel(ckpt)
  2327. {
  2328. try
  2329. {
  2330. if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
  2331. return;
  2332. }
  2333. catch(e)
  2334. {
  2335. return;
  2336. }
  2337. DisableAllButtons();
  2338. switch (g_CurrentCKPT)
  2339. {
  2340. case CKPT_HWCHK:
  2341. GoNavigate(CKPT_WELCOME);
  2342. break;
  2343. case CKPT_REGION_KEYBD:
  2344. // need to avoid handling any existing input info, which GoNext does
  2345. GoNavigate(CKPT_TIMEZONE);
  2346. break;
  2347. case CKPT_MOUSETUT1:
  2348. SimpleNavNext(g_LastMouseTutPage); // go to ckpt after last mouse tut page
  2349. break;
  2350. case CKPT_PRODUCTKEY:
  2351. // skip button only exists in debug mode. lets you skip PID page
  2352. PopCKPT(CKPT_PRODUCTKEY); // make sure we go back to reg1.htm
  2353. if ( StatusObj.get_Status(MS_REGISTRATION) ||
  2354. StatusObj.get_Status(OEM_REGISTRATION) ||
  2355. window.external.get_RegStatus )
  2356. GoNavigate(CKPT_ISPSIGNUP);
  2357. else
  2358. GoNavigate(CKPT_REGISTER1);
  2359. break;
  2360. // We do not allow User to skip for CKPT_ICSCHOICE.
  2361. case CKPT_REGISTER3:
  2362. Reg3SaveSettings(); // save field settings in case we return to page
  2363. GoNavigate(CKPT_ISPSIGNUP);
  2364. break;
  2365. case CKPT_ISPSIGNUP:
  2366. GoNavigate(CKPT_OEMCUST);
  2367. break;
  2368. case CKPT_MIGLIST:
  2369. // When skip on the referral dialing, go to finish
  2370. GoNavigate(CKPT_OEMCUST);
  2371. break;
  2372. case CKPT_REGDIAL:
  2373. GoNavigate(CKPT_ISPSIGNUP);
  2374. break;
  2375. case CKPT_REFDIAL:
  2376. case CKPT_MIGDIAL:
  2377. case CKPT_ISPDIAL:
  2378. // When skip on the referral dialing, go to finish
  2379. GoNavigate(CKPT_OEMCUST);
  2380. break;
  2381. case CKPT__MODULE_:
  2382. SimpleNavNext(g_Last_MODULE_Page);
  2383. break;
  2384. default:
  2385. GoNext();
  2386. break;
  2387. }
  2388. }
  2389. function GoBack(ckpt)
  2390. {
  2391. try
  2392. {
  2393. if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
  2394. return;
  2395. }
  2396. catch(e)
  2397. {
  2398. return;
  2399. }
  2400. DisableAllButtons();
  2401. if(g_CurrentCKPT == g_DialCKPT)
  2402. ResetDialing();
  2403. else if(g_CurrentCKPT == CKPT_ISPSIGNUP)
  2404. ResetDialing();
  2405. else if(g_CurrentCKPT == CKPT_REGISTER3)
  2406. Reg3SaveSettings(); // save field settings in case we return to page
  2407. else if(g_CurrentCKPT == CKPT_PRODUCTKEY)
  2408. StorePid();
  2409. {
  2410. var ckptPrevious = g_CurrentCKPT;
  2411. PopCKPT();
  2412. if (ckptPrevious == g_CurrentCKPT)
  2413. {
  2414. // This handles the case where the current page pushed itself on the stack.
  2415. PopCKPT();
  2416. }
  2417. if ((g_CurrentCKPT == CKPT_ICSCHOICE) && !(window.external.IsIcsAvailable()))
  2418. {
  2419. g_CurrentCKPT = ckptPrevious; // we remove the ICS page from the navigation stream if ICS is no longer available.
  2420. StatusObj.set_Status(ICS_FOR_OOBE, false);
  2421. GoBack();
  2422. }
  2423. else if (g_CurrentCKPT > 0 && g_CurrentCKPT < CKPT_MAX)
  2424. {
  2425. GoNavigate(g_CurrentCKPT);
  2426. }
  2427. }
  2428. }
  2429. function StatusNavigate()
  2430. {
  2431. var iMove = IndexFromCKPT(g_CurrentCKPT, g_status) - window.external.get_StatusIndex;
  2432. while (iMove > 0)
  2433. {
  2434. window.external.MoveNext();
  2435. --iMove;
  2436. }
  2437. while (iMove < 0)
  2438. {
  2439. window.external.MovePrevious();
  2440. ++iMove;
  2441. }
  2442. }
  2443. ////////////////////////////////////////////////////////////////////
  2444. // Required API for USB mouse and/or keyboard checks
  2445. ////////////////////////////////////////////////////////////////////
  2446. function OnDeviceArrival(nDeviceType)
  2447. {
  2448. if ((CKPT_HWCHK == g_CurrentCKPT) && !g_bAnimationRunning)
  2449. {
  2450. var bKeyboardPresent = window.external.CheckKeyboard();
  2451. var bMousePresent = window.external.CheckMouse();
  2452. if ((0 == bKeyboardPresent) && (0 == bMousePresent))
  2453. {
  2454. g.navigate("setup\\nousbkm.htm");
  2455. }
  2456. else if (0 == bKeyboardPresent)
  2457. {
  2458. g.navigate("setup\\nousbkbd.htm");
  2459. }
  2460. else if (0 == bMousePresent)
  2461. {
  2462. g.navigate("setup\\nousbms.htm");
  2463. }
  2464. else
  2465. {
  2466. // Unregister all device notification so that
  2467. // script will not be notifed of any device arrival
  2468. GoNavigate(CKPT_WELCOME);
  2469. }
  2470. }
  2471. }
  2472. ////////////////////////////////////////////////////////////////////
  2473. // DON'T MUCK WITH THE POSITIONING OF THE CASES IN THE SWITCHS BELOW WITHOUT CONSIDERING FALL-THROUGH
  2474. ////////////////////////////////////////////////////////////////////
  2475. function GoNavigate(ckptGoHere)
  2476. {
  2477. try
  2478. {
  2479. if (g_bStartup == false)
  2480. {
  2481. if (IsLocalFile())
  2482. {
  2483. if (g.event != null)
  2484. {
  2485. g.event.returnValue = false;
  2486. g.event.cancelBubble = true;
  2487. }
  2488. }
  2489. }
  2490. else
  2491. g_bStartup = false;
  2492. }
  2493. catch(e)
  2494. {
  2495. return;
  2496. }
  2497. switch (ckptGoHere)
  2498. {
  2499. case CKPT_HWCHK:
  2500. trace("GoNavigate: CKPT_HWCHK");
  2501. PushCKPT(CKPT_HWCHK);
  2502. var bKeyboardPresent = window.external.CheckKeyboard();
  2503. var bMousePresent = window.external.CheckMouse();
  2504. if ((0 == bKeyboardPresent) || (0 == bMousePresent)) {
  2505. ScreenFrame.style.visibility = "visible";
  2506. ScreenFrame.style.display = "none";
  2507. if ((0 == bKeyboardPresent) && (0 == bMousePresent))
  2508. {
  2509. g.navigate("setup\\nousbkm.htm");
  2510. }
  2511. else if (0 == bKeyboardPresent)
  2512. {
  2513. g.navigate("setup\\nousbkbd.htm");
  2514. }
  2515. else { // (0 == bMousePresent)
  2516. g.navigate("setup\\nousbms.htm");
  2517. }
  2518. window.external.ShowOOBEWindow();
  2519. if((g_RunAnimInitVal>0) && (g_bNeedtoRunAnimation || (g_RunAnimInitVal==99))) {
  2520. g_bAnimationRunning = true;
  2521. MovieFrame.style.display="inline"; // start movie
  2522. g_bNeedtoRunAnimation=false;
  2523. g_RunAnimInitVal=1; // reset from 99, which will trigger second running
  2524. }
  2525. ScreenFrame.style.display = "inline";
  2526. break;
  2527. }
  2528. // fall through...
  2529. case CKPT_WELCOME:
  2530. trace("GoNavigate: CKPT_WELCOME");
  2531. if (!window.external.GetNoWelcomeFinish())
  2532. {
  2533. PushCKPT(CKPT_WELCOME); //BUGBUG do we want to do this?
  2534. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_WELCOME));
  2535. break;
  2536. } else {
  2537. window.external.ShowOOBEWindow(); // should be needed for NoWelcome case if USB pages are not displayed
  2538. }
  2539. // fall through...
  2540. case CKPT_MOUSETUT1:
  2541. trace("GoNavigate: CKPT_MOUSETUT1");
  2542. var MT_INIstr=DirObj.get_DoMouseTutorial();
  2543. if ((MT_INIstr.length>0) && (MT_INIstr!="0"))
  2544. {
  2545. PushCKPT(CKPT_MOUSETUT1);
  2546. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_MOUSETUT1));
  2547. break;
  2548. }
  2549. // fall through...
  2550. case CKPT_IMETUTORIAL:
  2551. trace("GoNavigate: CKPT_IMETUTORIAL");
  2552. if ((1 == DirObj.get_DoIMETutorial()) && g_IMEExists)
  2553. {
  2554. PushCKPT(CKPT_IMETUTORIAL);
  2555. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_IMETUTORIAL));
  2556. break;
  2557. }
  2558. // fall through...
  2559. case CKPT_OEMHW:
  2560. trace("GoNavigate: CKPT_OEMHW");
  2561. if (1 == DirObj.get_DoOEMHardwareCheck())
  2562. {
  2563. PushCKPT(CKPT_OEMHW);
  2564. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_OEMHW));
  2565. break;
  2566. }
  2567. // fall through...
  2568. case CKPT_REGION_KEYBD:
  2569. trace("GoNavigate: CKPT_REGION_KEYBD");
  2570. if (1 == DirObj.get_DoRegionalKeyboard())
  2571. {
  2572. PushCKPT(CKPT_REGION_KEYBD);
  2573. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_REGION_KEYBD));
  2574. break;
  2575. }
  2576. // fall through...
  2577. case CKPT_TIMEZONE:
  2578. trace("GoNavigate: CKPT_TIMEZONE");
  2579. var TimeZonewasSet=SysClockObj.get_TimeZonewasPreset();
  2580. // only show timezone page if preset TimeZoneValue does not exist and TimeZone=1,
  2581. // or if TimeZoneValue is invalid
  2582. if ((!TimeZonewasSet &&
  2583. ((1 == DirObj.get_DoTimeZone()) || (DirObj.get_TimeZoneValue() != ""))))
  2584. {
  2585. PushCKPT(CKPT_TIMEZONE);
  2586. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_TIMEZONE));
  2587. break;
  2588. }
  2589. // fall through...
  2590. case CKPT_EULA:
  2591. trace("GoNavigate: CKPT_EULA");
  2592. if (null == EulaObj)
  2593. {
  2594. EulaObj = new Object;
  2595. EulaObj = window.external.Eula;
  2596. }
  2597. // skip EULA if user has already accepted in OOBE mode
  2598. if (!EulaObj.get_EULAAcceptance)
  2599. {
  2600. PushCKPT(CKPT_EULA);
  2601. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_EULA));
  2602. break;
  2603. }
  2604. // fall through...
  2605. case CKPT_PRODUCTKEY:
  2606. trace("GoNavigate: CKPT_PRODUCTKEY");
  2607. if (null == PidObj)
  2608. {
  2609. PidObj = new Object;
  2610. PidObj = window.external.ProductID;
  2611. }
  2612. // skips over PID if it's already validated?
  2613. if (0 == PidObj.get_PID.length || !PidObj.ValidatePID)
  2614. {
  2615. PushCKPT(CKPT_PRODUCTKEY); //this sets g_CurrentCKPT=CPKT_PRODUCTKEY
  2616. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_PRODUCTKEY));
  2617. break;
  2618. }
  2619. // fall through...
  2620. case CKPT_ICSCHOICE:
  2621. {
  2622. trace("GoNavigate: CKPT_ICSCHOICE");
  2623. if ( g_status != STATUS_OFF ) {
  2624. if ( window.external.IsIcsAvailable() )
  2625. {
  2626. PushCKPT(CKPT_ICSCHOICE);
  2627. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_ICSCHOICE));
  2628. break;
  2629. }
  2630. else
  2631. {
  2632. if ( StatusObj.get_Status(MS_REGISTRATION) ||
  2633. StatusObj.get_Status(OEM_REGISTRATION) ||
  2634. window.external.get_RegStatus() )
  2635. {
  2636. GoNavigate(CKPT_ISPSIGNUP);
  2637. break;
  2638. }
  2639. else
  2640. {
  2641. GoNavigate(CKPT_REGISTER1);
  2642. break;
  2643. }
  2644. }
  2645. }
  2646. // fall through here for OFFLINE status
  2647. }
  2648. case CKPT_REGISTER1:
  2649. trace("GoNavigate: CKPT_REGISTER1");
  2650. if (g_status != STATUS_OFF && 1 != StatusObj.get_Status(MS_REGISTRATION) && 1 != StatusObj.get_Status(OEM_REGISTRATION) && !window.external.get_RegStatus())
  2651. {
  2652. PushCKPT(CKPT_REGISTER1);
  2653. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_REGISTER1));
  2654. break;
  2655. }
  2656. // fall through...
  2657. case CKPT_ISPSIGNUP:
  2658. trace("GoNavigate: CKPT_ISPSIGNUP");
  2659. if (g_status == STATUS_ISP)
  2660. {
  2661. PushCKPT(CKPT_ISPSIGNUP);
  2662. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_ISPSIGNUP));
  2663. break;
  2664. }
  2665. // fall through...
  2666. case CKPT_OEMISP: // PreConfig case
  2667. trace("GoNavigate: CKPT_OEMISP");
  2668. if ((g_status == STATUS_OEM) &&
  2669. !window.external.GetNoIspPreconfig())
  2670. {
  2671. PushCKPT(CKPT_OEMISP);
  2672. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_OEMISP));
  2673. break;
  2674. }
  2675. // fall through...
  2676. case CKPT_OEMCUST:
  2677. trace("GoNavigate: CKPT_OEMCUST");
  2678. // Next line of code added by TandyT to support special ISP signup process commands
  2679. // Calls to function in agtcore.js
  2680. Agent_TurnOffISPSpecialCommands();
  2681. ResetDialing();
  2682. if (1 == DirObj.get_OEMCust)
  2683. {
  2684. PushCKPT(CKPT_OEMCUST);
  2685. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_OEMCUST));
  2686. break;
  2687. }
  2688. // fall through...
  2689. case CKPT__MODULE_:
  2690. trace("GoNavigate: CKPT__MODULE_");
  2691. PushCKPT(CKPT__MODULE_);
  2692. g.navigate(g_OOBEDir + URLFromCKPT(CKPT__MODULE_));
  2693. break;
  2694. case CKPT_DONE:
  2695. trace("GoNavigate: CKPT_DONE");
  2696. ResetDialing();
  2697. if (!window.external.GetNoWelcomeFinish())
  2698. {
  2699. PushCKPT(CKPT_DONE);
  2700. g.navigate(g_OOBEDir + URLFromCKPT(CKPT_DONE));
  2701. }
  2702. else
  2703. {
  2704. PushCKPT(CKPT_DONE);
  2705. GoNext();
  2706. }
  2707. break;
  2708. default:
  2709. PushCKPT(ckptGoHere); // sets g_CurrentCKPT = ckptGoHere;
  2710. g.navigate(g_OOBEDir + URLFromCKPT(ckptGoHere));
  2711. break;
  2712. }
  2713. StatusNavigate();
  2714. // AGENT: notify Agent, code in AgtCore.js
  2715. Agent_OnNavigate();
  2716. }
  2717. function GoNext()
  2718. {
  2719. try
  2720. {
  2721. if (IsLocalFile() && g.event == null)
  2722. return;
  2723. }
  2724. catch(e)
  2725. {
  2726. return;
  2727. }
  2728. DisableAllButtons();
  2729. switch (g_CurrentCKPT)
  2730. {
  2731. case CKPT_HWCHK:
  2732. GoNavigate(CKPT_HWCHK);
  2733. break;
  2734. case CKPT_WELCOME:
  2735. ScreenFrame.style.filter=null;
  2736. GoNavigate(CKPT__MODULE_);
  2737. break;
  2738. case CKPT__MODULE_:
  2739. GoNavigate(CKPT_MOUSETUT1);
  2740. break;
  2741. case CKPT_MOUSETUT1:
  2742. GoNavigate(CKPT_IMETUTORIAL);
  2743. break;
  2744. case CKPT_IMETUTORIAL:
  2745. GoNavigate(CKPT_OEMHW);
  2746. break;
  2747. case CKPT_OEMHW:
  2748. if (true == StatusObj.get_Status(LANGUAGECOMPLETED))
  2749. {
  2750. GoNavigate(CKPT_TIMEZONE);
  2751. }
  2752. else
  2753. GoNavigate(CKPT_REGION_KEYBD);
  2754. break;
  2755. case CKPT_REGION_KEYBD:
  2756. // setting these to null fixes hanging bug where user clicks on selmenus
  2757. // during execution of SaveSettings
  2758. g.selKeyboard.disabled = true;
  2759. g.selKeyboard.onchange = null;
  2760. g.selRegion.disabled = true;
  2761. g.selRegion.onchange = null;
  2762. g.selLang.disabled = true;
  2763. g.selLang.onchange = null;
  2764. g.document.body.style.cursor = "wait";
  2765. LangObj.set_RegionIndex(g.selRegion.selectedIndex)
  2766. LangObj.set_LangIndex(g.selLang.selectedIndex);
  2767. LangObj.set_KeyboardLayoutIndex(g.selKeyboard.selectedIndex);
  2768. // must always call SaveSettings() since apparently there is
  2769. // no way to know current language setting of machine
  2770. LangObj.SaveSettings();
  2771. if (LANGUAGE_REBOOT_NOW == LangObj.get_RebootState())
  2772. GoNavigate(CKPT_REGKB_COMMIT);
  2773. else
  2774. GoNavigate(CKPT_TIMEZONE);
  2775. g.document.body.style.cursor = "default";
  2776. break;
  2777. case CKPT_REGKB_COMMIT:
  2778. // "Next" for this page indicates a restart
  2779. PopCKPT(CKPT_REGKB_COMMIT); // Don't want this in our history anymore after reboot
  2780. PopCKPT(CKPT_REGION_KEYBD);
  2781. PushCKPT(CKPT_TIMEZONE); // so when we come back after reboot we are on the mouse tut page
  2782. StatusObj.set_Status(LANGUAGECOMPLETED, true);
  2783. window.external.PowerDown(1); // reboot
  2784. break;
  2785. case CKPT_TIMEZONE:
  2786. SysClockObj.set_AutoDaylight(g.daylight.checked);
  2787. SysClockObj.set_TimeZoneIdx(g.selTimeZone.selectedIndex);
  2788. GoNavigate(CKPT_EULA);
  2789. break;
  2790. case CKPT_EULA:
  2791. if (EulaObj.get_EULAAcceptance)
  2792. {
  2793. PopCKPT();
  2794. GoNavigate(CKPT_PRODUCTKEY);
  2795. }
  2796. else
  2797. GoNavigate(CKPT_EULA_DECLINE);
  2798. break;
  2799. case CKPT_EULA_DECLINE:
  2800. PopCKPT();
  2801. PushCKPT(CKPT_EULA); // go back to main eula page, not this one
  2802. window.external.PowerDown(0); // shut down
  2803. break;
  2804. case CKPT_PRODUCTKEY:
  2805. StorePid();
  2806. if (PidObj.get_PID.length != 0 && PidObj.ValidatePID())
  2807. {
  2808. PopCKPT(CKPT_PRODUCTKEY);
  2809. GoNavigate(CKPT_ICSCHOICE);
  2810. }
  2811. else
  2812. {
  2813. GoNavigate(CKPT_BADPRODUCTKEY);
  2814. }
  2815. break;
  2816. case CKPT_BADPRODUCTKEY:
  2817. PopCKPT(); // go back to prodkey page on restart, not this one
  2818. PushCKPT(CKPT_PRODUCTKEY); // does this leave 2 pid pgs on stack?
  2819. window.external.PowerDown(0); // shut down
  2820. break;
  2821. case CKPT_ICSCHOICE:
  2822. // we update only the USER's preference. this does NOT mean that
  2823. // ICS will ALWAYS be available!!
  2824. if (g.radio_ChooseIcs.checked)
  2825. {
  2826. StatusObj.set_Status(ICS_FOR_OOBE, true);
  2827. window.external.TriggerIcsCallback(true);
  2828. }
  2829. else
  2830. {
  2831. window.external.TriggerIcsCallback(false);
  2832. StatusObj.set_Status(ICS_FOR_OOBE, false);
  2833. }
  2834. // the decision below was previously made at the Product Key page. Not any more.
  2835. if ( StatusObj.get_Status(MS_REGISTRATION) ||
  2836. StatusObj.get_Status(OEM_REGISTRATION) ||
  2837. window.external.get_RegStatus() )
  2838. {
  2839. GoNavigate(CKPT_ISPSIGNUP);
  2840. }
  2841. else
  2842. {
  2843. GoNavigate(CKPT_REGISTER1);
  2844. }
  2845. break;
  2846. case CKPT_REGISTER1:
  2847. if (g.radioRegNeedPP.checked)
  2848. GoNavigate(CKPT_REGISTER3);
  2849. else {
  2850. // (g.radioRegLater.checked)
  2851. GoNavigate(CKPT_ISPSIGNUP);
  2852. }
  2853. break;
  2854. case CKPT_REGISTER3:
  2855. if(VerifyReg3Fields())
  2856. {
  2857. Reg3SaveSettings();
  2858. if ( window.external.IsIcsAvailable() && StatusObj.get_Status(ICS_FOR_OOBE) )
  2859. {
  2860. IcsConnect(ICS_CONN_TYPE_REG);
  2861. }
  2862. else
  2863. {
  2864. GoNavigate(CKPT_REGDIAL);
  2865. }
  2866. }
  2867. break;
  2868. case CKPT_ISPSIGNUP:
  2869. if (g.radioGetNewISP.checked)
  2870. {
  2871. StatusObj.set_Status(ICS_FOR_INTERNET, false);
  2872. if ((window.external.IsIcsAvailable() && StatusObj.get_Status(ICS_FOR_OOBE)) ||
  2873. (!window.external.IsIcsAvailable() && window.external.CheckOnlineStatus && window.external.CheckStayConnected("msobe.isp")) )
  2874. {
  2875. PushCKPT(CKPT_ISPDIAL);
  2876. if (window.external.IsIcsAvailable() && StatusObj.get_Status(ICS_FOR_OOBE))
  2877. {
  2878. IcsConnect(ICS_CONN_TYPE_ISP);
  2879. }
  2880. else
  2881. {
  2882. window.external.Connect(CONNECTED_ISP_SIGNUP, "msobe.isp");
  2883. }
  2884. }
  2885. else
  2886. {
  2887. window.external.Hangup();
  2888. GoNavigate(CKPT_ISPDIAL); // Getting Online
  2889. }
  2890. }
  2891. else if (g.radioMigrateISP.checked)
  2892. {
  2893. StatusObj.set_Status(ICS_FOR_INTERNET, false);
  2894. if (true == StatusObj.get_Status(REFERALDLCOMPLETED))
  2895. {
  2896. GoNavigate(CKPT_MIGLIST);
  2897. }
  2898. else
  2899. {
  2900. if ((window.external.IsIcsAvailable() && StatusObj.get_Status(ICS_FOR_OOBE)) ||
  2901. (window.external.CheckOnlineStatus && window.external.CheckStayConnected("migrate.isp")) )
  2902. {
  2903. g_bTapiDone = false;
  2904. GoNavigate(CKPT_REFDIAL);
  2905. }
  2906. else
  2907. {
  2908. window.external.Hangup();
  2909. GoNavigate(CKPT_REFDIAL); // Online
  2910. }
  2911. }
  2912. }
  2913. else if ( g.radioSelectICS.checked ) {
  2914. StatusObj.set_Status(ICS_FOR_INTERNET, true);
  2915. window.external.Hangup(); // this does nothing for LAN (ICS) connections.
  2916. GoNavigate(CKPT_DONE);
  2917. } else {
  2918. StatusObj.set_Status(ICS_FOR_INTERNET, false);
  2919. GoCancel(); // skip checked
  2920. }
  2921. break;
  2922. case CKPT_ISPDIAL:
  2923. GoNavigate(CKPT_OEMCUST);
  2924. break;
  2925. case CKPT_REGDIAL:
  2926. GoNavigate(CKPT_ISPSIGNUP);
  2927. break;
  2928. case CKPT_OEMISP:
  2929. GoNavigate(CKPT_OEMCUST);
  2930. break;
  2931. case CKPT_OEMCUST:
  2932. GoNavigate(CKPT_DONE);
  2933. break;
  2934. case CKPT_DONE:
  2935. var finish = window.external.Finish();
  2936. if (finish == FINISH_OK) // Finish was successful, so we execute script until our window goes away
  2937. {
  2938. Agent_OnFinish();
  2939. break;
  2940. }
  2941. else
  2942. {
  2943. // allow ourselves to go back to those pages if they gave us bad information
  2944. if (finish & FINISH_BAD_EULA)
  2945. {
  2946. if (null == EulaObj)
  2947. {
  2948. EulaObj = new Object;
  2949. EulaObj = window.external.Eula;
  2950. }
  2951. EulaObj.set_EULAAcceptance(false);
  2952. }
  2953. // BUGBUG nuke stack here
  2954. if (finish & FINISH_REBOOT) // language changed but didn't want to reboot earlier, so reboot now
  2955. {
  2956. window.external.PowerDown(1);
  2957. Agent_OnFinish();
  2958. }
  2959. else if (finish & FINISH_BAD_STAMP) // setupX "stamp" of user.exe failed, we should nav to the earliest page in the flow...
  2960. GoNavigate(CKPT_WELCOME); // BUGBUG Bad stamp is really an internal error, should notify user?
  2961. else if (finish & FINISH_BAD_EULA)
  2962. GoNavigate(CKPT_EULA);
  2963. else if (finish & FINISH_BAD_PID)
  2964. GoNavigate(CKPT_PRODUCTKEY);
  2965. }
  2966. break;
  2967. default:
  2968. // BUGBUG should we remove the default altogether?
  2969. GoNavigate(Need_to_handle_this_CKPT_in_GoNext);
  2970. break;
  2971. }
  2972. }
  2973. // BUGBUG temporary until MSN changes code
  2974. function GoOffline()
  2975. {
  2976. GoNext();
  2977. }
  2978. function GetCurrentPageName() {
  2979. var re = new RegExp("\\\\([^\\\\]+)$");
  2980. re.exec(g.window.location.pathname);
  2981. return RegExp.$1;
  2982. }
  2983. // these handle next/back navigation for non-checkpoint pages
  2984. function SimpleNavBack()
  2985. {
  2986. g.window.history.back();
  2987. }
  2988. /*
  2989. This version of SimpleNavNext contains the workaround for IE 90257. not enabled yet
  2990. another part of 90527 fix is in InitButtons()
  2991. */
  2992. function SimpleNavNext(CurPage) // original version that does not fix IE 90257
  2993. {
  2994. if(CurPage==null) {
  2995. CurPage=GetCurrentPageName();
  2996. }
  2997. var NextPage=g_SimpleNavMap.Item(CurPage);
  2998. // do specific per-page stuff
  2999. switch(CurPage) {
  3000. case g_LastMouseTutPage:
  3001. GoNext(); // move on to next real checkpnt
  3002. return;
  3003. }
  3004. g.navigate(NextPage);
  3005. }
  3006. // Description: Disable all the buttons
  3007. // Used to prevent script error caused by
  3008. // double clicking or rapid clicking
  3009. // of two different buttons. E.g. when someone click
  3010. // next and back quickly.
  3011. //
  3012. function DisableAllButtons()
  3013. {
  3014. try
  3015. {
  3016. if(g.btnNext!=null)
  3017. {
  3018. g.btnNext.onclick=null;
  3019. }
  3020. } catch (e) {}
  3021. try
  3022. {
  3023. if(g.btnBack!=null)
  3024. {
  3025. g.btnBack.onclick=null;
  3026. }
  3027. } catch (e) {}
  3028. try
  3029. {
  3030. if(g.btnSkip!=null)
  3031. {
  3032. g.btnSkip.onclick=null;
  3033. }
  3034. } catch (e) {}
  3035. try
  3036. {
  3037. g.btnNext.disabled=true;
  3038. g.btnNext.className="buttons-disabled";
  3039. }
  3040. catch(e) {}
  3041. try
  3042. {
  3043. g.btnBack.disabled=true;
  3044. g.btnBack.className="buttons-disabled";
  3045. }
  3046. catch(e) {}
  3047. try
  3048. {
  3049. g.btnSkip.disabled=true;
  3050. g.btnSkip.className="buttons-disabled";
  3051. }
  3052. catch(e) {}
  3053. }
  3054. function SetBackgroundImg(SetExt)
  3055. {
  3056. g.document.body.style.backgroundPosition='top left';
  3057. if (SetExt != null)
  3058. {
  3059. if(window.top.screen.width>800)
  3060. {g.document.body.style.backgroundImage = 'url(../../images/watermrk.gif)';}
  3061. else
  3062. {g.document.body.style.backgroundImage = 'url(../../images/watrmrk2.gif)';}
  3063. }
  3064. else
  3065. {
  3066. if(window.top.screen.width>800)
  3067. {g.document.body.style.backgroundImage = 'url(../images/watermrk.gif)';}
  3068. else
  3069. {g.document.body.style.backgroundImage = 'url(../images/watrmrk2.gif)';}
  3070. }
  3071. }
  3072. // Function: InitFrameRef
  3073. // Description: Sets up globals to point to buttons
  3074. // Since the buttons exist on the child frame,
  3075. // we want to have quick access to them without
  3076. // going through the collections.
  3077. // WARNING: Call this function at the top of XXX_LoadMe()
  3078. //
  3079. function InitFrameRef(ExternalModule)
  3080. {
  3081. // Static control over online pages
  3082. if ( window.external.IsIcsAvailable() && window.parent.StatusObj.get_Status(ICS_FOR_OOBE) )
  3083. {
  3084. // do not modify any IFRAMEs
  3085. }
  3086. else
  3087. {
  3088. try
  3089. {
  3090. document.frames("connDelay").frameElement.style.display="none";
  3091. document.frames("connDelay").frameElement.style.zIndex=-1;
  3092. }
  3093. catch (e)
  3094. {
  3095. }
  3096. }
  3097. g_LastButtonText = null;
  3098. g_FirstFocusElement = null;
  3099. g_LastKeyDown = null;
  3100. g = document.frames("msoobeMain");
  3101. if (ExternalModule != null)
  3102. {
  3103. SetBackgroundImg('Ext');
  3104. }
  3105. else
  3106. {
  3107. SetBackgroundImg();
  3108. }
  3109. try
  3110. {
  3111. if (g != null)
  3112. {
  3113. if(g.btnNext!=null)
  3114. g.btnNext.disabled=false;
  3115. if(g.btnBack!=null)
  3116. g.btnBack.disabled=false;
  3117. if(g.btnSkip!=null)
  3118. g.btnSkip.disabled=false;
  3119. }
  3120. g.document.body.onkeydown = OnKeyDown;
  3121. g.document.body.style.cursor = 'auto';
  3122. }
  3123. catch(e){}
  3124. }
  3125. function HideButtons(buttons)
  3126. {
  3127. if (null != g.btnBack && (buttons & HIDE_BACK))
  3128. {
  3129. g.btnBack.Hide = true;
  3130. }
  3131. if (null != g.btnNext && (buttons & HIDE_NEXT))
  3132. {
  3133. g.btnNext.Hide = true;
  3134. }
  3135. if (null != g.spanCancel && (buttons & HIDE_CANCEL))
  3136. {
  3137. g.btnSkip.Hide = true;
  3138. }
  3139. /*
  3140. if (null != g.spanRestore && (buttons & HIDE_RESTORE))
  3141. {
  3142. g.btnRestore.Hide = true;
  3143. }
  3144. */
  3145. }
  3146. function HandleButtonMouseOver()
  3147. {
  3148. if((!this.disabled)&&(this.tagName=="BUTTON"))
  3149. this.className="buttons-hover";
  3150. }
  3151. function HandleButtonMouseOut()
  3152. {
  3153. if((!this.disabled)&&(this.tagName=="BUTTON"))
  3154. this.className="buttons";
  3155. }
  3156. function InitButtons(SpecialArg)
  3157. {
  3158. if(g.btnSkip!=null) {
  3159. g.btnSkip.onmouseover = HandleButtonMouseOver;
  3160. g.btnSkip.onmouseout = HandleButtonMouseOut;
  3161. if(!g.btnSkip.disabled) {
  3162. g.btnSkip.onclick = GoCancel;
  3163. // dont enable onfocus,onblur handlers until issues in 88615 are resolved
  3164. // g.btnSkip.onfocus = HandleButtonMouseOver;
  3165. // g.btnSkip.onblur = HandleButtonMouseOut;
  3166. g.btnSkip.className="buttons";
  3167. } else {
  3168. g.btnSkip.className="buttons-disabled";
  3169. }
  3170. }
  3171. if(g.btnNext != null) {
  3172. g.btnNext.onmouseover = HandleButtonMouseOver;
  3173. g.btnNext.onmouseout = HandleButtonMouseOut;
  3174. if(g.btnNext.disabled == false) {
  3175. if(SpecialArg==null) {
  3176. g.btnNext.onclick = GoNext;
  3177. } else {
  3178. g.btnNext.onclick = SimpleNavNext;
  3179. }
  3180. g.btnNext.className="buttons";
  3181. } else {
  3182. g.btnNext.className="buttons-disabled";
  3183. }
  3184. }
  3185. if(g.btnBack != null) {
  3186. g.btnBack.onmouseover = HandleButtonMouseOver;
  3187. g.btnBack.onmouseout = HandleButtonMouseOut;
  3188. if(g.btnBack.disabled == false) {
  3189. if(SpecialArg==null) {
  3190. g.btnBack.onclick = GoBack;
  3191. } else {
  3192. g.btnBack.onclick = SimpleNavBack;
  3193. }
  3194. g.btnBack.className="buttons";
  3195. } else {
  3196. g.btnBack.className="buttons-disabled";
  3197. }
  3198. }
  3199. }
  3200. var g_LastKeyDown = null;
  3201. function OnKeyDown()
  3202. {
  3203. try
  3204. {
  3205. if (IsLocalFile() && g.event == null)
  3206. return;
  3207. }
  3208. catch(e)
  3209. {
  3210. return;
  3211. }
  3212. if (g.event.altKey)
  3213. {
  3214. g_LastKeyDown = String.fromCharCode(g.event.keyCode);
  3215. if (g_LastKeyDown != null)
  3216. g_LastKeyDown = g_LastKeyDown.toUpperCase();
  3217. }
  3218. else
  3219. g_LastKeyDown = null;
  3220. // AGENT: pass keydown to Agent, NOTE: code in AgtCore.js
  3221. Agent_OnKeyDown(g.event.srcElement);
  3222. }
  3223. // AGENT: SelectClick is used by Agent
  3224. function OnSelectClick() {
  3225. Agent_OnSelectClick(g.event.srcElement);
  3226. }
  3227. // AGENT: OnClick is used by Agent
  3228. function OnClick()
  3229. {
  3230. Agent_OnElementClick(g.event.srcElement);
  3231. }
  3232. // AGENT: Focus functions are used by Agent
  3233. function OnFocus() {
  3234. // Put other code here that needs access to the focus event
  3235. Agent_OnFocus(g.event.srcElement);
  3236. }
  3237. // VALIDATION ROUTINES
  3238. function KeyPressIsNumeric()
  3239. {
  3240. try
  3241. {
  3242. if (IsLocalFile() && g.event == null)
  3243. return;
  3244. }
  3245. catch(e)
  3246. {
  3247. return;
  3248. }
  3249. if (!IsNumeric(g.event.keyCode))
  3250. {
  3251. g.event.keyCode = 0;
  3252. g.event.returnValue = false;
  3253. }
  3254. }
  3255. function IsNumeric(keyCode)
  3256. {
  3257. if ((keyCode >= 48/*0*/) && (keyCode <= 57/*9*/))
  3258. return true;
  3259. else
  3260. return false;
  3261. }
  3262. function IsSpecial(keyCode)
  3263. {
  3264. // BUGBUG DISABLED FOR BETA
  3265. /*
  3266. var bFound = false;
  3267. var iPosition = 0;
  3268. for (;iPosition < g_SpecialChars.length; iPosition++)
  3269. {
  3270. if (g_SpecialChars.charCodeAt(iPosition) == keyCode)
  3271. {
  3272. bFound = true;
  3273. break;
  3274. }
  3275. }
  3276. return bFound;
  3277. */
  3278. return false;
  3279. }
  3280. function KeyPressIsValid()
  3281. {
  3282. try
  3283. {
  3284. if (IsLocalFile() && g.event == null)
  3285. return;
  3286. }
  3287. catch(e)
  3288. {
  3289. return;
  3290. }
  3291. if (!IsAlpha(g.event.keyCode) &&
  3292. !IsSpecial(g.event.keyCode) &&
  3293. !IsNumeric(g.event.keyCode))
  3294. {
  3295. g.event.keyCode = 0;
  3296. g.event.returnValue = false;
  3297. }
  3298. }
  3299. function KeyPressIsAlpha()
  3300. {
  3301. try
  3302. {
  3303. if (IsLocalFile() && g.event == null)
  3304. return;
  3305. }
  3306. catch(e)
  3307. {
  3308. return;
  3309. }
  3310. if (!IsAlpha(g.event.keyCode))
  3311. {
  3312. g.event.keyCode = 0;
  3313. g.event.returnValue = false;
  3314. }
  3315. }
  3316. function IsAlpha(keyCode)
  3317. {
  3318. // BUGBUG DISABLED FOR BETA
  3319. /*
  3320. var strKeyCode = String.fromCharCode(keyCode);
  3321. var re1 = new RegExp("\w"); // BUGBUG: should \ be escaped?
  3322. var re2 = new RegExp("\D"); // BUGBUG: should \ be escaped?
  3323. strKeyCode.match(re1);
  3324. strKeyCode.match(re2);
  3325. //return ((strKeyCode.match(re1) != null) && (strKeyCode.match(re2) != null));
  3326. */
  3327. // if ((keyCode >= 97/*a*/ && keyCode <= 122/*z*/) ||
  3328. // (keyCode >= 65/*A*/ && keyCode <= 90 /*Z*/))
  3329. return true;
  3330. // else
  3331. // return false;
  3332. }
  3333. function NumberOfSpaces(strValue)
  3334. {
  3335. /*
  3336. var NASexp = RegExp("\s"); // BUGBUG: should \ be escaped?
  3337. var result = strValue.match(NASexp);
  3338. return ((result == null) || (result.length != strValue.length));
  3339. */
  3340. var iSpaceCount = 0;
  3341. for (iPosition = 0; iPosition < strValue.length; iPosition ++)
  3342. {
  3343. if (strValue.charAt(iPosition) == ' ')
  3344. {
  3345. iSpaceCount++;
  3346. }
  3347. }
  3348. return iSpaceCount;
  3349. }
  3350. function KeyCodeToUpper()
  3351. {
  3352. var strKeyCode = String.fromCharCode(g.event.keyCode);
  3353. strKeyCode = strKeyCode.toUpperCase();
  3354. g.event.keyCode = strKeyCode.charCodeAt(0);
  3355. }
  3356. // END VALIDATION ROUTINES
  3357. function FlashPlayerInstalled()
  3358. {
  3359. var fReturn = false;
  3360. try
  3361. {
  3362. // Correlate the PROGID and CLSID sections of the registry, then determine
  3363. // whether the inproc server exists.
  3364. //
  3365. // Trailing backslashes on registry paths are required to read default
  3366. // value.
  3367. //
  3368. strProgId = WshShell.RegRead("HKCR\\CLSID\\"
  3369. + CLSID_FLASH_PLAYER
  3370. + "\\VersionIndependentProgID\\");
  3371. if ( PROGID_FLASH_PLAYER == strProgId
  3372. && CLSID_FLASH_PLAYER == WshShell.RegRead( "HKCR\\"
  3373. + strProgId
  3374. + "\\CLSID\\")
  3375. )
  3376. {
  3377. strInprocServer32 = WshShell.RegRead( "HKCR\\CLSID\\"
  3378. + CLSID_FLASH_PLAYER
  3379. + "\\InprocServer32\\"
  3380. );
  3381. fReturn = FileSystemObj.FileExists(strInprocServer32);
  3382. }
  3383. }
  3384. catch (err)
  3385. {
  3386. // if an exception is thrown, something grave is amiss. It is safer to
  3387. // assume player is not installed.
  3388. //
  3389. fReturn = false;
  3390. }
  3391. return fReturn;
  3392. }
  3393. function InitApplication()
  3394. {
  3395. OOBEDocBody.style.cursor = "wait"; // show "wait" cursor while initializing
  3396. g_bStartup = true;
  3397. InitFrameRef();
  3398. MSLogoImg.src='images/stbg'+((window.top.screen.width < 1024) ? '800.png' : '1024.png');
  3399. // reset all parameters that change if screen width > 800
  3400. if(window.top.screen.width > 800) {
  3401. StatusBackgndColor.style.width = 230;
  3402. spnStatDividerBar.style.left = StatusBackgndColor.style.width;
  3403. statpaneCell.style.width = parseInt(StatusBackgndColor.style.width) + parseInt(spnStatDividerBar.style.width);
  3404. spnStatusPane.style.width = statpaneCell.style.width;
  3405. spnStatusPane.style.top = 170;
  3406. spnMainFrame.style.width = parseInt(window.top.screen.width) - parseInt(statpaneCell.style.width); // 784 for 1024
  3407. document.frames("ifrmConnDelay").frameElement.style.left=statpaneCell.style.width;
  3408. spnOEMLogo.style.left = 304;
  3409. spnAssist.style.top = 590;
  3410. spnAssist.style.width = StatusBackgndColor.style.width;
  3411. }
  3412. if ( (1 == DirObj.get_Offline() || window.external.CheckDialReady() != ERR_COMM_NO_ERROR) )
  3413. {
  3414. g_status = STATUS_OFF;
  3415. StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
  3416. window.external.LoadStatusItems("No Modem");
  3417. }
  3418. else
  3419. {
  3420. if ( StatusObj.get_Status(ICS_FOR_OOBE) )
  3421. {
  3422. window.external.TriggerIcsCallback(true);
  3423. }
  3424. else
  3425. {
  3426. window.external.TriggerIcsCallback(false);
  3427. }
  3428. var str = DirObj.get_ISPSignup().toUpperCase();
  3429. if ("MSN" == str)
  3430. {
  3431. g_status = STATUS_ISP;
  3432. if ( window.external.get_RegStatus() )
  3433. window.external.LoadStatusItems("MSN(No Reg)");
  3434. else
  3435. window.external.LoadStatusItems("MSN");
  3436. }
  3437. else if ("OFFLINE" == str)
  3438. {
  3439. g_status = STATUS_ISP;
  3440. if ( window.external.get_RegStatus() )
  3441. window.external.LoadStatusItems("Offline(No Reg)");
  3442. else
  3443. window.external.LoadStatusItems("Offline");
  3444. }
  3445. else if ("PRECONFIG" == str)
  3446. {
  3447. g_status = STATUS_OEM;
  3448. if ( window.external.get_RegStatus() )
  3449. window.external.LoadStatusItems("Preconfig(No Reg)");
  3450. else
  3451. window.external.LoadStatusItems("Preconfig");
  3452. }
  3453. else
  3454. {
  3455. g_status = STATUS_NONE;
  3456. StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
  3457. if ( window.external.get_RegStatus() )
  3458. window.external.LoadStatusItems("None(No Reg)");
  3459. else
  3460. window.external.LoadStatusItems("None");
  3461. }
  3462. }
  3463. InitCKPT();
  3464. // IME handling
  3465. g_IMEExists = FileSystemObj.FileExists(ApiObj.get_SystemDirectory() + "\\OOBE\\HTML\\IME\\IMETut1.htm");
  3466. Agent_Init();
  3467. spnPage.style.visibility = "visible";
  3468. if (null == g_CurrentCKPT)
  3469. {
  3470. // run only if CKPT regkey didn't exist on start
  3471. g_bNeedtoRunAnimation =
  3472. FlashPlayerInstalled()
  3473. && FileSystemObj.FileExists(g_OOBEDirPath+"images\\intro.swf");
  3474. GoNavigate(CKPT_HWCHK);
  3475. }
  3476. else
  3477. {
  3478. g_bNeedtoRunWelcomeFadeIn = false;
  3479. OOBEDocBody.style.cursor = "default";
  3480. ScreenFrame.style.visibility = "visible";
  3481. if(g_CurrentCKPT>CKPT_WELCOME) {
  3482. //if we're not running init sequence, just show the window now
  3483. //
  3484. ScreenFrame.style.display = "inline";
  3485. window.external.ShowOOBEWindow();
  3486. }
  3487. GoNavigate(g_CurrentCKPT);
  3488. }
  3489. }
  3490. function ProcessQueuedEvents() {
  3491. // flush all WM_ events in windows queue.
  3492. // workaround for IE 103880, 'white flashes in statpane & button on page unload'
  3493. window.external.ProcessQueuedEvents();
  3494. }
  3495. // Update status pane and navigate
  3496. function navigatetoPrivacy(PrivPage)
  3497. {
  3498. if(g_CurrentCKPT == CKPT_REGISTER3) {
  3499. Reg3SaveSettings();
  3500. }
  3501. if(PrivPage == "MS")
  3502. g.navigate("prvcyMS.htm");
  3503. else g.navigate("OEMpriv.htm");
  3504. }
  3505. var g_iISPRadioActive=1;
  3506. var g_bRadioMigrateISP=false;
  3507. //////////////////////////////////////////////////////////////////////////////////////
  3508. // isp.htm
  3509. //////////////////////////////////////////////////////////////////////////////////////
  3510. function IspLoadMe()
  3511. {
  3512. InitFrameRef();
  3513. if(g_iISPRadioActive==1) {
  3514. g_FirstFocusElement = g.radioGetNewISP;
  3515. } else if(g_iISPRadioActive==2) {
  3516. g_FirstFocusElement = g.radioMigrateISP;
  3517. } else if(g_iISPRadioActive==3) {
  3518. g_FirstFocusElement = g.radioSelectICS;
  3519. } else {
  3520. g_FirstFocusElement = g.radioSkip;
  3521. }
  3522. IspToggleAllRadioButtons(true);
  3523. g.ISP_ICS.style.display = "none";
  3524. g.radioSelectICS.style.display = "none";
  3525. if ( window.external.IsIcsAvailable() )
  3526. {
  3527. g.ISP_ICS.style.display = "inline";
  3528. g.radioSelectICS.style.display = "inline";
  3529. }
  3530. InitButtons();
  3531. g_FirstFocusElement.checked=true;
  3532. g_FirstFocusElement.focus();
  3533. }
  3534. function IspUnLoad()
  3535. {
  3536. try
  3537. {
  3538. if(g.radioGetNewISP.checked) {
  3539. g_iISPRadioActive=1;
  3540. } else if(g.radioMigrateISP.checked) {
  3541. g_iISPRadioActive=2;
  3542. } else if(g.radioSelectICS.checked) {
  3543. g_iISPRadioActive=3;
  3544. } else {
  3545. g_iISPRadioActive=4;
  3546. }
  3547. g_bRadioMigrateISP = (g.event.srcElement==g.radioMigrateISP);
  3548. }
  3549. catch (e) {}
  3550. }
  3551. function IspToggleAllRadioButtons(bSwitch)
  3552. {
  3553. try
  3554. {
  3555. g.radioGetNewISP.disabled = !bSwitch;
  3556. g.ISP_New.disabled = !bSwitch;
  3557. g.radioMigrateISP.disabled = !bSwitch;
  3558. g.ISP_Migrate.disabled = !bSwitch;
  3559. g.radioSelectICS.disabled = !bSwitch;
  3560. g.ISP_ICS.disabled = !bSwitch;
  3561. g.radioSkip.disabled = !bSwitch;
  3562. g.skipISP.disabled = !bSwitch;
  3563. }
  3564. catch (e)
  3565. {
  3566. }
  3567. }
  3568. // Place holder for the ISP page function
  3569. function RegRadioClicked()
  3570. {
  3571. g.btnNext.disabled = false;
  3572. InitButtons();
  3573. }
  3574. /////////////////////////////////////////////////////////////////////////////////////
  3575. // ics.htm
  3576. /////////////////////////////////////////////////////////////////////////////////////
  3577. function IcsLoadMe()
  3578. {
  3579. InitFrameRef();
  3580. InitButtons();
  3581. g_FirstFocusElement = g.radio_ChooseIcs;
  3582. g_FirstFocusElement.focus();
  3583. }
  3584. function IcsRadioClicked()
  3585. {
  3586. g.btnNext.disabled = false;
  3587. InitButtons();
  3588. }
  3589. ////////////////////////////////////////////////////////////////////
  3590. // Do NOT REMOVE THIS FUNCTION< THIS WILL GET CALLED WHEN F1 is
  3591. // PRESSED.
  3592. ////////////////////////////////////////////////////////////////////
  3593. function OnHelp()
  3594. {
  3595. // Invoke MSAgent
  3596. Agent_OnUserRequestAssistant();
  3597. }
  3598. </script>
  3599. <SCRIPT LANGUAGE=VBScript>
  3600. <!-- BUGBUG: Can this be changed to jscript?? -->
  3601. <!-- Flash calls this VBScript fn when movie exits -->
  3602. Sub IntroAnimation_FSCommand(ByVal command, ByVal args)
  3603. call PostMovieWelcomeInit()
  3604. end sub
  3605. </SCRIPT>
  3606. </HEAD>
  3607. <BODY ID=OOBEDocBody leftMargin=0 DIR=LTR onload="InitApplication();" scroll=no tabIndex=-1 topMargin=0 language=javascript onhelp="Agent_OnUserRequestAssistant();" style="background-color: white">
  3608. <SPAN ID=junkspan style="height:2px;width:2px;background-color:black;z-index:99;display:none"></SPAN>
  3609. <SPAN ID=MovieFrame style="position:absolute; height:100%;width:100%;background-color:white;z-index:99999;display:none">
  3610. <OBJECT alt=Welcome classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  3611. codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
  3612. ID=IntroAnimation WIDTH=100% HEIGHT=100%>
  3613. <PARAM NAME=movie VALUE="images\intro.swf">
  3614. <PARAM NAME=loop VALUE=false>
  3615. <PARAM NAME=menu VALUE=false>
  3616. <PARAM NAME=quality VALUE=best>
  3617. <PARAM NAME=bgcolor VALUE=#FFFFFF>
  3618. </OBJECT>
  3619. </SPAN>
  3620. <SPAN ID=ScreenFrame style="height:100%; width:100%; position:absolute; display:none">
  3621. <IMG ID=MSLogoImg style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:10;" alt="">
  3622. <SPAN ID=StatusBackgndColor style="width:180px; height:100%; background-color:#4F7FB5; position:absolute; top:0px; left:0px; z-index:-20">
  3623. </SPAN> <!-- height adjusted in InitApp-->
  3624. <SPAN id=spnStatDividerBar style="left:180px; height:100%; background-color:#80A2CF; position:absolute; width:10px; top:0px; z-index:6">
  3625. </SPAN>
  3626. <!-- two cell table contains statpane, mainbody-->
  3627. <TABLE cellpadding=0 cellspacing=0 style="z-index:6; position:absolute; left:0px; top:0px; width:100%;height:100%">
  3628. <TR>
  3629. <TD ID=statpaneCell style="width:190px; height:100%;z-index:6">
  3630. <SPAN id=spnStatusPane style="position:absolute;LEFT: 0px; TOP: 131px; z-index:66; width: 190px;">
  3631. <IFRAME id=ifrmStatusPane frameBorder=no scrolling=no style="width:100%; height:300px; background-color: #4F7FB5" name=StatusPane src="res://MSOBSHEL.DLL/STATPANE_RESOURCE" tabIndex=-1 ></IFRAME>
  3632. </SPAN>
  3633. </TD>
  3634. <TD style="height:100%" align=center>
  3635. <SPAN id=spnPage style="VISIBILITY: hidden;z-index:4;" tabIndex=-1> <!--hidden so users dont see initial load-->
  3636. <SPAN id=spnMainFrame style="width: 610px; height:100%" tabIndex=-1 >
  3637. <IFRAME id=ifrmMainFrame frameBorder=no scrolling=no width="100%" height="100%" name=msoobeMain tabIndex=0></IFRAME> <!-- tabindex=0 because we dont want IFRAME to get focus -->
  3638. <IFRAME id=ifrmConnDelay frameBorder=no style="display:none; position:absolute; z-index:-1; left: 190px;" scrolling=no width="100%" height="100%" name=connDelay tabIndex=-1 src="setup/ISPWait.htm"></IFRAME>
  3639. </SPAN>
  3640. </SPAN>
  3641. </TD></TR>
  3642. </TABLE>
  3643. <SPAN id=spnOEMLogo style="z-index:10;POSITION: absolute; TOP: 0px; HEIGHT: 48px; width:100%; LEFT: 243px; background-position: top left; background-repeat: no-repeat; background-image: url(images/oemlogo.gif);">
  3644. </SPAN>
  3645. <SPAN id=spnAssist class="emphasis-lesser" style="visibility:hidden; background-color:#4F7FB5; POSITION: absolute; LEFT: 0px; HEIGHT: 160px; TOP: 410px; WIDTH: 180px; z-index:9">
  3646. <TABLE width="95%" cellspacing=0 cellpadding=0 align=center class="emphasis-lesser" style="text-align:center;color:white;">
  3647. <TR><TD align=center>
  3648. <IMG align=middle id=AssistImg alt=help border=0 src="images/merlin.png"
  3649. style="visibility:hidden;z-index:9" language=javascript
  3650. onclick="Agent_OnUserRequestAssistant()"><BR>
  3651. </TD></TR>
  3652. <TR><TD ID=MerlinStr1>If you want</TD></TR>
  3653. <TR><TD ID=MerlinStr2>assistance, click Merlin</TD></TR>
  3654. <TR><TD ID=MerlinStr3>or press F1.</TD></TR>
  3655. </TABLE>
  3656. </SPAN>
  3657. </SPAN>
  3658. </BODY>
  3659. </HTML>