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.

3743 lines
98 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Microsoft Out-of-Box Experience</TITLE>
  4. <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <LINK REL="stylesheet" TYPE="text/css" HREF="actsetup\aregstyl.css">
  6. <script language=jscript src="oobeutil.js"></script>
  7. <script language=jscript src="dialmgr.js"></script>
  8. <script language=jscript src="error.js"></script>
  9. <script language=jscript src="icsmgr.js"></script>
  10. <script language=jscript>
  11. // This is intended to hold all the script needed
  12. // in the default & offline OOBE HTML pages.
  13. //
  14. // We want to separate the layout (HTML) from the script.
  15. // At the same time, it's helpful to have all the code
  16. // in one place to make it easier to understand the flow
  17. // from page to page.
  18. // Status location constants
  19. var STATUS_MSN = 0;
  20. var STATUS_OEM = 1;
  21. var STATUS_NONE = 2;
  22. var STATUS_OFF = 3;
  23. var STATUS_MAX = 4;
  24. var SNDX_WELCOME = 0;
  25. var SNDX_MSN_ISP = 1;
  26. var SNDX_MSN_REG = 2;
  27. var SNDX_MSN_FINISH = 3;
  28. var SNDX_OEM_REG = 1;
  29. var SNDX_OEM_ISP = 2;
  30. var SNDX_OEM_FINISH = 3;
  31. var SNDX_NONE_REG = 1;
  32. var SNDX_NONE_FINISH = 2;
  33. var SNDX_OFF_EULA = 1;
  34. var SNDX_OFF_PID = 2;
  35. var SNDX_OFF_FINISH = 3;
  36. function CheckPoint(strURL, i1, i2, i3, i4)
  37. {
  38. this.strURL = strURL;
  39. this.rgindex = new Array(STATUS_MAX);
  40. this.rgindex[STATUS_MSN] = i1;
  41. this.rgindex[STATUS_OEM] = i2;
  42. this.rgindex[STATUS_NONE] = i3;
  43. this.rgindex[STATUS_OFF] = i4;
  44. }
  45. // Types of dialing using ISP files. e.g. Dial to registration, ISP, referral server
  46. var CONNECTED_REFFERAL = 1;
  47. var CONNECTED_ISP_SIGNUP = 2;
  48. var CONNECTED_ISP_MIGRATE = 3;
  49. var CONNECTED_REGISTRATION = 4;
  50. // Checkpoint constants
  51. var CKPT_ACTIV = 1;
  52. var CKPT_ACTDONE = 2;
  53. var CKPT_ACTIVERR = 3;
  54. var CKPT_ACTIVSVC = 4;
  55. var CKPT_REGISTER1 = 5;
  56. var CKPT_REGISTER3 = 6;
  57. var CKPT_ACTCONN = 7;
  58. var CKPT_ACTLAN = 8;
  59. var CKPT_REGDIAL = 9;
  60. var CKPT_ACT_MSG = 10;
  61. var CKPT_DONE = 11;
  62. var CKPT_MAX = 12; // ALWAYS set this to be the biggest value!
  63. var CKPT_ISPDIAL = CKPT_MAX;
  64. var CKPT_REFDIAL = CKPT_MAX;
  65. var CKPT_MIGDIAL = CKPT_MAX;
  66. var CKPT_ISPSIGNUP = CKPT_DONE;
  67. var dnCKPT = new Array(CKPT_MAX);
  68. // Checkpoint breadcrumbs
  69. var g_CurrentCKPT = null;
  70. var g_DialCKPT = null;
  71. var HKEY_LOCAL_MACHINE = 0x80000002;
  72. var OOBE_MAIN_REG_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OOBE";
  73. var CKPT_REG_KEY = "\\CKPT";
  74. var TOS_REG_VALUE = "TOS";
  75. // CheckDialReady errors
  76. var ERR_COMM_NO_ERROR = 0;
  77. var ERR_COMM_OOBE_COMP_MISSING = 1;
  78. var ERR_COMM_UNKNOWN = 2; // Unknow error, check input parameters
  79. var ERR_COMM_NOMODEM = 3; // There is no modem installed
  80. var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
  81. var ERR_COMM_ISDN = 5;
  82. var ERR_COMM_PHONE_AND_ISDN = 6;
  83. // Dialing errors. Look at raserror.h for details
  84. var DERR_DIALTONE = 680;
  85. var DERR_BUSY = 676;
  86. var DERR_VOICEANSWER = 677;
  87. var DERR_NOANSWER = 678;
  88. var DERR_NO_CARRIER = 679;
  89. var DERR_HARDWARE_FAILURE = 630; // modem turned off
  90. var DERR_PORT_ALREADY_OPEN = 602; // procomm/hypertrm/RAS has COM port
  91. var DERR_PORT_OR_DEVICE = 692; // got this when hypertrm had the device open -- jmazner
  92. var DERR_PPP_TIMEOUT = 718;
  93. var DERR_REMOTE_DISCONNECT = 629; // Connection interrupted
  94. // Finish errors
  95. var FINISH_OK = 0x00000000;
  96. var FINISH_REBOOT = 0x00000001;
  97. var FINISH_BAD_PID = 0x00000002;
  98. var FINISH_BAD_EULA = 0x00000004;
  99. var FINISH_BAD_STAMP = 0x00000008;
  100. // keycode consts
  101. var KeyEsc = 0x1B;
  102. var KeyEnter = 0xD;
  103. var KeyBackSpc = 0x8;
  104. var KeyDelete = 0x2E;
  105. var KeyTab = 0x9;
  106. var KeyDwnArrow = 0x28;
  107. var KeyUpArrow = 0x26;
  108. var KeyLeftArrow = 0x25;
  109. var KeyRightArrow = 0x27;
  110. // Language reboot return codes
  111. var LANGUAGE_REBOOT_NEVER = 0;
  112. var LANGUAGE_REBOOT_NOW = 1;
  113. var LANGUAGE_REBOOT_END = 2;
  114. // on-the-fly button hiding
  115. var HIDE_BACK = 0x0001;
  116. var HIDE_NEXT = 0x0002;
  117. var HIDE_CANCEL = 0x0004;
  118. var HIDE_RESTORE = 0x0008;
  119. // BUGBUG temp GUIDs
  120. var NOLAUNCHISPSIGNUP = "{C37D92A5-CA34-11d2-B71C-00C04F794977}";
  121. var MSNCOMPLETED = "{1C0A22F2-CB6B-11d2-B544-00A0C949DA70}";
  122. // window.external object caches
  123. var TapiObj = null;
  124. var InfoObj = null;
  125. var EulaObj = null;
  126. var LangObj = null;
  127. var PidObj = null;
  128. var StatusObj = null;
  129. var DirObj = null;
  130. var ApiObj = null;
  131. var RegisterObj = null;
  132. // general globals and status
  133. var g_strISPFile = "";
  134. var g_bStartup;
  135. var g_LastButtonText = null;
  136. var g_FirstFocusElement = null;
  137. var g = null;
  138. var g_SpecialChars = ".'-` ";
  139. var g_bRedial = false;
  140. var g_LineProblem = 0;
  141. var g_bFirstServerError = true;
  142. var g_status = STATUS_OFF;
  143. var g_ServerErrorCount = 0;
  144. var g_IMEExists = false;
  145. var g_OEMAddBackURL = "";
  146. var g_DialingAvailableInCountry = true;
  147. var g_ModalDialogUp = false;
  148. var MS_REGISTRATION = "{1C956940-8617-11D3-8B99-00A0C91E7F3C}";
  149. var OEM_REGISTRATION = "{ECD24360-B210-11D3-8B99-00A0C91E7F3C}";
  150. var g_bTapiDone = false;
  151. var g_OEMNameStr=window.external.Signup.get_OEMName();
  152. var g_Activation_Install_ID = "";
  153. var g_PID_ENTERED_ONRECORD = "";
  154. var g_Activation_CODE_ENTERED = "";
  155. var g_Activation_CODE_ENTERED_status = "";
  156. var g_InitAutodial = false;
  157. var g_CameFromFirstPage = false;
  158. var L_CheckConnectivity_Text = "Checking for connectivity...";
  159. var L_BlankTitle_Text = "";
  160. var ACTIVATION_TIMEOUT = 1800000; // 30 minutes
  161. // Mandatory Initialization Code
  162. if (null == ApiObj)
  163. {
  164. ApiObj = new Object;
  165. ApiObj = window.external.API;
  166. }
  167. if (null == StatusObj)
  168. {
  169. StatusObj = new Object;
  170. StatusObj = window.external.Status;
  171. }
  172. if (null == DirObj)
  173. {
  174. DirObj = new Object;
  175. DirObj = window.external.Directions;
  176. }
  177. if (null == InfoObj)
  178. {
  179. InfoObj = new Object;
  180. InfoObj = window.external.UserInfo;
  181. }
  182. if (null == RegisterObj)
  183. {
  184. RegisterObj = new Object;
  185. RegisterObj = window.external.Register;
  186. }
  187. if (null == TapiObj)
  188. {
  189. TapiObj = new Object;
  190. TapiObj = window.external.Tapi;
  191. }
  192. if (null == LangObj)
  193. {
  194. LangObj = new Object;
  195. LangObj = window.external.Language;
  196. }
  197. // END Initialization Code
  198. // AGENT: SelectClick is used by Agent
  199. function OnSelectClick() {}
  200. // AGENT: OnClick is used by Agent
  201. function OnClick() {}
  202. // AGENT: Focus functions are used by Agent
  203. function OnFocus() {}
  204. // these handle next/back navigation for non-checkpoint pages
  205. function ShowSimpleNavBack()
  206. {
  207. g.window.history.back();
  208. SetTimerShowIFrame(100);
  209. }
  210. function SimpleNavBack()
  211. {
  212. ShowIFrame('False');
  213. window.setTimeout("ShowSimpleNavBack();",500);
  214. }
  215. function HandleTextAreaFocus() {
  216. g.event.srcElement.style.borderStyle="ridge";
  217. }
  218. function HandleTextAreaBlur() {
  219. g.event.srcElement.style.borderStyle="";
  220. }
  221. function CheckContrastMode()
  222. {
  223. try
  224. {
  225. var InHighContrastMode = window.external.InHighContrastMode();
  226. }
  227. catch(e)
  228. {
  229. var L_HighContrastMode1_Text = "InHighContrastMode API not available";
  230. alert(L_HighContrastMode1_Text);
  231. InHighContrastMode = false;
  232. }
  233. if (InHighContrastMode)
  234. {
  235. g.deskstyle1.disabled = true;
  236. g.deskstyle2.disabled = false;
  237. }
  238. }
  239. function GetPageTitle()
  240. {
  241. Span_WPA_MainTitle.innerText = g.Title_Text.innerText;
  242. }
  243. //////////////////////////////////////////////////////////////////////////////////////
  244. // actdone.htm
  245. //////////////////////////////////////////////////////////////////////////////////////
  246. function Actdone_LoadMe()
  247. {
  248. InitFrameRef();
  249. GetPageTitle();
  250. CheckContrastMode();
  251. g_FirstFocusElement = g.btnQuit;
  252. InitButtons();
  253. if (g_FirstFocusElement != null)
  254. window.setTimeout("DoFocus();",1000);
  255. }
  256. //////////////////////////////////////////////////////////////////////////////////////
  257. // activ.htm
  258. //////////////////////////////////////////////////////////////////////////////////////
  259. function DoFocus()
  260. {
  261. //
  262. // During the transition between pages, the pages are hidden and focus()
  263. // will fail. If this happens we try again after a short delay.
  264. //
  265. try
  266. {
  267. if (g_FirstFocusElement != null)
  268. {
  269. g_FirstFocusElement.focus();
  270. }
  271. }
  272. catch(e)
  273. {
  274. window.setTimeout("DoFocus();",1000);
  275. }
  276. }
  277. function Activ_BtnTelephoneHandler()
  278. {
  279. GoNavigate(CKPT_ACTIVSVC);
  280. }
  281. var g_ActivationRadioSticky = null;
  282. function Activation_LoadMe()
  283. {
  284. g_CameFromFirstPage = false;
  285. InitFrameRef();
  286. GetPageTitle();
  287. CheckContrastMode();
  288. if (g_ActivationRadioSticky == null)
  289. g.btnNext.disabled = true;
  290. else if (g_ActivationRadioSticky == 1)
  291. g.rb_act_1.checked = true;
  292. else if (g_ActivationRadioSticky == 2)
  293. g.rb_act_2.checked = true;
  294. else if (g_ActivationRadioSticky == 3)
  295. g.rb_act_3.checked = true;
  296. if (g_ActivationRadioSticky != null)
  297. {
  298. WPA_ActivationRadioClicked();
  299. }
  300. var ndaysleft = ""
  301. try
  302. {
  303. ndaysleft = window.external.GetActivationDaysLeft();
  304. }
  305. catch(e)
  306. {
  307. ndaysleft = "0";
  308. }
  309. var L_LogMeOff_Text = "N<u>o</u>, log me off";
  310. if (ndaysleft == "0")
  311. {
  312. g.act_par01_ZeroDays.style.display = "inline";
  313. g.act_spn3.innerHTML = L_LogMeOff_Text;
  314. if (window.external.HasTablet())
  315. {
  316. g.act_par03_Tablet.style.display = "inline";
  317. }
  318. }
  319. else
  320. {
  321. g.act_par01_HaveDays.style.display = "inline";
  322. g.act_par02_HaveDays.style.display = "inline";
  323. g.NumberDaysLeft1.innerText = ndaysleft;
  324. }
  325. InitButtons();
  326. if (g_ActivationRadioSticky == null)
  327. g_FirstFocusElement = g.document.body;
  328. else
  329. g_FirstFocusElement = g.btnNext;
  330. window.setTimeout("DoFocus();",1000);
  331. }
  332. function WPA_ActivationRadioClicked()
  333. {
  334. if (g.rb_act_1.checked)
  335. g_ActivationRadioSticky = 1;
  336. else if (g.rb_act_2.checked)
  337. g_ActivationRadioSticky = 2;
  338. else
  339. g_ActivationRadioSticky = 3;
  340. if (g.btnNext.disabled)
  341. {
  342. g.btnNext.disabled = false;
  343. g.btnNext.onclick = GoNext;
  344. g.btnNext.focus();
  345. }
  346. }
  347. //////////////////////////////////////////////////////////////////////////////////////
  348. // activerr.htm
  349. //////////////////////////////////////////////////////////////////////////////////////
  350. function Activerr_RetryBtnHandler()
  351. {
  352. DisableAllButtons();
  353. if (CheckForAnyConnection())
  354. GoNavigate(CKPT_ACTIV);
  355. else
  356. GoNavigate(CKPT_ACTIVERR);
  357. }
  358. function ActivationErr_LoadMe()
  359. {
  360. InitFrameRef();
  361. GetPageTitle();
  362. CheckContrastMode();
  363. InitButtons();
  364. g.btnTelephone.onmouseover = HandleButtonMouseOver;
  365. g.btnTelephone.onmouseout = HandleButtonMouseOut;
  366. g.btnTelephone.onclick = GoNext;
  367. g.btnNext.onclick = Activerr_RetryBtnHandler;
  368. g_FirstFocusElement = g.btnNext;
  369. if (g_FirstFocusElement != null)
  370. window.setTimeout("DoFocus();",1000);
  371. }
  372. //////////////////////////////////////////////////////////////////////////////////////
  373. // actconn.htm
  374. //////////////////////////////////////////////////////////////////////////////////////
  375. var g_ActConnRadioSticky = 1;
  376. function ActConn_LoadMe()
  377. {
  378. InitFrameRef();
  379. GetPageTitle();
  380. CheckContrastMode();
  381. if (g_ActConnRadioSticky == 1)
  382. {
  383. g_FirstFocusElement = g.rb_conn_lan;
  384. g.rb_conn_lan.checked = true;
  385. }
  386. else
  387. {
  388. g_FirstFocusElement = g.rb_conn_modem;
  389. g.rb_conn_modem.checked = true;
  390. }
  391. InitButtons();
  392. window.setTimeout("DoFocus();",1000);
  393. }
  394. //////////////////////////////////////////////////////////////////////////////////////
  395. // actlan.htm
  396. //////////////////////////////////////////////////////////////////////////////////////
  397. var ProxySettingsObj = null;
  398. function ProxySettings(ConfigString)
  399. {
  400. this.UseAuto = false;
  401. this.UseScript = false;
  402. this.ScriptUrl = "";
  403. this.UseProxy = false;
  404. this.Server = "";
  405. this.Port = "";
  406. if (ConfigString != null)
  407. {
  408. var i, j;
  409. var Args = ConfigString.split(/ /);
  410. for (i = 0; i < Args.length; i++)
  411. {
  412. switch (Args[i])
  413. {
  414. case 'u':
  415. var ProxyList = Args[++i];
  416. var HttpProxy = null;
  417. // only care about proxy server for HTTP
  418. if (ProxyList.indexOf("=") == -1)
  419. {
  420. HttpProxy = ProxyList;
  421. }
  422. else
  423. {
  424. var Proxys = ProxyList.split(/;/);
  425. if (Proxys != null)
  426. {
  427. for (j = 0; j < Proxys.length; j++)
  428. {
  429. if (Proxys[j].indexOf("http=") == 0)
  430. {
  431. HttpProxy = Proxys[j].substring(5, Proxys[j].length);
  432. break;
  433. }
  434. }
  435. }
  436. }
  437. if (HttpProxy)
  438. {
  439. j = HttpProxy.lastIndexOf(':');
  440. if (j == -1)
  441. {
  442. this.Server = HttpProxy;
  443. }
  444. else
  445. {
  446. this.Server = HttpProxy.substring(0, j);
  447. this.Port = HttpProxy.substring(j+1, HttpProxy.length);
  448. }
  449. }
  450. break;
  451. case 'a':
  452. this.UseAuto = true;
  453. break;
  454. case 'm':
  455. this.UseProxy = true;
  456. break;
  457. }
  458. }
  459. }
  460. }
  461. function ActLan_LoadMe()
  462. {
  463. InitFrameRef();
  464. GetPageTitle();
  465. CheckContrastMode();
  466. InitButtons();
  467. if (ProxySettingsObj == null)
  468. {
  469. var ConfigString = window.external.get_ProxySettings();
  470. ProxySettingsObj = new ProxySettings(ConfigString);
  471. }
  472. g.cb_auto_detect.checked = ProxySettingsObj.UseAuto;
  473. g.cb_use_proxy.checked = ProxySettingsObj.UseProxy;
  474. g.txt_proxy_url.value = ProxySettingsObj.Server;
  475. g.txt_proxy_port.value = ProxySettingsObj.Port;
  476. ActLan_upClickHandler();
  477. g_FirstFocusElement = g.btnNext;
  478. window.setTimeout("DoFocus();",1500);
  479. }
  480. function ActLan_upClickHandler()
  481. {
  482. if (g.cb_use_proxy.checked)
  483. {
  484. g.txt_proxy_url.style.backgroundColor = "#ffffff";
  485. g.txt_proxy_url.disabled = false;
  486. g.txt_proxy_port.style.backgroundColor = "#ffffff";
  487. g.txt_proxy_port.disabled = false;
  488. }
  489. else
  490. {
  491. g.txt_proxy_url.style.backgroundColor = "#dddddd";
  492. g.txt_proxy_url.disabled = true;
  493. g.txt_proxy_port.style.backgroundColor = "#dddddd";
  494. g.txt_proxy_port.disabled = true;
  495. }
  496. }
  497. function ActLan(Stage)
  498. {
  499. if (Stage == null)
  500. {
  501. //
  502. // Do the internet connectivity checking ...
  503. //
  504. Span_WPA_MainTitle.innerText = L_BlankTitle_Text;
  505. ShowIFrame('False', L_CheckConnectivity_Text);
  506. ResetConnectedToInternetEx();
  507. ConnectedToInternetEx(true, "ActLan(1);");
  508. }
  509. else
  510. {
  511. //
  512. // Use the existing connectivity value
  513. //
  514. if (ConnectedToInternetEx(false))
  515. {
  516. IcsConnect(ICS_CONN_TYPE_REG);
  517. SetTimerShowIFrame(ACTIVATION_TIMEOUT);
  518. }
  519. else
  520. {
  521. g_ActivationStatus = ERR_ACT_NETWORK_FAILURE;
  522. GoNavigate(CKPT_ACT_MSG);
  523. }
  524. }
  525. }
  526. //////////////////////////////////////////////////////////////////////////////////////
  527. // PID functions
  528. //////////////////////////////////////////////////////////////////////////////////////
  529. var g_TabForward = false;
  530. var g_TabBackward = false;
  531. var g_LastFocusedPidBox;
  532. var g_SelectionExistsBeforeKeyPress=null;
  533. var g_keyPressKeyCode = 0;
  534. var g_CharCode0_plus1=("0".charCodeAt(0))+1;
  535. function RetrievePid()
  536. {
  537. // retrieves the pid if avialable.
  538. var strPid = PidObj.get_PID();
  539. // if there is no PID then we set the
  540. // focus to the first field
  541. if (strPid.length == 0)
  542. {
  543. g.edtProductKey[0].focus();
  544. }
  545. // else we populate the fields with the
  546. // sections of the PID
  547. else
  548. {
  549. var re = new RegExp("(.*)-(.*)-(.*)-(.*)-(.*)","");
  550. if(re.exec(strPid) == null) {
  551. throw "Internal error: RegExp pattmatch failed!";
  552. }
  553. g.edtProductKey[0].value = RegExp.$1;
  554. g.edtProductKey[1].value = RegExp.$2;
  555. g.edtProductKey[2].value = RegExp.$3;
  556. g.edtProductKey[3].value = RegExp.$4;
  557. g.edtProductKey[4].value = RegExp.$5;
  558. }
  559. }
  560. function PID_CheckLength(KnownIncomplete)
  561. {
  562. // call this only if box reaches length 5 for speed?
  563. if(KnownIncomplete) {
  564. g.btnNext.disabled = true;
  565. g.btnNext.className="buttons-disabled";
  566. return;
  567. }
  568. var TotLength=g.edtProductKey[0].value.length+g.edtProductKey[1].value.length+
  569. g.edtProductKey[2].value.length+g.edtProductKey[3].value.length+
  570. g.edtProductKey[4].value.length;
  571. if (TotLength == 25)
  572. {
  573. g.btnNext.disabled = false;
  574. g.btnNext.className="buttons";
  575. }
  576. else
  577. {
  578. g.btnNext.disabled = true;
  579. g.btnNext.className="buttons-disabled";
  580. }
  581. }
  582. function PIDBox_HandleBlur() {
  583. g_LastFocusedPidBox=g.event.srcElement;
  584. }
  585. function PIDBox_HandleFocus() {
  586. g_LastFocusedPidBox=g.event.srcElement;
  587. OnFocus();
  588. }
  589. function IsProductIDKey(keyCode)
  590. {
  591. var str = String.fromCharCode(keyCode);
  592. 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/);
  593. return (null != result);
  594. }
  595. function CursorAtEndOfField(currentEdit) {
  596. // assumes selection is current edit field
  597. var tr = g.edtProductKey[currentEdit].createTextRange();
  598. var tr2 = g.document.selection.createRange();
  599. tr2.moveStart("textedit",-1);
  600. if(tr.isEqual(tr2)){
  601. return true;
  602. } else {
  603. return false;
  604. }
  605. }
  606. function ProductIDKeyDown()
  607. {
  608. try
  609. {
  610. if (g.event == null)
  611. return;
  612. }
  613. catch(e)
  614. {
  615. return;
  616. }
  617. var keyCode = g.event.keyCode;
  618. g_SelectionExistsBeforeKeyPress=(g.document.selection.type!="None");
  619. if(g.event.srcElement.tagName=="INPUT") {
  620. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  621. } else {
  622. var i=-1;
  623. }
  624. switch(keyCode) {
  625. case KeyTab:
  626. if(g.event.srcElement == g.edtProductKey[i]) {
  627. if(g.event.shiftKey)
  628. TabBackward(i,true);
  629. else TabForward(i,true);
  630. g.event.returnValue = false;
  631. g.event.keyCode = 0;
  632. g.event.cancelBubble = true;
  633. break;
  634. }
  635. break;
  636. case KeyLeftArrow:
  637. if((i>0) && CursorAtStartOfField(i)) {
  638. TabBackward(i,false);
  639. g.event.returnValue = false;
  640. }
  641. break;
  642. case KeyRightArrow:
  643. if((i<4) && CursorAtEndOfField(i)) {
  644. TabForward(i,false);
  645. g.event.returnValue = false;
  646. }
  647. break;
  648. case KeyBackSpc:
  649. case KeyDelete:
  650. // if there is already 5 characters in a field, and the user puts the cursor in it, we want to
  651. // fill in the next box with the character. we have to do this here because there is no propertychange,
  652. // and keyup is too late
  653. //if(g.edtProductKey[i].value.length == 5 && IsProductIDKey(keyCode) && g.document.selection==null)
  654. // TabForward(i);
  655. // cgeorges note: I enabled this feature tried it and didnt like it
  656. ////////
  657. // we want the delete/backspace to move the previous edit box if:
  658. // there is 0 characters, and the user puts the cursor in it, and selection is non-null
  659. // OR backspc && cursor is at start of field
  660. if ((i > 0) &&
  661. ( ((g.document.selection.type=="None") && (g.edtProductKey[i].value.length == 0))
  662. ||((keyCode==KeyBackSpc)&& CursorAtStartOfField(i)))) {
  663. TabBackward(i,false);
  664. g.event.returnValue = false; // so no deletion occurs when backspace moves to prev pidbox
  665. g.event.keyCode = 0;
  666. }
  667. break;
  668. case KeyEnter:
  669. if((g.btnNext.disabled == false)&&(g.event.srcElement!=g.btnBack)) {
  670. g.btnNext.click();
  671. g.event.returnValue = false;
  672. g.event.keyCode = 0;
  673. g.event.cancelBubble = true;
  674. }
  675. break;
  676. }
  677. }
  678. function ProductIDPropertyChange()
  679. {
  680. try
  681. {
  682. if (g.event == null)
  683. return;
  684. }
  685. catch(e)
  686. {
  687. return;
  688. }
  689. // enable Next Btn when PID is full, and automatically move to
  690. // next/previous field when entering/deleting chars
  691. if ("value" == g.event.propertyName) {
  692. // find the index at which we are.
  693. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  694. // our g_Tab variables can be booleans instead of counts because they can
  695. // have a max value of 1, becase there will only ever be 1 call to OnPropertyChange if the
  696. // length of the edit is 0 or 5
  697. switch(g.edtProductKey[i].value.length) {
  698. case 5:
  699. g_TabForward = (i<4); // dont tab forward if on last PID box
  700. PID_CheckLength(false);
  701. break;
  702. case 4:
  703. case 0:
  704. case 1:
  705. PID_CheckLength(true); //change from 25char-state could have occurred with any of these lengths
  706. }
  707. // see if we want to tab backward
  708. // if pixbox is empty, and last keypress was not a pidkey (which adds a char),
  709. // and nothing was selected.
  710. // BUGBUG: this currently only fully works for the delete key. when backspace
  711. // is pressed, g.document.selection.type is always "None" even if there was a selection
  712. if ((g.edtProductKey[i].value.length == 0) && (i > 0) &&
  713. (g_keyPressKeyCode==KeyBackSpc)&&(g_keyPressKeyCode==KeyDelete)&&
  714. (g.document.selection.type=="None")) {
  715. g_TabBackward = true; // IsProd check is to handle the case where they select everything then press a 2, etc.
  716. }
  717. }
  718. g_keyPressKeyCode = 0;
  719. }
  720. function ProductIDKeyPress()
  721. {
  722. try
  723. {
  724. if (g.event == null)
  725. return;
  726. }
  727. catch(e)
  728. {
  729. return;
  730. }
  731. if (g.event.keyCode == KeyBackSpc) {
  732. ProductIDKeyDown();
  733. return;
  734. }
  735. KeyCodeToUpper();
  736. g_keyPressKeyCode = g.event.keyCode;
  737. if (!IsProductIDKey(g_keyPressKeyCode)) {
  738. g.event.keyCode = 0;
  739. return;
  740. } else {
  741. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  742. if((i<4) && (g.edtProductKey[i].value.length == 5) && CursorAtEndOfField(i) && (!g_SelectionExistsBeforeKeyPress)) {
  743. TabForward(i,false);
  744. }
  745. }
  746. }
  747. function ProductIDKeyUp()
  748. {
  749. try
  750. {
  751. if (g.event == null)
  752. return;
  753. }
  754. catch(e)
  755. {
  756. return;
  757. }
  758. if((!g_TabForward) && (!g_TabBackward)) {
  759. return;
  760. }
  761. var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
  762. if (g_TabBackward) {
  763. TabBackward(i,false);
  764. return;
  765. } else
  766. if(g_TabForward) {
  767. TabForward(i,false);
  768. }
  769. }
  770. function TabForward(currentEdit,DoSelectAll)
  771. {
  772. g_TabForward = false;
  773. if(currentEdit==4) {
  774. // deselect any existing selection before moving focus to back button
  775. if(g.document.selection.type!="None") {
  776. g.document.selection.empty();
  777. }
  778. g.btnTelephone.focus();
  779. return;
  780. }
  781. currentEdit++;
  782. g.edtProductKey[currentEdit].focus();
  783. if(DoSelectAll) {
  784. g.edtProductKey[currentEdit].select();
  785. return;
  786. }
  787. var tr = g.edtProductKey[currentEdit].createTextRange();
  788. tr.collapse(true);
  789. tr.moveStart("word", 0);
  790. tr.select();
  791. }
  792. function TabBackward(currentEdit,DoSelectAll)
  793. {
  794. g_TabBackward = false;
  795. if (currentEdit == 0) {
  796. // deselect any existing selection before moving focus to button
  797. if(g.document.selection.type!="None") {
  798. g.document.selection.empty();
  799. }
  800. if(g.btnNext.disabled) {
  801. g.btnQuit.focus();
  802. } else {
  803. g.btnNext.focus();
  804. }
  805. return;
  806. }
  807. currentEdit--;
  808. g.edtProductKey[currentEdit].focus();
  809. if(DoSelectAll) {
  810. g.edtProductKey[currentEdit].select();
  811. return;
  812. }
  813. var tr = g.edtProductKey[currentEdit].createTextRange();
  814. tr.collapse(false);
  815. tr.moveStart("word", 1);
  816. tr.select();
  817. }
  818. function CursorAtStartOfField(currentEdit) {
  819. var tr = g.edtProductKey[currentEdit].createTextRange();
  820. var tr2 = g.document.selection.createRange();
  821. tr2.moveEnd("textedit",1);
  822. if(tr.isEqual(tr2)){
  823. return true;
  824. } else {
  825. return false;
  826. }
  827. }
  828. function CursorAtEndOfField(currentEdit) {
  829. // assumes selection is current edit field
  830. var tr = g.edtProductKey[currentEdit].createTextRange();
  831. var tr2 = g.document.selection.createRange();
  832. tr2.moveStart("textedit",-1);
  833. if(tr.isEqual(tr2)){
  834. return true;
  835. } else {
  836. return false;
  837. }
  838. }
  839. function StorePid()
  840. {
  841. var strPid = "";
  842. for (var i = 0; i < 4; i++)
  843. {
  844. strPid += g.edtProductKey[i].value;
  845. strPid += '-';
  846. }
  847. strPid += g.edtProductKey[i].value;
  848. PidObj.set_PID(strPid);
  849. }
  850. //////////////////////////////////////////////////////////////////////////////////////
  851. // adeskerr.htm
  852. //////////////////////////////////////////////////////////////////////////////////////
  853. function Activation_ResetNetworking()
  854. {
  855. if (window.external.CheckOnlineStatus)
  856. {
  857. ResetDialing();
  858. }
  859. if (g_InitAutodial)
  860. {
  861. window.external.InternetAutodialHangup();
  862. g_InitAutodial = false;
  863. }
  864. }
  865. function Activation_RetryBtnHandler()
  866. {
  867. DisableAllButtons();
  868. if ((g_ActivationStatus == ERR_ACT_INVALID_PID) ||
  869. (g_ActivationStatus == ERR_ACT_USED_PID) ||
  870. (g_ActivationStatus == ERR_ACT_BLOCKED_PID) ||
  871. (g_ActivationStatus == ERR_ACT_DEDICATED_PID_ENTRY))
  872. {
  873. StorePid();
  874. if (PidObj.get_PID.length != 0 && PidObj.ValidatePID())
  875. {
  876. if (ReturnToTelephonePage)
  877. {
  878. // Must reload our Installation ID since we're successful in updating our PID
  879. g_Load_InstallID = true;
  880. // Also clear out the confirmation ID boxes
  881. g_ConfirmID_A = "";
  882. g_ConfirmID_B = "";
  883. g_ConfirmID_C = "";
  884. g_ConfirmID_D = "";
  885. g_ConfirmID_E = "";
  886. g_ConfirmID_F = "";
  887. g_ConfirmID_G = "";
  888. GoNavigate(CKPT_ACTIVSVC); // This is where we go when we click on "Update" to change our product key in the update PID page
  889. }
  890. else
  891. GoNavigate(CKPT_REGDIAL);
  892. }
  893. else
  894. {
  895. // Must show "Invalid PID" page
  896. g_ActivationStatus = ERR_ACT_INVALID_PID;
  897. GoNavigate(CKPT_ACT_MSG);
  898. }
  899. }
  900. else
  901. {
  902. // If our error has nothing to do with the PID, then the RETRY button should fall here...
  903. GoNavigate(CKPT_REGDIAL);
  904. }
  905. }
  906. var L_EnterNewKey_Text = "Enter new key:";
  907. var L_EnterKey_Text = "Enter key:";
  908. var L_NewKey_Text = "New key:";
  909. var L_MessageNumber_Text = "Message number: %1";
  910. var L_FinishButton_Text = "OK";
  911. var L_UpdateButton_Text = " <u>U</u>pdate ";
  912. function act_desktop_error_LoadMe()
  913. {
  914. var Accesskey_U = "U";
  915. var Accesskey_O = "O";
  916. InitFrameRef();
  917. GetPageTitle();
  918. CheckContrastMode();
  919. Activation_ResetNetworking();
  920. var ndaysleft = ""
  921. try
  922. {
  923. ndaysleft = window.external.GetActivationDaysLeft();
  924. }
  925. catch(e)
  926. {
  927. ndaysleft = "0";
  928. }
  929. if (g_ActivationStatus == ERR_ACT_SUCCESS)
  930. {
  931. var L_ActThankYou_Text = "Thank You!";
  932. Span_WPA_MainTitle.innerText = L_ActThankYou_Text;
  933. if (g_PostToMS)
  934. g.acterror_description_SUCCESS1.style.display="inline";
  935. else
  936. g.acterror_description_SUCCESS2.style.display="inline";
  937. }
  938. else if (g_ActivationStatus == ERR_ACT_INACCESSIBLE)
  939. {
  940. var L_ActUnable1_Text = "Unable to activate Windows";
  941. Span_WPA_MainTitle.innerText = L_ActUnable1_Text;
  942. if (ndaysleft == "0")
  943. {
  944. g.acterror_description1Post.style.display="inline";
  945. }
  946. else
  947. {
  948. g.acterror_description1Pre.style.display="inline";
  949. g.NumberDaysLeft1.innerText = ndaysleft;
  950. }
  951. }
  952. else if (g_ActivationStatus == ERR_ACT_INVALID_PID)
  953. {
  954. var L_ActIncorrectKey_Text = "Incorrect product key";
  955. Span_WPA_MainTitle.innerText = L_ActIncorrectKey_Text;
  956. var WPAOEMMode01 = window.external.IsOemSKU();
  957. if (WPAOEMMode01)
  958. {
  959. // OEM
  960. g.acterror_description2_OEM.style.display="inline";
  961. g.acterror_after_pid_entry_OEMText.style.display="inline";
  962. }
  963. else
  964. {
  965. // Retail
  966. g.acterror_description2_RETAIL.style.display="inline";
  967. }
  968. g.acterror_pid_entry.style.display="inline";
  969. g.acterror_after_pid_entry_text1.style.display="inline";
  970. g.acterror_description_verify_key.innerHTML = L_NewKey_Text;
  971. }
  972. else if (g_ActivationStatus == ERR_ACT_USED_PID)
  973. {
  974. var L_ActProductKey_Text = "Product key";
  975. Span_WPA_MainTitle.innerText = L_ActProductKey_Text;
  976. var WPAOEMMode02 = window.external.IsOemSKU();
  977. if (WPAOEMMode02)
  978. {
  979. // OEM
  980. g.acterror_description3OEM.style.display="inline";
  981. g.acterror_after_pid_entry_OEMText.style.display="inline";
  982. }
  983. else
  984. {
  985. // Retail
  986. g.acterror_description3Retail.style.display="inline";
  987. }
  988. g.acterror_pid_entry.style.display="inline";
  989. g.acterror_description_verify_key.innerHTML = L_NewKey_Text;
  990. g.acterror_after_pid_entry_text2.style.display="inline";
  991. }
  992. else if (g_ActivationStatus == ERR_ACT_INTERNAL_WINDOWS_ERR)
  993. {
  994. var L_ActUnable2_Text = "Unable to activate Windows";
  995. Span_WPA_MainTitle.innerText = L_ActUnable2_Text;
  996. if (ndaysleft == "0")
  997. {
  998. g.acterror_description4Post.style.display="inline";
  999. }
  1000. else
  1001. {
  1002. g.acterror_description4Pre.style.display="inline";
  1003. g.NumberDaysLeft2.innerText = ndaysleft;
  1004. }
  1005. }
  1006. else if (g_ActivationStatus == ERR_ACT_BLOCKED_PID)
  1007. {
  1008. var L_ActUnauthorKey_Text = "Unauthorized product key";
  1009. Span_WPA_MainTitle.innerText = L_ActUnauthorKey_Text;
  1010. var WPAOEMMode03 = window.external.IsOemSKU();
  1011. if (WPAOEMMode03)
  1012. {
  1013. // OEM
  1014. g.acterror_description5OEM.style.display="inline";
  1015. g.acterror_after_pid_entry_OEMText.style.display="inline";
  1016. }
  1017. else
  1018. {
  1019. // Retail
  1020. g.acterror_description5Retail.style.display="inline";
  1021. }
  1022. g.acterror_pid_entry.style.display="inline";
  1023. g.acterror_description_verify_key.innerHTML = L_NewKey_Text;
  1024. g.acterror_after_pid_entry_text2.style.display="inline";
  1025. }
  1026. else if (g_ActivationStatus == ERR_ACT_CORRUPTED_PID)
  1027. {
  1028. g.acterror_description6.style.display="inline";
  1029. g.NumberDaysLeft3.innerText = ndaysleft;
  1030. }
  1031. else if (g_ActivationStatus == ERR_ACT_NETWORK_FAILURE)
  1032. {
  1033. g.acterror_description7.style.display="inline";
  1034. }
  1035. else if (g_ActivationStatus == ERR_ACT_DEDICATED_PID_ENTRY)
  1036. {
  1037. var L_ActUpdateKey_Text = "Change product key";
  1038. Span_WPA_MainTitle.innerText = L_ActUpdateKey_Text;
  1039. var WPAOEMMode04 = window.external.IsOemSKU();
  1040. if (WPAOEMMode04)
  1041. {
  1042. // OEM
  1043. g.acterror_description_dedicated_pid_OEM.style.display="inline";
  1044. g.acterror_after_pid_entry_OEMText.style.display="inline";
  1045. }
  1046. else
  1047. {
  1048. // Retail
  1049. g.acterror_description_dedicated_pid_RETAIL.style.display="inline";
  1050. }
  1051. g.acterror_pid_entry.style.display="inline";
  1052. g.acterror_description_verify_key.innerHTML = L_NewKey_Text;
  1053. g.btnNext.innerHTML = L_UpdateButton_Text;
  1054. g.btnNext.accessKey = Accesskey_U;
  1055. }
  1056. else
  1057. {
  1058. g.acterror_description4.style.display="inline";
  1059. g.NumberDaysLeft2.innerText = ndaysleft;
  1060. }
  1061. if (g_ActivationStatus != ERR_ACT_SUCCESS)
  1062. {
  1063. if ((g_act_specific_error != 0) && (g_act_specific_error != null))
  1064. {
  1065. g.acterror_specific_error_code.innerText = ApiObj.FormatMessage(L_MessageNumber_Text, g_act_specific_error.toString());
  1066. g.acterror_specific_error_code.style.display = "inline";
  1067. }
  1068. }
  1069. InitButtons();
  1070. if (g_ActivationStatus != ERR_ACT_SUCCESS)
  1071. {
  1072. if ((g_ActivationStatus == ERR_ACT_INVALID_PID) ||
  1073. (g_ActivationStatus == ERR_ACT_USED_PID) ||
  1074. (g_ActivationStatus == ERR_ACT_BLOCKED_PID) ||
  1075. (g_ActivationStatus == ERR_ACT_DEDICATED_PID_ENTRY))
  1076. {
  1077. if (null == PidObj)
  1078. {
  1079. PidObj = new Object;
  1080. PidObj = window.external.ProductID;
  1081. }
  1082. g_FirstFocusElement = g.edtProductKey[0];
  1083. ShowIFrame();
  1084. RetrievePid();
  1085. var rangefocus = g_FirstFocusElement.createTextRange();
  1086. rangefocus.collapse();
  1087. rangefocus.moveStart("word", 0);
  1088. rangefocus.select();
  1089. g_TabForward = false;
  1090. g_TabBackward = false;
  1091. PID_CheckLength(false);
  1092. for (i = 0; i <= 4; i++)
  1093. {
  1094. g.edtProductKey[i].onblur=PIDBox_HandleBlur;
  1095. g.edtProductKey[i].onfocus=PIDBox_HandleFocus;
  1096. }
  1097. g_LastFocusedPidBox=g.edtProductKey[0];
  1098. }
  1099. else
  1100. {
  1101. g_FirstFocusElement = g.btnNext;
  1102. ShowIFrame();
  1103. }
  1104. g.btnTelephone.onmouseover = HandleButtonMouseOver;
  1105. g.btnTelephone.onmouseout = HandleButtonMouseOut;
  1106. g.btnTelephone.onclick = GoNext;
  1107. g.btnNext.onclick = Activation_RetryBtnHandler;
  1108. }
  1109. else
  1110. {
  1111. g.btnTelephone.style.visibility = "hidden";
  1112. g.btnQuit.style.visibility = "hidden";
  1113. g.btnNext.innerHTML = L_FinishButton_Text;
  1114. g.btnNext.accessKey = Accesskey_O;
  1115. g_FirstFocusElement = g.btnNext;
  1116. ShowIFrame();
  1117. }
  1118. window.setTimeout("DoFocus();",1000);
  1119. }
  1120. //////////////////////////////////////////////////////////////////////////////////////
  1121. // activsvc.htm
  1122. //////////////////////////////////////////////////////////////////////////////////////
  1123. function ValidateConfirmIDBox(Box_Number)
  1124. {
  1125. var Box_Value = null;
  1126. var Box_Valid = null;
  1127. if (Box_Number=='1')
  1128. Box_Value = g.ActCodeBox1.value;
  1129. if (Box_Number=='2')
  1130. Box_Value = g.ActCodeBox2.value;
  1131. if (Box_Number=='3')
  1132. Box_Value = g.ActCodeBox3.value;
  1133. if (Box_Number=='4')
  1134. Box_Value = g.ActCodeBox4.value;
  1135. if (Box_Number=='5')
  1136. Box_Value = g.ActCodeBox5.value;
  1137. if (Box_Number=='6')
  1138. Box_Value = g.ActCodeBox6.value;
  1139. if (Box_Number=='7')
  1140. Box_Value = g.ActCodeBox7.value;
  1141. Box_Valid = window.external.VerifyCheckDigits(Box_Value);
  1142. if (!Box_Valid)
  1143. {
  1144. var L_ConfirmIDInvalid1_Text = "The confirmation ID entered in this field is invalid. Please check the number and try again.";
  1145. alert(L_ConfirmIDInvalid1_Text);
  1146. // Set focus on the invalid confirmation id box
  1147. if (Box_Number=='1')
  1148. {
  1149. g.ActCodeBox1.focus();
  1150. g.ActCodeBox1.select();
  1151. g_DoFieldChecking = false;
  1152. }
  1153. if (Box_Number=='2')
  1154. {
  1155. g.ActCodeBox2.focus();
  1156. g.ActCodeBox2.select();
  1157. g_DoFieldChecking = false;
  1158. }
  1159. if (Box_Number=='3')
  1160. {
  1161. g.ActCodeBox3.focus();
  1162. g.ActCodeBox3.select();
  1163. g_DoFieldChecking = false;
  1164. }
  1165. if (Box_Number=='4')
  1166. {
  1167. g.ActCodeBox4.focus();
  1168. g.ActCodeBox4.select();
  1169. g_DoFieldChecking = false;
  1170. }
  1171. if (Box_Number=='5')
  1172. {
  1173. g.ActCodeBox5.focus();
  1174. g.ActCodeBox5.select();
  1175. g_DoFieldChecking = false;
  1176. }
  1177. if (Box_Number=='6')
  1178. {
  1179. g.ActCodeBox6.focus();
  1180. g.ActCodeBox6.select();
  1181. g_DoFieldChecking = false;
  1182. }
  1183. if (Box_Number=='7')
  1184. {
  1185. g.ActCodeBox7.focus();
  1186. g.ActCodeBox7.select();
  1187. g_DoFieldChecking = false;
  1188. }
  1189. }
  1190. else
  1191. {
  1192. // Set focus on the next confirmation id box if valid
  1193. if (Box_Number=='1')
  1194. g.ActCodeBox2.focus();
  1195. if (Box_Number=='2')
  1196. g.ActCodeBox3.focus();
  1197. if (Box_Number=='3')
  1198. g.ActCodeBox4.focus();
  1199. if (Box_Number=='4')
  1200. g.ActCodeBox5.focus();
  1201. if (Box_Number=='5')
  1202. g.ActCodeBox6.focus();
  1203. if (Box_Number=='6')
  1204. g.ActCodeBox7.focus();
  1205. if (Box_Number=='7')
  1206. {
  1207. // Do nothing, focusing will be done automatically by IsConfirmIDComplete() when this function returns.
  1208. // Note: Don't take out the curly braces here...
  1209. }
  1210. g_DoFieldChecking = true;
  1211. }
  1212. }
  1213. function UpdateConfirmIDFields(FieldToEdit)
  1214. {
  1215. if (FieldToEdit == '1')
  1216. {
  1217. g_ConfirmID1 = g.ActCodeBox1.value;
  1218. }
  1219. if (FieldToEdit == '2')
  1220. {
  1221. g_ConfirmID2 = g.ActCodeBox2.value;
  1222. }
  1223. if (FieldToEdit == '3')
  1224. {
  1225. g_ConfirmID3 = g.ActCodeBox3.value;
  1226. }
  1227. if (FieldToEdit == '4')
  1228. {
  1229. g_ConfirmID4 = g.ActCodeBox4.value;
  1230. }
  1231. if (FieldToEdit == '5')
  1232. {
  1233. g_ConfirmID5 = g.ActCodeBox5.value;
  1234. }
  1235. if (FieldToEdit == '6')
  1236. {
  1237. g_ConfirmID6 = g.ActCodeBox6.value;
  1238. }
  1239. if (FieldToEdit == '7')
  1240. {
  1241. g_ConfirmID7 = g.ActCodeBox7.value;
  1242. }
  1243. // If user presses Backspace, move focus to previous field if current field is empty. Unless we are in field 1.
  1244. if (g_DoBackSpace)
  1245. {
  1246. g_DoBackSpace = false;
  1247. var tr = null;
  1248. if (FieldToEdit == '1')
  1249. {
  1250. // Do nothing.
  1251. }
  1252. else if (FieldToEdit == '2')
  1253. {
  1254. if (g.ActCodeBox2.value == "")
  1255. tr = g.ActCodeBox1.createTextRange();
  1256. }
  1257. else if (FieldToEdit == '3')
  1258. {
  1259. if (g.ActCodeBox3.value == "")
  1260. tr = g.ActCodeBox2.createTextRange();
  1261. }
  1262. else if (FieldToEdit == '4')
  1263. {
  1264. if (g.ActCodeBox4.value == "")
  1265. tr = g.ActCodeBox3.createTextRange();
  1266. }
  1267. else if (FieldToEdit == '5')
  1268. {
  1269. if (g.ActCodeBox5.value == "")
  1270. tr = g.ActCodeBox4.createTextRange();
  1271. }
  1272. else if (FieldToEdit == '6')
  1273. {
  1274. if (g.ActCodeBox6.value == "")
  1275. tr = g.ActCodeBox5.createTextRange();
  1276. }
  1277. else if (FieldToEdit == '7')
  1278. {
  1279. if (g.ActCodeBox7.value == "")
  1280. tr = g.ActCodeBox6.createTextRange();
  1281. }
  1282. // This will cause the insertion point to move to the end of the text range
  1283. if ((FieldToEdit != '1') && (tr != null))
  1284. {
  1285. tr.collapse(false);
  1286. tr.moveStart("word", 1);
  1287. tr.select();
  1288. }
  1289. }
  1290. }
  1291. function DeleteLastCharacter(FieldToEdit)
  1292. {
  1293. if (FieldToEdit == '1')
  1294. {
  1295. g.ActCodeBox1.value = g_ConfirmID1;
  1296. }
  1297. if (FieldToEdit == '2')
  1298. {
  1299. g.ActCodeBox2.value = g_ConfirmID2;
  1300. }
  1301. if (FieldToEdit == '3')
  1302. {
  1303. g.ActCodeBox3.value = g_ConfirmID3;
  1304. }
  1305. if (FieldToEdit == '4')
  1306. {
  1307. g.ActCodeBox4.value = g_ConfirmID4;
  1308. }
  1309. if (FieldToEdit == '5')
  1310. {
  1311. g.ActCodeBox5.value = g_ConfirmID5;
  1312. }
  1313. if (FieldToEdit == '6')
  1314. {
  1315. g.ActCodeBox6.value = g_ConfirmID6;
  1316. }
  1317. if (FieldToEdit == '7')
  1318. {
  1319. g.ActCodeBox7.value = g_ConfirmID7;
  1320. }
  1321. var L_OnlyNumbersAllowed_Text = "Only numbers can be used for the confirmation ID.";
  1322. alert(L_OnlyNumbersAllowed_Text);
  1323. if (FieldToEdit == '1')
  1324. g.ActCodeBox1.focus();
  1325. else if (FieldToEdit == '2')
  1326. g.ActCodeBox2.focus();
  1327. else if (FieldToEdit == '3')
  1328. g.ActCodeBox3.focus();
  1329. else if (FieldToEdit == '4')
  1330. g.ActCodeBox4.focus();
  1331. else if (FieldToEdit == '5')
  1332. g.ActCodeBox5.focus();
  1333. else if (FieldToEdit == '6')
  1334. g.ActCodeBox6.focus();
  1335. else if (FieldToEdit == '7')
  1336. g.ActCodeBox7.focus();
  1337. }
  1338. var g_ConfirmID1 = "";
  1339. var g_ConfirmID2 = "";
  1340. var g_ConfirmID3 = "";
  1341. var g_ConfirmID4 = "";
  1342. var g_ConfirmID5 = "";
  1343. var g_ConfirmID6 = "";
  1344. var g_ConfirmID7 = "";
  1345. var g_DoBackSpace = false;
  1346. var g_DoFieldChecking = true;
  1347. function activate_OnKeyUp(WhatField)
  1348. {
  1349. var keyCode = g.event.keyCode;
  1350. var str = String.fromCharCode(keyCode);
  1351. // Evidently, numkeypad 0 with the NumLock on gives us x60 or single back quote
  1352. // LocStudio doesn't understand regexp, so we refer to this character by ascii code \x60
  1353. // The small letters a-i represent the keycodes for the numeric keypad 1-9 (If Numlock is on).
  1354. // We only allow "Numbers" to be entered in the Confirmation ID fields.
  1355. var result = str.match(/\x60|a|b|c|d|e|f|g|h|i|1|2|3|4|5|6|7|8|9|0/);
  1356. var NonNumericresult = str.match(/A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z/);
  1357. var BackSpc = str.match(/\x08/);
  1358. var validchar = false;
  1359. if (null != result)
  1360. {
  1361. validchar = true;
  1362. }
  1363. else
  1364. {
  1365. validchar = false;
  1366. if (null != NonNumericresult)
  1367. {
  1368. DeleteLastCharacter(WhatField);
  1369. }
  1370. else
  1371. {
  1372. if (null != BackSpc)
  1373. g_DoBackSpace = true;
  1374. UpdateConfirmIDFields(WhatField);
  1375. }
  1376. }
  1377. if (validchar)
  1378. {
  1379. if (WhatField == '1')
  1380. {
  1381. g_ConfirmID1 = g.ActCodeBox1.value;
  1382. if (g.ActCodeBox1.value.length == 6)
  1383. {
  1384. ValidateConfirmIDBox(WhatField);
  1385. }
  1386. }
  1387. if (WhatField == '2')
  1388. {
  1389. g_ConfirmID2 = g.ActCodeBox2.value;
  1390. if (g.ActCodeBox2.value.length == 6)
  1391. {
  1392. ValidateConfirmIDBox(WhatField);
  1393. }
  1394. }
  1395. if (WhatField == '3')
  1396. {
  1397. g_ConfirmID3 = g.ActCodeBox3.value;
  1398. if (g.ActCodeBox3.value.length == 6)
  1399. {
  1400. ValidateConfirmIDBox(WhatField);
  1401. }
  1402. }
  1403. if (WhatField == '4')
  1404. {
  1405. g_ConfirmID4 = g.ActCodeBox4.value;
  1406. if (g.ActCodeBox4.value.length == 6)
  1407. {
  1408. ValidateConfirmIDBox(WhatField);
  1409. }
  1410. }
  1411. if (WhatField == '5')
  1412. {
  1413. g_ConfirmID5 = g.ActCodeBox5.value;
  1414. if (g.ActCodeBox5.value.length == 6)
  1415. {
  1416. ValidateConfirmIDBox(WhatField);
  1417. }
  1418. }
  1419. if (WhatField == '6')
  1420. {
  1421. g_ConfirmID6 = g.ActCodeBox6.value;
  1422. if (g.ActCodeBox6.value.length == 6)
  1423. {
  1424. ValidateConfirmIDBox(WhatField);
  1425. }
  1426. }
  1427. if (WhatField == '7')
  1428. {
  1429. g_ConfirmID7 = g.ActCodeBox7.value;
  1430. if (g.ActCodeBox7.value.length == 6)
  1431. {
  1432. ValidateConfirmIDBox(WhatField);
  1433. }
  1434. }
  1435. if (g_DoFieldChecking)
  1436. IsConfirmIDComplete();
  1437. // We set focus here instead of inside the IsConfirmIDComplete() function to have
  1438. // proper focus behaviour when we use certain keys like Tab, space, arrow keys...
  1439. if (!g.btnNext.disabled)
  1440. g.btnNext.focus();
  1441. }
  1442. else
  1443. {
  1444. IsConfirmIDComplete();
  1445. }
  1446. }
  1447. function IsConfirmIDComplete()
  1448. {
  1449. if ((g.ActCodeBox1.value.length == 6) && (g.ActCodeBox2.value.length == 6) && (g.ActCodeBox3.value.length == 6) && (g.ActCodeBox4.value.length == 6) && (g.ActCodeBox5.value.length == 6) && (g.ActCodeBox6.value.length == 6) && (g.ActCodeBox7.value.length == 6))
  1450. {
  1451. g.btnNext.onmouseover = HandleButtonMouseOver;
  1452. g.btnNext.onmouseout = HandleButtonMouseOut;
  1453. g.btnNext.className="buttons";
  1454. g.btnNext.disabled = false;
  1455. g.btnNext.onclick = ActivationSvc_NextBtnHandler;
  1456. }
  1457. else
  1458. {
  1459. g.btnNext.className="buttons-disabled";
  1460. g.btnNext.disabled = true;
  1461. }
  1462. }
  1463. var g_ActivSvc_Reload = true;
  1464. function ActivationSvc_NextBtnHandler()
  1465. {
  1466. g_Activation_CODE_ENTERED = g.ActCodeBox1.value + '-' +
  1467. g.ActCodeBox2.value + '-' +
  1468. g.ActCodeBox3.value + '-' +
  1469. g.ActCodeBox4.value + '-' +
  1470. g.ActCodeBox5.value + '-' +
  1471. g.ActCodeBox6.value + '-' +
  1472. g.ActCodeBox7.value;
  1473. g_ConfirmID_A = g.ActCodeBox1.value;
  1474. g_ConfirmID_B = g.ActCodeBox2.value;
  1475. g_ConfirmID_C = g.ActCodeBox3.value;
  1476. g_ConfirmID_D = g.ActCodeBox4.value;
  1477. g_ConfirmID_E = g.ActCodeBox5.value;
  1478. g_ConfirmID_F = g.ActCodeBox6.value;
  1479. g_ConfirmID_G = g.ActCodeBox7.value;
  1480. try
  1481. {
  1482. g_Activation_CODE_ENTERED_status = window.external.SetConfirmationID(g_Activation_CODE_ENTERED);
  1483. }
  1484. catch(e)
  1485. {
  1486. g_Activation_CODE_ENTERED_status = 0;
  1487. }
  1488. DisableAllButtons();
  1489. if (g_Activation_CODE_ENTERED_status == 0)
  1490. {
  1491. GoNavigate(CKPT_DONE);
  1492. }
  1493. else
  1494. {
  1495. g_Load_InstallID = false;
  1496. var L_ConfirmIDInvalid_Text = "The confirmation ID is invalid. Please check the number and try again.";
  1497. alert(L_ConfirmIDInvalid_Text);
  1498. g_ActivSvc_Reload = false;
  1499. GoNavigate(CKPT_ACTIVSVC);
  1500. }
  1501. }
  1502. function ActivationSvc_ProdkeyBtnHandler()
  1503. {
  1504. DisableAllButtons();
  1505. ReturnToTelephonePage = true;
  1506. g_Load_InstallID = false;
  1507. // Must also remember the Contents of the confirmation ID typed in by the user.
  1508. g_ConfirmID_A = g.ActCodeBox1.value;
  1509. g_ConfirmID_B = g.ActCodeBox2.value;
  1510. g_ConfirmID_C = g.ActCodeBox3.value;
  1511. g_ConfirmID_D = g.ActCodeBox4.value;
  1512. g_ConfirmID_E = g.ActCodeBox5.value;
  1513. g_ConfirmID_F = g.ActCodeBox6.value;
  1514. g_ConfirmID_G = g.ActCodeBox7.value;
  1515. g_ActivationStatus = ERR_ACT_DEDICATED_PID_ENTRY;
  1516. GoNavigate(CKPT_ACT_MSG);
  1517. }
  1518. function PhoneCountries_Changed()
  1519. {
  1520. g.ChosenPhoneNumber.innerHTML = "<B>" + g_Phone_Number_Array[g.selPhoneCountry.selectedIndex] + "</B>";
  1521. g.ChosenTollNumber.innerHTML = "<B>" + g_Toll_Number_Array[g.selPhoneCountry.selectedIndex] + "</B>";
  1522. // We want to remember the country selected whenever we go back to the Telephone page (activsvc.htm)
  1523. g_Country_Selected_Index = g.selPhoneCountry.selectedIndex;
  1524. }
  1525. var g_Country_Selected_Index = 0;
  1526. var g_Phone_Number_Array = new Array(500);
  1527. var g_Toll_Number_Array = new Array(500);
  1528. function GetPhoneCountries()
  1529. {
  1530. var g_PhoneCountries = "";
  1531. try
  1532. {
  1533. g_PhoneCountries = LangObj.get_PhoneCountries();
  1534. }
  1535. catch(e)
  1536. {
  1537. g_PhoneCountries = "API call error: get_PhoneCountries";
  1538. }
  1539. var i;
  1540. var PhoneOption;
  1541. var ModulusResult;
  1542. var PhoneCounter=0;
  1543. var TollCounter =0;
  1544. var regexp1=/\t/; // Define our regexp1 to a "TAB" keycode.
  1545. var Opt_PhoneCountry_Array = g_PhoneCountries.split(regexp1); // Let's split our tab delimited g_PhoneCountries string and put it into an array.
  1546. var L_SelectYourLocation_Text = "Select your location";
  1547. // Add the "Select your location" option in the select list
  1548. PhoneOption = g.document.createElement("OPTION");
  1549. PhoneOption.text = L_SelectYourLocation_Text;
  1550. g.selPhoneCountry.add(PhoneOption);
  1551. g_Toll_Number_Array[TollCounter] = "";
  1552. g_Phone_Number_Array[PhoneCounter] = "";
  1553. TollCounter = TollCounter + 1;
  1554. PhoneCounter = PhoneCounter + 1;
  1555. for(i=0; i < Opt_PhoneCountry_Array.length; i++)
  1556. {
  1557. ModulusResult = i % 3;
  1558. if (ModulusResult == 0)
  1559. {
  1560. PhoneOption = g.document.createElement("OPTION");
  1561. PhoneOption.text = Opt_PhoneCountry_Array[i];
  1562. g.selPhoneCountry.add(PhoneOption);
  1563. }
  1564. else if (ModulusResult == 1)
  1565. {
  1566. g_Toll_Number_Array[TollCounter] = Opt_PhoneCountry_Array[i];
  1567. TollCounter = TollCounter + 1;
  1568. }
  1569. else
  1570. {
  1571. g_Phone_Number_Array[PhoneCounter] = Opt_PhoneCountry_Array[i];
  1572. PhoneCounter = PhoneCounter + 1;
  1573. }
  1574. }
  1575. g.ChosenPhoneNumber.innerHTML = "<B>" + g_Phone_Number_Array[g_Country_Selected_Index] + "</B>";
  1576. g.ChosenTollNumber.innerHTML = "<B>" + g_Toll_Number_Array[g_Country_Selected_Index] + "</B>";
  1577. g.selPhoneCountry.selectedIndex = g_Country_Selected_Index;
  1578. }
  1579. function BackBtnHandler()
  1580. {
  1581. GoNavigate(CKPT_ACTIV);
  1582. }
  1583. var ReturnToTelephonePage = false;
  1584. var g_ConfirmID_A = "";
  1585. var g_ConfirmID_B = "";
  1586. var g_ConfirmID_C = "";
  1587. var g_ConfirmID_D = "";
  1588. var g_ConfirmID_E = "";
  1589. var g_ConfirmID_F = "";
  1590. var g_ConfirmID_G = "";
  1591. var g_Load_InstallID = true;
  1592. var g_Activation_Install_ID_Full = "";
  1593. function ActivationSvc_LoadMe()
  1594. {
  1595. InitFrameRef();
  1596. GetPageTitle();
  1597. CheckContrastMode();
  1598. ReturnToTelephonePage = false;
  1599. // We want to pre-populate the Confirmation ID fields with values entered by the user, on an event this page is loaded the second time around.
  1600. g.ActCodeBox1.value = g_ConfirmID_A;
  1601. g.ActCodeBox2.value = g_ConfirmID_B;
  1602. g.ActCodeBox3.value = g_ConfirmID_C;
  1603. g.ActCodeBox4.value = g_ConfirmID_D;
  1604. g.ActCodeBox5.value = g_ConfirmID_E;
  1605. g.ActCodeBox6.value = g_ConfirmID_F;
  1606. g.ActCodeBox7.value = g_ConfirmID_G;
  1607. // Show "Back" button if we came from the first page.
  1608. if (g_CameFromFirstPage)
  1609. {
  1610. g.btnBack.style.display = "inline";
  1611. }
  1612. InitButtons();
  1613. // Override basic button behavior.
  1614. // We want to force the back button to navigate to the first page "literally".
  1615. if (g_CameFromFirstPage)
  1616. {
  1617. g.btnBack.onclick = BackBtnHandler;
  1618. }
  1619. IsConfirmIDComplete(); // Enable the Next button if all the Confirmation ID fields are complete
  1620. GetPhoneCountries();
  1621. g.btnProdkey.onclick = ActivationSvc_ProdkeyBtnHandler;
  1622. g.btnProdkey.onmouseover = HandleButtonMouseOver;
  1623. g.btnProdkey.onmouseout = HandleButtonMouseOut;
  1624. if (g_Country_Selected_Index==0)
  1625. {
  1626. g_FirstFocusElement = g.selPhoneCountry;
  1627. }
  1628. else if (!g.btnNext.disabled)
  1629. {
  1630. g_FirstFocusElement = g.btnNext;
  1631. }
  1632. else
  1633. {
  1634. g_FirstFocusElement = g.ActCodeBox1;
  1635. }
  1636. if (g_FirstFocusElement != null)
  1637. window.setTimeout("DoFocus();",1000);
  1638. }
  1639. //// areg1.htm ///////////////////////
  1640. var g_Reg1RadioSticky = null;
  1641. function areg1_LoadMe()
  1642. {
  1643. InitFrameRef();
  1644. GetPageTitle();
  1645. CheckContrastMode();
  1646. if (g_Reg1RadioSticky == null)
  1647. g.btnNext.disabled = true;
  1648. else if (g_Reg1RadioSticky == 1)
  1649. g.rb_reg_1.checked = true;
  1650. else if (g_Reg1RadioSticky == 2)
  1651. g.rb_reg_2.checked = true;
  1652. InitButtons();
  1653. if (g.btnNext.disabled)
  1654. g_FirstFocusElement = g.btnBack;
  1655. else
  1656. g_FirstFocusElement = g.btnNext;
  1657. window.setTimeout("DoFocus();",1500);
  1658. }
  1659. function WPA_Reg1RadioClicked()
  1660. {
  1661. // if they click on either button, enable the Next button
  1662. if(g.btnNext.disabled && (g.rb_reg_1.checked || g.rb_reg_2.checked))
  1663. {
  1664. if (g.rb_reg_1.checked)
  1665. g_Reg1RadioSticky = 1;
  1666. else if (g.rb_reg_2.checked)
  1667. g_Reg1RadioSticky = 2;
  1668. g.btnNext.disabled = false;
  1669. g.btnNext.onclick = GoNext;
  1670. g.btnNext.focus();
  1671. }
  1672. }
  1673. //// reg3.htm ///////////////////////
  1674. 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");
  1675. 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");
  1676. var ProvinceNames = new Array("","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon");
  1677. // need ability to map state name string to index into StateAbbrevs
  1678. var g_StateName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  1679. var g_ProvinceName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  1680. g_ProvinceName2IndexMap.CompareMode = 1; // text compare
  1681. g_StateName2IndexMap.CompareMode = 1; // text compare
  1682. // init hash table
  1683. var ii;
  1684. for(ii=1;ii<=FullStateNames.length;ii++) {
  1685. // add both full name and abbrev to hash table
  1686. g_StateName2IndexMap.Add(FullStateNames[ii-1].toUpperCase(),ii);
  1687. g_StateName2IndexMap.Add(StateAbbrevs[ii].toUpperCase(),ii);
  1688. if(ii < ProvinceNames.length) {
  1689. g_ProvinceName2IndexMap.Add(ProvinceNames[ii].toUpperCase(),ii);
  1690. }
  1691. }
  1692. var L_Postal_Text = "Postal or <u>Z</u>IP code:";
  1693. var L_AsteriskPostal_Text = "*Postal or <u>Z</u>IP code:";
  1694. var L_Province_Text= "State/<u>P</u>rovince:";
  1695. var L_AsteriskProvince_Text= "*State/<u>P</u>rovince:";
  1696. var L_Canada_Text="Canada";
  1697. var L_UnitedStates_Text="United States";
  1698. function Reg3UserCountryChanged() {
  1699. // AGENT: notify Agent of the change
  1700. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  1701. if(g_Country == L_UnitedStates_Text) {
  1702. if(g.selUSState.style.display!="inline") {
  1703. g.selUSState.style.display="inline";
  1704. }
  1705. g.selCAProvince.style.display="none";
  1706. g.UserStateTextBox.style.display="none";
  1707. // when changing to US, try to translate any textbox string to state index
  1708. if(g.UserStateTextBox.value!="") {
  1709. var res=g_StateName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  1710. if(res!=null) {
  1711. g.selUSState.selectedIndex=res;
  1712. }
  1713. }
  1714. g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  1715. g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  1716. } else if(g_Country == L_Canada_Text) {
  1717. g.selUSState.style.display="none";
  1718. g.selCAProvince.style.display="inline";
  1719. g.UserStateTextBox.style.display="none";
  1720. // when changing to Canada, try to translate any textbox string to province index
  1721. if(g.UserStateTextBox.value!="") {
  1722. var res=g_ProvinceName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  1723. if(res!=null) {
  1724. g.selCAProvince.selectedIndex=res;
  1725. }
  1726. }
  1727. g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  1728. g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  1729. } else {
  1730. g.selUSState.style.display="none";
  1731. g.selCAProvince.style.display="none";
  1732. g.UserStateTextBox.style.display="inline";
  1733. g.LabelZIP.innerHTML = L_Postal_Text;
  1734. g.StateLabel.innerHTML = L_Province_Text;
  1735. }
  1736. g_CountryIdx=g.selCountry.selectedIndex;
  1737. Reg3UserStateChanged();
  1738. }
  1739. var L_FullName_Text="*<u>F</u>ull Name:";
  1740. function Reg3UserStateChanged() {
  1741. // AGENT: notify Agent of the change
  1742. // BUGBUG: ok for no notify on change to textbox?
  1743. if(g.selUSState.style.display!="none")
  1744. {
  1745. g_StateIdx=g.selUSState.selectedIndex;
  1746. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  1747. g.StateLabel.htmlFor="selUSState";
  1748. }
  1749. else if (g.selCAProvince.style.display!="none")
  1750. {
  1751. g_StateIdx=g.selCAProvince.selectedIndex;
  1752. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  1753. g.StateLabel.htmlFor="selCAProvince";
  1754. }
  1755. else
  1756. {
  1757. g_State = g.UserStateTextBox.value;
  1758. g.StateLabel.htmlFor="UserStateTextBox";
  1759. }
  1760. }
  1761. // store field info here:
  1762. var g_FirstName=InfoObj.get_FirstName();
  1763. //var g_MiddleName=InfoObj.get_MiddleInitial(); // InfoObj.get_MiddleName(); BUGBUG need to add this fn
  1764. var g_LastName=InfoObj.get_LastName();
  1765. var g_Address1=InfoObj.get_Address1();
  1766. var g_Address2=InfoObj.get_Address2();
  1767. var g_City=InfoObj.get_City();
  1768. var g_ZipCode=InfoObj.get_Zip();
  1769. var g_EmailAddr= InfoObj.get_PrimaryEmail();
  1770. var g_Country=InfoObj.get_Country();
  1771. var g_CountryIdx=-1;
  1772. var g_State=InfoObj.get_State();
  1773. var g_StateIdx=0;
  1774. function Reg3SaveSettings() {
  1775. g_FirstName=g.UserFirstName.value;
  1776. //g_MiddleName=g.UserMiddleName.value;
  1777. if (IsKoreanLocale())
  1778. g_LastName="";
  1779. else
  1780. g_LastName=g.UserLastName.value;
  1781. g_Address1=g.UserAddress.value;
  1782. g_Address2=g.UserAddress2.value;
  1783. g_ZipCode=g.UserZipCode.value;
  1784. g_EmailAddr=g.UserEmailAddress.value;
  1785. g_City=g.UserCity.value;
  1786. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  1787. if(g.UserStateTextBox.style.display!="none")
  1788. {
  1789. g_State=g.UserStateTextBox.value;
  1790. }
  1791. else if (g.selUSState.style.display!="none")
  1792. {
  1793. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  1794. }
  1795. else
  1796. {
  1797. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  1798. }
  1799. InfoObj.set_FirstName(g_FirstName);
  1800. InfoObj.set_LastName(g_LastName);
  1801. // InfoObj.set_MiddleInitial(g_MiddleName);
  1802. InfoObj.set_Country(g_Country);
  1803. InfoObj.set_State(g_State);
  1804. InfoObj.set_Address1(g_Address1);
  1805. InfoObj.set_Address2(g_Address2);
  1806. InfoObj.set_PrimaryEmail(g_EmailAddr);
  1807. InfoObj.set_Zip(g_ZipCode);
  1808. InfoObj.set_City(g_City);
  1809. TapiObj.set_CountryIndex(g.selCountry.selectedIndex);
  1810. InfoObj.set_CountryID(TapiObj.get_CountryID());
  1811. // Microsoft policy states that MSupdate should always be true whenever a user registers.
  1812. InfoObj.set_MSUpdate(true);
  1813. InfoObj.set_MSOffer(false);
  1814. if ((g_PostToMS==true) && (g.sharems.checked))
  1815. InfoObj.set_MSOffer(true);
  1816. InfoObj.set_OtherOffer(false);
  1817. if ((g_PostToMS==true) && (g.sharemsPartners.checked))
  1818. InfoObj.set_OtherOffer(true);
  1819. }
  1820. // We want the Reg3 checkboxes to be unchecked by default.
  1821. InfoObj.set_MSOffer(false);
  1822. InfoObj.set_OtherOffer(false);
  1823. function Reg3_LoadMe()
  1824. {
  1825. InitFrameRef();
  1826. CheckContrastMode();
  1827. GetPageTitle();
  1828. g_FirstFocusElement = g.UserFirstName;
  1829. if (IsFarEastLocale())
  1830. {
  1831. /*For JPN, CHT, CHS,
  1832. Last Name
  1833. First Name
  1834. Country/Region
  1835. Province
  1836. City
  1837. Address
  1838. Zip
  1839. E-Mail
  1840. For KOR only,
  1841. Full Name
  1842. Country/Region
  1843. Province
  1844. City
  1845. Address
  1846. Zip
  1847. E-Mail
  1848. */
  1849. g.MainPageCell.style.display="none"; // hide while we change order
  1850. // no middle name for far east langs
  1851. //g.MiddleNameRow.style.display="none";
  1852. g.FieldTable.moveRow(1,0); // move lastname in front of first
  1853. g.FieldTable.moveRow(6,2); // move country to after firstname
  1854. g.FieldTable.moveRow(6,3); // move province to after country
  1855. g.FieldTable.moveRow(6,4); // move city to after province
  1856. g.FE_ZIPLabel.innerHTML=g.LabelRight.innerHTML;
  1857. g.FE_ZIPInput.innerHTML=g.MenuRight.innerHTML;
  1858. g.FE_ZIPRow.style.display="inline";
  1859. g.LabelRight.innerHTML="";
  1860. g.MenuRight.innerHTML="";
  1861. // no reason to limit these lengths for FE, so just make them match others
  1862. g.UserZipCode.size=30;
  1863. g.UserZipCode.maxlength=120;
  1864. g.UserStateTextBox.size=30;
  1865. g.UserStateTextBox.maxlength=120;
  1866. g_FirstFocusElement = g.UserLastName;
  1867. if (IsKoreanLocale()) {
  1868. g.LastNameRow.style.display="none";
  1869. g.LabelFirstName.innerHTML=L_FullName_Text;
  1870. g_FirstFocusElement = g.UserFirstName;
  1871. }
  1872. g.MainPageCell.style.display="inline";
  1873. }
  1874. // limit width of country menu since some text options are very long
  1875. g.selCountry.style.width=g.UserEmailAddress.offsetWidth;
  1876. g.UserFirstName.value=g_FirstName;
  1877. //g.UserMiddleName.value=g_MiddleName;
  1878. g.UserLastName.value=g_LastName;
  1879. g.UserAddress.value=g_Address1;
  1880. g.UserAddress2.value=g_Address2;
  1881. g.UserZipCode.value=g_ZipCode;
  1882. g.UserEmailAddress.value=g_EmailAddr;
  1883. g.UserCity.value=g_City;
  1884. // placeholder idx 0 option is needed to fix 101447
  1885. // Due to a possible mshtml bug, the cursor is shifted right when the menu
  1886. // expands to its full width.
  1887. g.selUSState.remove(0);
  1888. for (var i = 0; i < StateAbbrevs.length; i++) {
  1889. var oOption = g.document.createElement("OPTION");
  1890. oOption.text = StateAbbrevs[i];
  1891. if (StateAbbrevs[i] == g_State)
  1892. {
  1893. g_StateIdx = i;
  1894. }
  1895. g.selUSState.add(oOption);
  1896. }
  1897. for (i = 0; i < ProvinceNames.length; i++) {
  1898. oOption = g.document.createElement("OPTION");
  1899. oOption.text = ProvinceNames[i];
  1900. if (ProvinceNames[i] == g_State)
  1901. {
  1902. g_StateIdx = i;
  1903. }
  1904. g.selCAProvince.add(oOption);
  1905. }
  1906. var fTapi = TapiObj.IsTAPIConfigured(); // init TAPI
  1907. /*
  1908. var ilen = TapiObj.get_NumOfCountry(); // get num of countries, also inits COM obj storage
  1909. for (var i = 0; i < ilen; i++)
  1910. {
  1911. var oOption = g.document.createElement("OPTION");
  1912. oOption.text = TapiObj.get_CountryNameForIndex(i);
  1913. g.selCountry.add(oOption);
  1914. }
  1915. */
  1916. g_CountryIdx = TapiObj.get_CountryIndex();
  1917. if(g_CountryIdx>=0)
  1918. {
  1919. g.selCountry.selectedIndex=g_CountryIdx;
  1920. if(g_Country == L_UnitedStates_Text)
  1921. {
  1922. g.selUSState.selectedIndex=g_StateIdx;
  1923. }
  1924. else if(g_Country == L_Canada_Text)
  1925. {
  1926. g.selCAProvince.selectedIndex=g_StateIdx;
  1927. }
  1928. else
  1929. g.UserStateTextBox.value=g_State;
  1930. }
  1931. else
  1932. {
  1933. // get default value
  1934. g.selCountry.selectedIndex = TapiObj.get_CountryIndex();
  1935. }
  1936. Reg3UserCountryChanged();
  1937. Reg3UserStateChanged();
  1938. var MSoffer_Checked = InfoObj.get_MSOffer();
  1939. if (MSoffer_Checked)
  1940. g.sharems.checked = true;
  1941. else
  1942. g.sharems.checked = false;
  1943. var MSotheroffer_Checked = InfoObj.get_OtherOffer();
  1944. if (MSotheroffer_Checked)
  1945. g.sharemsPartners.checked = true;
  1946. else
  1947. g.sharemsPartners.checked = false;
  1948. InitButtons();
  1949. g.error_mesg.innerHTML = L_RequiredField_Text;
  1950. g.error_mesg.style.display="inline";
  1951. var L_CNIL_Text = "<p>";
  1952. var L_CnilStyleDisplay_Text = "none";
  1953. g.cnil_mesg.innerHTML = L_CNIL_Text;
  1954. g.cnil_mesg.style.display=L_CnilStyleDisplay_Text;
  1955. window.setTimeout("DoFocus();",1000);
  1956. }
  1957. function GetCurrentProvince() {
  1958. if(g.selCountry.options(g.selCountry.selectedIndex).text == L_UnitedStates_Text) {
  1959. return g.selUSState.options(g.selUSState.selectedIndex).text;
  1960. } else if(g.selCountry.options(g.selCountry.selectedIndex).text == L_Canada_Text) {
  1961. return g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  1962. } else return g.UserStateTextBox.value;
  1963. }
  1964. function GetCurrentCountry() {
  1965. return g.selCountry.options(g.selCountry.selectedIndex).text;
  1966. }
  1967. var L_Email_Text="Please enter a valid E-mail address or leave the E-mail text box empty.";
  1968. var L_EnterValid_Text=" * Please fill in the required fields.";
  1969. var L_RequiredField_Text="* indicates required information";
  1970. var g_PostToMS = false;
  1971. var g_PostToOEM = false; // no oem stuff when we are in appmode.
  1972. var POST_TO_OEM = 1;
  1973. var POST_TO_MS = 2;
  1974. var bPostChkBxStateSaved = false;
  1975. // Update status pane and navigate
  1976. function ShownavigatetoPrivacy()
  1977. {
  1978. Navigate("actsetup\\aprvcyMS.htm");
  1979. SetTimerShowIFrame(100);
  1980. }
  1981. function navigatetoPrivacy(PrivPage)
  1982. {
  1983. if (g_CurrentCKPT == CKPT_REGISTER3)
  1984. Reg3SaveSettings();
  1985. if (g_CurrentCKPT == CKPT_REGISTER1)
  1986. {
  1987. if (g.rb_reg_1.checked)
  1988. g_Reg1RadioSticky = 1;
  1989. else if (g.rb_reg_2.checked)
  1990. g_Reg1RadioSticky = 2;
  1991. else
  1992. g_Reg1RadioSticky = null;
  1993. }
  1994. ShowIFrame('False');
  1995. window.setTimeout("ShownavigatetoPrivacy();",500);
  1996. }
  1997. function ShownavigatetoActPolicy()
  1998. {
  1999. Navigate("actsetup\\apolicy.htm");
  2000. SetTimerShowIFrame(100);
  2001. }
  2002. function navigatetoActPolicy()
  2003. {
  2004. if (g.rb_act_1.checked)
  2005. g_ActivationRadioSticky = 1;
  2006. else if (g.rb_act_2.checked)
  2007. g_ActivationRadioSticky = 2;
  2008. else if (g.rb_act_3.checked)
  2009. g_ActivationRadioSticky = 3;
  2010. else
  2011. g_ActivationRadioSticky = null;
  2012. ShowIFrame('False');
  2013. window.setTimeout("ShownavigatetoActPolicy();",500);
  2014. }
  2015. function VerifyReg3Fields() {
  2016. g.error_mesg.style.display="none";
  2017. var LastErrorField = null;
  2018. var CurReg3ErrStringArray = new Array();
  2019. // user needs to complete input of address/name
  2020. // this dynamically builds the list of erroneous fields to give to the user
  2021. if(g.UserEmailAddress.value != "") {
  2022. // do some validation on email address
  2023. // Note special regexpr char like '\S' must be double-\'d because they are inside a string
  2024. var re = new RegExp("^\\s*\\S+@\\S+\\.\\S\\S+","");
  2025. if(re.exec(g.UserEmailAddress.value) == null) {
  2026. LastErrorField = g.UserEmailAddress;
  2027. g.LabelEmail.className = "text-error";
  2028. } else {
  2029. g.LabelEmail.className = "text-primary";
  2030. }
  2031. }
  2032. var CurCountry=GetCurrentCountry();
  2033. // dont require state or zip except for US/Canada
  2034. if ((CurCountry == L_UnitedStates_Text)||(CurCountry == L_Canada_Text)) {
  2035. if(g.UserZipCode.value == "") {
  2036. LastErrorField = g.UserZipCode;
  2037. g.LabelZIP.className = "text-error";
  2038. } else {
  2039. g.LabelZIP.className = "text-primary";
  2040. }
  2041. if(GetCurrentProvince() == "") {
  2042. if(g.selUSState.style.display!="none") {
  2043. LastErrorField = g.selUSState;
  2044. } else {
  2045. LastErrorField = g.selCAProvince;
  2046. }
  2047. g.StateLabel.className = "text-error";
  2048. } else {
  2049. g.StateLabel.className = "text-primary";
  2050. }
  2051. }
  2052. if(g.UserCity.value == "") {
  2053. LastErrorField = g.UserCity;
  2054. g.LabelCity.className = "text-error";
  2055. } else {
  2056. g.LabelCity.className = "text-primary";
  2057. }
  2058. if(g.UserAddress.value == "") {
  2059. LastErrorField = g.UserAddress;
  2060. g.LabelAddress.className = "text-error";
  2061. } else {
  2062. g.LabelAddress.className = "text-primary";
  2063. }
  2064. if((g.UserLastName.value == "") && (g.LastNameRow.style.display!="none")) {
  2065. LastErrorField = g.UserLastName;
  2066. g.LabelLastName.className = "text-error";
  2067. } else {
  2068. g.LabelLastName.className = "text-primary";
  2069. }
  2070. if(g.UserFirstName.value == "") {
  2071. g.LabelFirstName.className = "text-error";
  2072. LastErrorField = g.UserFirstName;
  2073. } else {
  2074. g.LabelFirstName.className = "text-primary";
  2075. }
  2076. if(LastErrorField==null) {
  2077. return true;
  2078. }
  2079. // handle error
  2080. if(LastErrorField==g.UserEmailAddress) {
  2081. g.error_mesg.innerText = L_Email_Text;
  2082. } else {
  2083. g.error_mesg.innerText = L_EnterValid_Text;
  2084. }
  2085. g.error_mesg.className = "text-error";
  2086. g.error_mesg.style.display="inline";
  2087. try
  2088. {
  2089. g.btnNext.disabled=false;
  2090. }
  2091. catch(e) {}
  2092. try
  2093. {
  2094. g.btnBack.disabled=false;
  2095. }
  2096. catch(e) {}
  2097. try
  2098. {
  2099. g.btnSkip.disabled=false;
  2100. }
  2101. catch(e) {}
  2102. InitButtons();
  2103. LastErrorField.focus();
  2104. return false;
  2105. }
  2106. // Function: Start_CheckEnableNextButton
  2107. // Description: This function is called everytime a keyup
  2108. // event fires on a edit box for first, middle, or last
  2109. // name. We then see if we should enable or disable the
  2110. // next button based on if every field has a value.
  2111. // First || Last
  2112. //
  2113. function Start_CheckEnableNextButton()
  2114. {
  2115. try
  2116. {
  2117. if (g.event == null)
  2118. return;
  2119. }
  2120. catch(e)
  2121. {
  2122. return;
  2123. }
  2124. if (Start_CheckLengthRequirement() &&
  2125. Start_CheckLengthNotEqualSpaces())
  2126. {
  2127. g.btnNext.disabled = false;
  2128. }
  2129. else
  2130. {
  2131. g.btnNext.disabled = true;
  2132. }
  2133. InitButtons();
  2134. }
  2135. function Start_CheckLengthRequirement()
  2136. {
  2137. if ((g.edt_FirstName.value.length != 0) ||
  2138. (g.edt_LastName.value.length != 0))
  2139. return true;
  2140. else
  2141. return false;
  2142. }
  2143. function Start_CheckLengthNotEqualSpaces()
  2144. {
  2145. if ((g.edt_FirstName.value.length != NumberOfSpaces(g.edt_FirstName.value)) ||
  2146. (g.edt_LastName.value.length != NumberOfSpaces(g.edt_LastName.value)))
  2147. return true;
  2148. else
  2149. return false;
  2150. }
  2151. // END start.htm
  2152. //////////////////////////////////////////////////////////////////////////////////////
  2153. // General Default LoadMe function
  2154. //////////////////////////////////////////////////////////////////////////////////////
  2155. function _Default_LoadMe(SimpleBack, SimpleNext)
  2156. {
  2157. InitFrameRef();
  2158. CheckContrastMode();
  2159. if (g.btnNext != null)
  2160. g_FirstFocusElement = g.btnNext;
  2161. else if (g.btnSkip != null)
  2162. g_FirstFocusElement = g.btnSkip;
  2163. else if (g.btnBack != null)
  2164. g_FirstFocusElement = g.btnBack;
  2165. InitButtons(SimpleBack, SimpleNext);
  2166. if (g_FirstFocusElement != null)
  2167. window.setTimeout("DoFocus();",1000);
  2168. else
  2169. g.document.body.focus();
  2170. }
  2171. function New_Default_LoadMe(SimpleBack, SimpleNext)
  2172. {
  2173. InitFrameRef();
  2174. GetPageTitle();
  2175. CheckContrastMode();
  2176. if (g.btnNext != null)
  2177. g_FirstFocusElement = g.btnNext;
  2178. else if (g.btnSkip != null)
  2179. g_FirstFocusElement = g.btnSkip;
  2180. else if (g.btnBack != null)
  2181. g_FirstFocusElement = g.btnBack;
  2182. InitButtons(SimpleBack, SimpleNext);
  2183. window.setTimeout("DoFocus();",1000);
  2184. }
  2185. //////////////////////////////////////////////////////////////////////////////////////
  2186. // MISC Functions
  2187. //////////////////////////////////////////////////////////////////////////////////////
  2188. // Page Navigation
  2189. // InitCKPT, PushCKPT, PopCKPT, CKPTFromVal are meant to handle the behavior for GoBack.
  2190. // We only go back to certain pages (i.e., Mouse Tutorial, Sound Check).
  2191. // And on some of the pages, we only go back if they haven't been
  2192. // completed (i.e., EULA, PID).
  2193. //
  2194. // So, we push checkpoints if we intend to all coming back to that page.
  2195. // We pop checkpoints if we no longer want to come back (e.g., we've
  2196. // completed that page.
  2197. function InitCKPT()
  2198. {
  2199. dnCKPT[CKPT_ACTIV] = new CheckPoint("actsetup\\activ.htm", 0, 0, 0, 0);
  2200. dnCKPT[CKPT_ACTDONE] = new CheckPoint("actsetup\\actdone.htm", 0, 0, 0, 0);
  2201. dnCKPT[CKPT_ACTIVERR] = new CheckPoint("actsetup\\activerr.htm", 0, 0, 0, 0);
  2202. dnCKPT[CKPT_ACTIVSVC] = new CheckPoint("actsetup\\activsvc.htm", 0, 0, 0, 0);
  2203. dnCKPT[CKPT_REGISTER1] = new CheckPoint("actsetup\\areg1.htm", 0, 0, 0, 0);
  2204. dnCKPT[CKPT_REGISTER3] = new CheckPoint("actsetup\\ausrinfo.htm", 0, 0, 0, 0);
  2205. dnCKPT[CKPT_ACTCONN] = new CheckPoint("actsetup\\actconn.htm", 0, 0, 0, 0);
  2206. dnCKPT[CKPT_ACTLAN] = new CheckPoint("actsetup\\actlan.htm", 0, 0, 0, 0);
  2207. dnCKPT[CKPT_REGDIAL] = new CheckPoint("actsetup\\adrdyreg.htm", 0, 0, 0, 0);
  2208. dnCKPT[CKPT_ACT_MSG] = new CheckPoint("actsetup\\adeskerr.htm", 0, 0, 0, 0);
  2209. dnCKPT[CKPT_DONE] = new CheckPoint("actsetup\\aregdone.htm", 0, 0, 0, 0);
  2210. PopCKPT();
  2211. }
  2212. function PushCKPT(ckpt)
  2213. {
  2214. if (ckpt > 0 && ckpt < CKPT_MAX)
  2215. {
  2216. var tos = 0;
  2217. try
  2218. {
  2219. tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  2220. }
  2221. catch (e) {}
  2222. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString(), ckpt);
  2223. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, ++tos);
  2224. g_CurrentCKPT = ckpt;
  2225. }
  2226. }
  2227. function PopCKPT(ckptCheck)
  2228. {
  2229. var ckpt = 0;
  2230. try
  2231. {
  2232. var tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  2233. if (tos > 0)
  2234. {
  2235. ckpt = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, (tos - 1).toString());
  2236. if (null == ckptCheck || ckpt == ckptCheck)
  2237. {
  2238. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, --tos);
  2239. ApiObj.DeleteRegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString());
  2240. }
  2241. }
  2242. }
  2243. catch (e) {}
  2244. if (ckpt > 0 && ckpt < CKPT_MAX)
  2245. {
  2246. g_CurrentCKPT = ckpt;
  2247. }
  2248. else
  2249. g_CurrentCKPT = null;
  2250. }
  2251. function URLFromCKPT(ckpt)
  2252. {
  2253. var str = "";
  2254. if (ckpt > 0 && ckpt < CKPT_MAX)
  2255. {
  2256. str = dnCKPT[ckpt].strURL;
  2257. }
  2258. return str;
  2259. }
  2260. function IndexFromCKPT(ckpt, status)
  2261. {
  2262. var index = 0;
  2263. if (ckpt > 0 && ckpt < CKPT_MAX)
  2264. {
  2265. var checkpoint = dnCKPT[ckpt];
  2266. index = checkpoint.rgindex[status];
  2267. }
  2268. return index;
  2269. }
  2270. function IsLocalFile()
  2271. {
  2272. try
  2273. {
  2274. return (-1 != g.location.protocol.indexOf("file"));
  2275. }
  2276. catch (e)
  2277. {
  2278. return false;
  2279. }
  2280. }
  2281. //////////////////////////////////////////////////////////////////////////////////////
  2282. // public navigation APIs
  2283. //////////////////////////////////////////////////////////////////////////////////////
  2284. function SetBack(strURL)
  2285. {
  2286. g_OEMAddBackURL = strURL;
  2287. }
  2288. function GoCancel(ckpt)
  2289. {
  2290. trace("GoCancel: CurrentCKPT = " + g_CurrentCKPT);
  2291. try
  2292. {
  2293. if (IsLocalFile() && g.event == null)
  2294. return;
  2295. }
  2296. catch(e)
  2297. {
  2298. return;
  2299. }
  2300. DisableAllButtons();
  2301. switch (g_CurrentCKPT)
  2302. {
  2303. case CKPT_REGDIAL:
  2304. if (InActivation_AppMode())
  2305. {
  2306. g_DoActivation = false;
  2307. ShowIFrame('False');
  2308. window.setTimeout("ExitWPA();",1000);
  2309. }
  2310. else
  2311. {
  2312. GoNavigate(CKPT_DONE);
  2313. }
  2314. break;
  2315. case CKPT_REGISTER3:
  2316. g_PostToMS = false;
  2317. GoNavigate(CKPT_REGDIAL);
  2318. break;
  2319. case CKPT_ACTLAN:
  2320. ActLan();
  2321. break;
  2322. }
  2323. }
  2324. function GoBack(ckpt)
  2325. {
  2326. trace("GoBack: CurrentCKPT = " + g_CurrentCKPT);
  2327. try
  2328. {
  2329. if (IsLocalFile() && g.event == null)
  2330. return;
  2331. }
  2332. catch(e)
  2333. {
  2334. return;
  2335. }
  2336. DisableAllButtons();
  2337. if (g_CurrentCKPT == g_DialCKPT)
  2338. ResetDialing();
  2339. if(g_CurrentCKPT == CKPT_REGISTER1)
  2340. {
  2341. if (g.rb_reg_1.checked)
  2342. g_Reg1RadioSticky = 1;
  2343. else if (g.rb_reg_2.checked)
  2344. g_Reg1RadioSticky = 2;
  2345. else
  2346. g_Reg1RadioSticky = null;
  2347. }
  2348. if(g_CurrentCKPT == CKPT_REGISTER3)
  2349. {
  2350. Reg3SaveSettings(); // save field settings in case we return to page
  2351. }
  2352. var ckptPrevious = g_CurrentCKPT;
  2353. PopCKPT();
  2354. if (ckptPrevious == g_CurrentCKPT)
  2355. {
  2356. // This handles the case where the current page pushed itself on the stack.
  2357. PopCKPT();
  2358. }
  2359. if (g_CurrentCKPT > 0 && g_CurrentCKPT < CKPT_MAX)
  2360. {
  2361. GoNavigate(g_CurrentCKPT);
  2362. }
  2363. }
  2364. function StatusNavigate()
  2365. {
  2366. var iMove = IndexFromCKPT(g_CurrentCKPT, g_status) - window.external.get_StatusIndex;
  2367. while (iMove > 0)
  2368. {
  2369. window.external.MoveNext();
  2370. --iMove;
  2371. }
  2372. while (iMove < 0)
  2373. {
  2374. window.external.MovePrevious();
  2375. ++iMove;
  2376. }
  2377. }
  2378. ////////////////////////////////////////////////////////////////////
  2379. // DON'T MUCK WITH THE POSITIONING OF THE CASES IN THE SWITCHS BELOW
  2380. ////////////////////////////////////////////////////////////////////
  2381. function ShowGoNavigate()
  2382. {
  2383. var ckptGoHere = g_ckpt_target;
  2384. switch (ckptGoHere)
  2385. {
  2386. case CKPT_REGDIAL:
  2387. trace("GoNavigate: CKPT_REGDIAL");
  2388. // Check if we are already connected
  2389. ResetConnectedToInternetEx();
  2390. if (!ConnectedToInternetEx(true))
  2391. {
  2392. // If not, try AutoDial
  2393. g_InitAutodial = window.external.InternetAutodial();
  2394. if (!g_InitAutodial)
  2395. {
  2396. // We can't assume user has modem here
  2397. if (HasNetwork() && HasModem())
  2398. {
  2399. GoNavigate(CKPT_ACTCONN);
  2400. }
  2401. else if (HasNetwork())
  2402. {
  2403. GoNavigate(CKPT_ACTLAN);
  2404. }
  2405. else if (HasModem())
  2406. {
  2407. PushCKPT(ckptGoHere); // sets g_CurrentCKPT = ckptGoHere;
  2408. Navigate(URLFromCKPT(CKPT_REGDIAL));
  2409. }
  2410. else
  2411. {
  2412. GoNavigate(CKPT_ACTIVERR);
  2413. }
  2414. SetTimerShowIFrame(15000);
  2415. break;
  2416. }
  2417. else
  2418. {
  2419. g_Internet = INTERNET_YES;
  2420. }
  2421. }
  2422. IcsConnect(ICS_CONN_TYPE_REG);
  2423. SetTimerShowIFrame(ACTIVATION_TIMEOUT);
  2424. break;
  2425. case CKPT_ACT_MSG:
  2426. trace("GoNavigate: CKPT_ACT_MSG");
  2427. PushCKPT(ckptGoHere); // sets g_CurrentCKPT = ckptGoHere;
  2428. Navigate(URLFromCKPT(ckptGoHere));
  2429. SetTimerShowIFrame(5000);
  2430. break;
  2431. default:
  2432. trace("GoNavigate: default (" + ckptGoHere + " = " +
  2433. URLFromCKPT(ckptGoHere) + ")");
  2434. PushCKPT(ckptGoHere); // sets g_CurrentCKPT = ckptGoHere;
  2435. Navigate(URLFromCKPT(ckptGoHere));
  2436. SetTimerShowIFrame(1200);
  2437. break;
  2438. }
  2439. }
  2440. var g_ckpt_target = null;
  2441. var g_AfterConnectionDone = false;
  2442. function GoNavigate(ckptGoHere)
  2443. {
  2444. try
  2445. {
  2446. if (g_bStartup == false)
  2447. {
  2448. if (IsLocalFile())
  2449. {
  2450. if (g.event != null)
  2451. {
  2452. g.event.returnValue = false;
  2453. g.event.cancelBubble = true;
  2454. }
  2455. }
  2456. }
  2457. else
  2458. g_bStartup = false;
  2459. }
  2460. catch(e)
  2461. {
  2462. return;
  2463. }
  2464. g_ckpt_target = ckptGoHere;
  2465. var L_GeneratingInstall_Text = "Generating new Installation ID...";
  2466. var L_RetrievingCountry_Text = "Retrieving Installation ID...";
  2467. var L_ValidatingConn_Text = "Verifying activation...";
  2468. if (ckptGoHere==CKPT_REGDIAL)
  2469. {
  2470. ShowIFrame('False', L_CheckConnectivity_Text);
  2471. Span_WPA_MainTitle.innerText = L_BlankTitle_Text;
  2472. }
  2473. else if (ckptGoHere==CKPT_ACTIVSVC)
  2474. {
  2475. if (g_ActivSvc_Reload)
  2476. {
  2477. if (g_Load_InstallID)
  2478. ShowIFrame('False', L_GeneratingInstall_Text);
  2479. else
  2480. ShowIFrame('False', L_RetrievingCountry_Text);
  2481. Span_WPA_MainTitle.innerText = L_BlankTitle_Text;
  2482. }
  2483. else
  2484. {
  2485. g_ActivSvc_Reload = true;
  2486. }
  2487. }
  2488. else if (ckptGoHere==CKPT_ACT_MSG)
  2489. {
  2490. if (g_AfterConnectionDone)
  2491. {
  2492. g_AfterConnectionDone = false;
  2493. ShowIFrame('False', L_ValidatingConn_Text);
  2494. Span_WPA_MainTitle.innerText = L_BlankTitle_Text;
  2495. }
  2496. else
  2497. ShowIFrame('False');
  2498. }
  2499. else
  2500. {
  2501. ShowIFrame('False');
  2502. }
  2503. window.setTimeout("ShowGoNavigate();",500);
  2504. }
  2505. function ExitWPA()
  2506. {
  2507. window.external.Finish();
  2508. }
  2509. // Description: Disable all the buttons
  2510. // Used to prevent script error caused by
  2511. // double clicking or rapid clicking
  2512. // of two different buttons. E.g. when someone click
  2513. // next and back quickly.
  2514. //
  2515. function DisableAllButtons()
  2516. {
  2517. g.document.body.style.cursor="wait";
  2518. try
  2519. {
  2520. g.btnNext.className="buttons-disabled";
  2521. g.btnNext.disabled=true;
  2522. }
  2523. catch(e) {}
  2524. try
  2525. {
  2526. g.btnBack.className="buttons-disabled";
  2527. g.btnBack.disabled=true;
  2528. }
  2529. catch(e) {}
  2530. try
  2531. {
  2532. g.btnSkip.className="buttons-disabled";
  2533. g.btnSkip.disabled=true;
  2534. }
  2535. catch(e) {}
  2536. try
  2537. {
  2538. g.btnProdkey.className="buttons-disabled";
  2539. g.btnProdkey.disabled=true;
  2540. }
  2541. catch(e) {}
  2542. try
  2543. {
  2544. g.btnQuit.className="buttons-disabled";
  2545. g.btnQuit.disabled=true;
  2546. }
  2547. catch(e) {}
  2548. try
  2549. {
  2550. g.btnTelephone.className="buttons-disabled";
  2551. g.btnTelephone.disabled=true;
  2552. }
  2553. catch(e) {}
  2554. }
  2555. function GoQuit()
  2556. {
  2557. trace("GoQuit: CurrentCKPT = " + g_CurrentCKPT);
  2558. // var L_strCloseWindow_Text ="Click OK to exit registration reminder.";
  2559. // if (confirm(L_strCloseWindow_Text))
  2560. DisableAllButtons();
  2561. window.external.Finish();
  2562. }
  2563. function GoNext()
  2564. {
  2565. trace("GoNext: CurrentCKPT = " + g_CurrentCKPT);
  2566. try
  2567. {
  2568. if (IsLocalFile() && g.event == null)
  2569. return;
  2570. }
  2571. catch(e)
  2572. {
  2573. return;
  2574. }
  2575. DisableAllButtons();
  2576. switch (g_CurrentCKPT)
  2577. {
  2578. case CKPT_ACTIV:
  2579. if (g.rb_act_1.checked)
  2580. {
  2581. g_ActivationRadioSticky = 1;
  2582. g_DoActivation = true;
  2583. if (CheckForAnyConnection())
  2584. {
  2585. if (TapiObj.IsTapiServiceRunning())
  2586. {
  2587. GoNavigate(CKPT_REGISTER1);
  2588. }
  2589. else
  2590. {
  2591. GoNavigate(CKPT_REGDIAL);
  2592. }
  2593. }
  2594. else
  2595. {
  2596. g_PostToMS = false;
  2597. GoNavigate(CKPT_ACTIVERR);
  2598. }
  2599. }
  2600. else if (g.rb_act_2.checked)
  2601. {
  2602. g_ActivationRadioSticky = 2;
  2603. g_DoActivation = false;
  2604. g_CameFromFirstPage = true;
  2605. GoNavigate(CKPT_ACTIVSVC);
  2606. }
  2607. else
  2608. {
  2609. g_ActivationRadioSticky = 3;
  2610. g_DoActivation = false;
  2611. ShowIFrame('False');
  2612. window.setTimeout("ExitWPA();",1000);
  2613. }
  2614. break;
  2615. case CKPT_REGISTER1:
  2616. if (g.rb_reg_1.checked)
  2617. {
  2618. g_Reg1RadioSticky = 1;
  2619. g_PostToMS = true;
  2620. GoNavigate(CKPT_REGISTER3);
  2621. }
  2622. else
  2623. {
  2624. g_Reg1RadioSticky = 2;
  2625. g_PostToMS = false;
  2626. GoNavigate(CKPT_REGDIAL);
  2627. }
  2628. break;
  2629. case CKPT_ACTIVERR:
  2630. GoNavigate(CKPT_ACTIVSVC);
  2631. break;
  2632. case CKPT_ACTIVSVC:
  2633. GoNavigate(CKPT_DONE);
  2634. break;
  2635. case CKPT_REGISTER3:
  2636. if(VerifyReg3Fields())
  2637. {
  2638. Reg3SaveSettings();
  2639. GoNavigate(CKPT_REGDIAL);
  2640. }
  2641. break;
  2642. case CKPT_ACTCONN:
  2643. if (g.rb_conn_lan.checked)
  2644. {
  2645. g_ActConnRadioSticky = 1;
  2646. GoNavigate(CKPT_ACTLAN);
  2647. }
  2648. else
  2649. {
  2650. g_ActConnRadioSticky = 2;
  2651. PushCKPT(CKPT_REGDIAL);
  2652. Navigate(URLFromCKPT(CKPT_REGDIAL));
  2653. }
  2654. break;
  2655. case CKPT_ACTLAN:
  2656. ProxySettingsObj.UseAuto = g.cb_auto_detect.checked;
  2657. ProxySettingsObj.UseProxy = g.cb_use_proxy.checked;
  2658. ProxySettingsObj.Server = g.txt_proxy_url.value;
  2659. ProxySettingsObj.Port = g.txt_proxy_port.value;
  2660. window.external.set_ProxySettings(
  2661. ProxySettingsObj.UseAuto,
  2662. ProxySettingsObj.UseScript,
  2663. ProxySettingsObj.ScriptUrl,
  2664. ProxySettingsObj.UseProxy,
  2665. ProxySettingsObj.Server + ((ProxySettingsObj.Port == "") ? "" : (":" + ProxySettingsObj.Port))
  2666. );
  2667. ActLan();
  2668. break;
  2669. case CKPT_REGDIAL:
  2670. GoNavigate(CKPT_DONE);
  2671. break;
  2672. case CKPT_ACT_MSG:
  2673. if ( g_ActivationStatus != ERR_ACT_SUCCESS )
  2674. {
  2675. GoNavigate(CKPT_ACTIVSVC);
  2676. break;
  2677. }
  2678. // Fall through
  2679. case CKPT_DONE:
  2680. window.external.Finish();
  2681. break;
  2682. default:
  2683. // BUGBUG should we remove the default altogether?
  2684. break;
  2685. }
  2686. }
  2687. // BUGBUG temporary until MSN changes code
  2688. function GoOffline()
  2689. {
  2690. GoNext();
  2691. }
  2692. // Button Event Handlers and Initialization
  2693. function SetLastButtonText()
  2694. {
  2695. if (g.btnNext != null)
  2696. g_LastButtonText = g.btnNextText;
  2697. else if (g.btnBack != null)
  2698. g_LastButtonText = g.btnBackText;
  2699. else if (g.btnRestore != null)
  2700. g_LastButtonText = g.btnRestoreText;
  2701. else if (g.btnCancel != null)
  2702. g_LastButtonText = g.btnCancelText;
  2703. }
  2704. // Function: InitFrameRef
  2705. // Description: Sets up globals to point to buttons
  2706. // Since the buttons exist on the child frame,
  2707. // we want to have quick access to them without
  2708. // going through the collections.
  2709. // WARNING: Call this function at the top of XXX_LoadMe()
  2710. //
  2711. function InitFrameRef()
  2712. {
  2713. g_LastButtonText = null;
  2714. g_FirstFocusElement = null;
  2715. g_LastKeyDown = null;
  2716. g = document.frames("msoobeMain");
  2717. g.document.body.style.backgroundColor = "transparent";
  2718. try
  2719. {
  2720. g.document.body.onkeydown = OnKeyDown;
  2721. SetLastButtonText();
  2722. }
  2723. catch(e){}
  2724. }
  2725. function HideButtons(buttons)
  2726. {
  2727. if (null != g.btnBack && (buttons & HIDE_BACK))
  2728. {
  2729. g.btnBack.Hide = true;
  2730. }
  2731. if (null != g.btnNext && (buttons & HIDE_NEXT))
  2732. {
  2733. g.btnNext.Hide = true;
  2734. }
  2735. if (null != g.spanCancel && (buttons & HIDE_CANCEL))
  2736. {
  2737. g.btnSkip.Hide = true;
  2738. }
  2739. if (null != g.spanRestore && (buttons & HIDE_RESTORE))
  2740. {
  2741. g.btnRestore.Hide = true;
  2742. }
  2743. }
  2744. function HandleButtonMouseOver()
  2745. {
  2746. // if((!this.disabled)&&(this.tagName=="BUTTON"))
  2747. // this.className="buttons-hover";
  2748. }
  2749. function HandleButtonMouseOut()
  2750. {
  2751. // if((!this.disabled)&&(this.tagName=="BUTTON"))
  2752. // this.className="buttons";
  2753. }
  2754. function InitButtons(SimpleBack, SimpleNext)
  2755. {
  2756. if(g.btnSkip!=null) {
  2757. g.btnSkip.onmouseover = HandleButtonMouseOver;
  2758. g.btnSkip.onmouseout = HandleButtonMouseOut;
  2759. if(!g.btnSkip.disabled) {
  2760. g.btnSkip.onclick = GoCancel;
  2761. // dont enable onfocus,onblur handlers until issues in 88615 are resolved
  2762. // g.btnSkip.onfocus = HandleButtonMouseOver;
  2763. // g.btnSkip.onblur = HandleButtonMouseOut;
  2764. g.btnSkip.className="buttons";
  2765. } else {
  2766. g.btnSkip.className="buttons-disabled";
  2767. }
  2768. }
  2769. if (g.btnNext != null)
  2770. {
  2771. g.btnNext.onmouseover = HandleButtonMouseOver;
  2772. g.btnNext.onmouseout = HandleButtonMouseOut;
  2773. if (!g.btnNext.disabled)
  2774. {
  2775. if (SimpleNext == null)
  2776. {
  2777. g.btnNext.onclick = GoNext;
  2778. }
  2779. else
  2780. {
  2781. g.btnNext.onclick = SimpleNavNext;
  2782. }
  2783. g.btnNext.className="buttons";
  2784. }
  2785. else
  2786. {
  2787. g.btnNext.className="buttons-disabled";
  2788. }
  2789. }
  2790. if (g.btnBack != null)
  2791. {
  2792. g.btnBack.onmouseover = HandleButtonMouseOver;
  2793. g.btnBack.onmouseout = HandleButtonMouseOut;
  2794. if (!g.btnBack.disabled)
  2795. {
  2796. if (SimpleBack == null)
  2797. {
  2798. g.btnBack.onclick = GoBack;
  2799. }
  2800. else
  2801. {
  2802. g.btnBack.onclick = SimpleNavBack;
  2803. }
  2804. g.btnBack.className="buttons";
  2805. }
  2806. else
  2807. {
  2808. g.btnBack.className="buttons-disabled";
  2809. }
  2810. }
  2811. try
  2812. {
  2813. if(g.btnQuit != null) {
  2814. g.btnQuit.onmouseover = HandleButtonMouseOver;
  2815. g.btnQuit.onmouseout = HandleButtonMouseOut;
  2816. if(g.btnQuit.disabled == false) {
  2817. g.btnQuit.onclick = GoQuit;
  2818. g.btnQuit.className="buttons";
  2819. } else {
  2820. g.btnQuit.className="buttons-disabled";
  2821. }
  2822. }
  2823. } catch(e) {}
  2824. window.setTimeout("EnableDefaultCursor();",500);
  2825. }
  2826. function EnableDefaultCursor()
  2827. {
  2828. g.document.body.style.cursor="default";
  2829. }
  2830. var g_LastKeyDown = null;
  2831. function OnKeyDown()
  2832. {
  2833. try
  2834. {
  2835. if (IsLocalFile() && g.event == null)
  2836. return;
  2837. }
  2838. catch(e)
  2839. {
  2840. return;
  2841. }
  2842. if (g.event.altKey)
  2843. {
  2844. g_LastKeyDown = String.fromCharCode(g.event.keyCode);
  2845. if (g_LastKeyDown != null)
  2846. g_LastKeyDown = g_LastKeyDown.toUpperCase();
  2847. }
  2848. else
  2849. g_LastKeyDown = null;
  2850. }
  2851. // VALIDATION ROUTINES
  2852. function KeyPressIsNumeric()
  2853. {
  2854. try
  2855. {
  2856. if (IsLocalFile() && g.event == null)
  2857. return;
  2858. }
  2859. catch(e)
  2860. {
  2861. return;
  2862. }
  2863. if (!IsNumeric(g.event.keyCode))
  2864. {
  2865. g.event.keyCode = 0;
  2866. g.event.returnValue = false;
  2867. }
  2868. }
  2869. function IsNumeric(keyCode)
  2870. {
  2871. if ((keyCode >= 48/*0*/) && (keyCode <= 57/*9*/))
  2872. return true;
  2873. else
  2874. return false;
  2875. }
  2876. function IsSpecial(keyCode)
  2877. {
  2878. // BUGBUG DISABLED FOR BETA
  2879. /*
  2880. var bFound = false;
  2881. var iPosition = 0;
  2882. for (;iPosition < g_SpecialChars.length; iPosition++)
  2883. {
  2884. if (g_SpecialChars.charCodeAt(iPosition) == keyCode)
  2885. {
  2886. bFound = true;
  2887. break;
  2888. }
  2889. }
  2890. return bFound;
  2891. */
  2892. return false;
  2893. }
  2894. function KeyPressIsValid()
  2895. {
  2896. try
  2897. {
  2898. if (IsLocalFile() && g.event == null)
  2899. return;
  2900. }
  2901. catch(e)
  2902. {
  2903. return;
  2904. }
  2905. if (!IsAlpha(g.event.keyCode) &&
  2906. !IsSpecial(g.event.keyCode) &&
  2907. !IsNumeric(g.event.keyCode))
  2908. {
  2909. g.event.keyCode = 0;
  2910. g.event.returnValue = false;
  2911. }
  2912. }
  2913. function KeyPressIsAlpha()
  2914. {
  2915. try
  2916. {
  2917. if (IsLocalFile() && g.event == null)
  2918. return;
  2919. }
  2920. catch(e)
  2921. {
  2922. return;
  2923. }
  2924. if (!IsAlpha(g.event.keyCode))
  2925. {
  2926. g.event.keyCode = 0;
  2927. g.event.returnValue = false;
  2928. }
  2929. }
  2930. function IsAlpha(keyCode)
  2931. {
  2932. // BUGBUG DISABLED FOR BETA
  2933. /*
  2934. var strKeyCode = String.fromCharCode(keyCode);
  2935. var re1 = new RegExp("\w");
  2936. var re2 = new RegExp("\D");
  2937. strKeyCode.match(re1);
  2938. strKeyCode.match(re2);
  2939. //return ((strKeyCode.match(re1) != null) && (strKeyCode.match(re2) != null));
  2940. */
  2941. // if ((keyCode >= 97/*a*/ && keyCode <= 122/*z*/) ||
  2942. // (keyCode >= 65/*A*/ && keyCode <= 90 /*Z*/))
  2943. return true;
  2944. // else
  2945. // return false;
  2946. }
  2947. function NumberOfSpaces(strValue)
  2948. {
  2949. /*
  2950. var NASexp = RegExp("\s");
  2951. var result = strValue.match(NASexp);
  2952. return ((result == null) || (result.length != strValue.length));
  2953. */
  2954. var iSpaceCount = 0;
  2955. for (iPosition = 0; iPosition < strValue.length; iPosition ++)
  2956. {
  2957. if (strValue.charAt(iPosition) == ' ')
  2958. {
  2959. iSpaceCount++;
  2960. }
  2961. }
  2962. return iSpaceCount;
  2963. }
  2964. function KeyCodeToUpper()
  2965. {
  2966. var strKeyCode = String.fromCharCode(g.event.keyCode);
  2967. strKeyCode = strKeyCode.toUpperCase();
  2968. g.event.keyCode = strKeyCode.charCodeAt(0);
  2969. }
  2970. // END VALIDATION ROUTINES
  2971. var vCurItem = 0;
  2972. function SetupPageLayout()
  2973. {
  2974. var WPAWindowHeight = document.body.clientHeight;
  2975. var WPAWindowWidth = document.body.clientWidth;
  2976. if(0 != window.external.Directions.get_AppMode())
  2977. {
  2978. document.all.ifrmMainFrame.style.height = WPAWindowHeight - 93;
  2979. document.all.ifrmMainFrame.style.width = WPAWindowWidth;
  2980. }
  2981. WPABackground.src = 'images/wpaback.jpg';
  2982. WPAKey.src = 'images/wpakey.jpg';
  2983. WPATop.src = 'images/wpatop.jpg';
  2984. WPABottom.src = 'images/wpabtm.jpg';
  2985. WPAFlag.src = 'images/wpaflag.jpg';
  2986. WPABottom.style.top = WPAWindowHeight - 45;
  2987. WPAKey.style.left = WPAWindowWidth - 237;
  2988. WPAKey.style.top = WPAWindowHeight - 315;
  2989. }
  2990. function CheckForAnyConnection()
  2991. {
  2992. var Capabilities = GetConnectionCapabilities();
  2993. return (Capabilities != CONNECTIONTYPE_INVALID &&
  2994. Capabilities != CONNECTIONTYPE_NONE);
  2995. }
  2996. var g_fSIFTimer = false;
  2997. var g_iSIFTimerID;
  2998. function SetTimerShowIFrame(iMilliSeconds)
  2999. {
  3000. // This function is intended to wrap SetTimer calls to ShowIFrame
  3001. // so that we don't get multiple overlapping calls to Show the IFrame
  3002. if (g_fSIFTimer)
  3003. {
  3004. try
  3005. {
  3006. window.clearTimeout(g_iSIFTimerID);
  3007. }
  3008. catch(e) {}
  3009. g_fSIFTimer = false;
  3010. }
  3011. g_iSIFTimerID = window.setTimeout("ShowIFrame();", iMilliSeconds);
  3012. g_fSIFTimer = true;
  3013. }
  3014. var g_ShowTransition = false;
  3015. function ShowIFrame(ShowIt, loadingstatus)
  3016. {
  3017. // Kill an existing timers
  3018. if (g_fSIFTimer)
  3019. {
  3020. try
  3021. {
  3022. window.clearTimeout(g_iSIFTimerID);
  3023. }
  3024. catch(e) {}
  3025. g_fSIFTimer = false;
  3026. }
  3027. if (g_ShowTransition)
  3028. {
  3029. WPATransContainer.filters[0].Apply();
  3030. }
  3031. if (ShowIt == null)
  3032. {
  3033. // Show Iframe
  3034. WPA_DIV2.style.visibility="visible";
  3035. WPA_DIV1.style.visibility="hidden";
  3036. PageStatus.style.visibility="hidden";
  3037. WPAProgressbar.style.visibility = "hidden";
  3038. if (g_ShowTransition)
  3039. {
  3040. WPATransContainer.filters[0].Play();
  3041. }
  3042. }
  3043. else
  3044. {
  3045. // Hide Iframe
  3046. WPA_DIV2.style.visibility="hidden";
  3047. WPA_DIV1.style.visibility="visible";
  3048. if (g_ShowTransition)
  3049. {
  3050. WPATransContainer.filters[0].Play();
  3051. }
  3052. // Show progress text...
  3053. if (loadingstatus!=null)
  3054. {
  3055. PageStatus.style.visibility="visible";
  3056. PageStatus.innerHTML=loadingstatus;
  3057. WPAProgressbar.style.visibility = "hidden"; // lets hide this for now...
  3058. }
  3059. else
  3060. {
  3061. PageStatus.style.visibility="hidden";
  3062. WPAProgressbar.style.visibility = "hidden";
  3063. }
  3064. }
  3065. }
  3066. window.onresize = SetupPageLayout;
  3067. var g_Already_Activated;
  3068. function InitApplication()
  3069. {
  3070. // Make sure all the services have started up
  3071. window.external.ComputerNameChangeComplete(false);
  3072. WPATransContainer.style.display="inline";
  3073. try
  3074. {
  3075. g_Already_Activated = window.external.NeedActivation();
  3076. }
  3077. catch(e)
  3078. {
  3079. g_Already_Activated = 999;
  3080. }
  3081. // 0 means activation is not needed or has already occurred.
  3082. if (g_Already_Activated == 0)
  3083. {
  3084. // If we're here, Windows is already activated and all we need is to show CKPT_ACTDONE.
  3085. SetupPageLayout();
  3086. InitFrameRef();
  3087. g_status = STATUS_OFF;
  3088. g_DoActivation = false;
  3089. InitCKPT();
  3090. if (0 != DirObj.get_AppMode)
  3091. {
  3092. do
  3093. {
  3094. PopCKPT();
  3095. }
  3096. while (null != g_CurrentCKPT);
  3097. }
  3098. GoNavigate(CKPT_ACTDONE);
  3099. SetTimerShowIFrame(900);
  3100. }
  3101. else if (g_Already_Activated == 999)
  3102. {
  3103. window.external.Finish();
  3104. }
  3105. else
  3106. {
  3107. SetupPageLayout();
  3108. g_bStartup = true;
  3109. InitFrameRef();
  3110. GetConnectionCapabilities();
  3111. g_status = STATUS_OFF;
  3112. g_DoActivation = true;
  3113. CheckForAnyConnection();
  3114. InitCKPT();
  3115. // if we are in appmode, we must nuke the stack and restart each time
  3116. if (0 != DirObj.get_AppMode)
  3117. {
  3118. do
  3119. {
  3120. PopCKPT();
  3121. }
  3122. while (null != g_CurrentCKPT);
  3123. }
  3124. GoNavigate(CKPT_ACTIV);
  3125. SetTimerShowIFrame(900);
  3126. }
  3127. }
  3128. function loadTransitionFilter()
  3129. {
  3130. document.all.WPATransContainer.style.display = "none";
  3131. document.all.WPATransContainer.style.position = "absolute";
  3132. document.all.WPATransContainer.style.top = 0;
  3133. document.all.WPATransContainer.style.left = 0;
  3134. document.all.WPATransContainer.style.width = "100%";
  3135. document.all.WPATransContainer.style.height = "100%";
  3136. if ((window.screen.colordepth >= 16) && window.external.UseFadeEffect())
  3137. {
  3138. document.all.WPATransContainer.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.2,overlap=0.8)";
  3139. try
  3140. {
  3141. if (WPATransContainer.filters[0])
  3142. {
  3143. g_ShowTransition = true;
  3144. }
  3145. }
  3146. catch(e)
  3147. {
  3148. }
  3149. }
  3150. }
  3151. </script>
  3152. </HEAD>
  3153. <BODY topMargin=0 bgcolor="#4E6FD6" leftMargin=0 onload="loadTransitionFilter();InitApplication();" scroll=no tabIndex=-1 rightMargin=0>
  3154. <!-- WPA images, dynamic layout positioning will be done in SetupPageLayout() function -->
  3155. <IMG ID=WPABackground style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-99;" alt="">
  3156. <IMG ID=WPAKey style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-98;" alt="">
  3157. <IMG ID=WPATop style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-97;" alt="">
  3158. <IMG ID=WPABottom style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-96;" alt="">
  3159. <!-- Don't alter this table structure. It's designed to support BiDi and Non-BiDi. -->
  3160. <TABLE WIDTH="95%" BORDER=0 style="POSITION: absolute; LEFT: 20px; TOP: 0px;" CELLPADDING=0 CELLSPACING=0>
  3161. <TR>
  3162. <TD nowrap VALIGN=MIDDLE>
  3163. <SPAN id=Span_WPA_MainTitle class="title" style="height: 28px;" tabIndex=-1>
  3164. </SPAN>
  3165. </TD>
  3166. <TD WIDTH="99%">&nbsp;
  3167. </TD>
  3168. <TD VALIGN=TOP>
  3169. <IMG ID=WPAFlag alt="">
  3170. </TD>
  3171. </TR>
  3172. </TABLE>
  3173. <span ID="WPATransContainer">
  3174. <!-- First Content (by design, don't remove) -->
  3175. <span ID="WPA_DIV1" STYLE="POSITION: absolute; left:0; top:0; width=100%; height=100%; background-Color: transparent;">
  3176. <table border=0 width="100%" height="100%" class="text-primary">
  3177. <tr>
  3178. <td valign=middle align=center>
  3179. <span id=PageStatus></span>
  3180. <br>
  3181. <span id=WPAProgressbar style="visibility:hidden;"><img src="images/progress.gif"></span>
  3182. </td>
  3183. </tr>
  3184. </table>
  3185. </span>
  3186. <!-- Actual Content -->
  3187. <span id="WPA_DIV2" style="visibility: hidden; POSITION: absolute; LEFT: 0px; TOP: 48px; width=100%; height=100%;" tabIndex=-1>
  3188. <IFRAME ALLOWTRANSPARENCY="true" frameBorder=no width="100%" height="100%" id=ifrmMainFrame name=msoobeMain src="about:blank" tabIndex=0></IFRAME>
  3189. </span>
  3190. </span>
  3191. </BODY>
  3192. </HTML>