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.

1981 lines
43 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="regsetup\regstyl.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. var STATUS_MSN = 0;
  12. var STATUS_OEM = 1;
  13. var STATUS_NONE = 2;
  14. var STATUS_OFF = 3;
  15. var STATUS_MAX = 4;
  16. var SNDX_WELCOME = 0;
  17. var SNDX_MSN_ISP = 1;
  18. var SNDX_MSN_REG = 2;
  19. var SNDX_MSN_FINISH = 3;
  20. var SNDX_OEM_REG = 1;
  21. var SNDX_OEM_ISP = 2;
  22. var SNDX_OEM_FINISH = 3;
  23. var SNDX_NONE_REG = 1;
  24. var SNDX_NONE_FINISH = 2;
  25. var SNDX_OFF_EULA = 1;
  26. var SNDX_OFF_PID = 2;
  27. var SNDX_OFF_FINISH = 3;
  28. function CheckPoint(strURL, i1, i2, i3, i4)
  29. {
  30. this.strURL = strURL;
  31. this.rgindex = new Array(STATUS_MAX);
  32. this.rgindex[STATUS_MSN] = i1;
  33. this.rgindex[STATUS_OEM] = i2;
  34. this.rgindex[STATUS_NONE] = i3;
  35. this.rgindex[STATUS_OFF] = i4;
  36. }
  37. var CONNECTED_REFFERAL = 1;
  38. var CONNECTED_ISP_SIGNUP = 2;
  39. var CONNECTED_ISP_MIGRATE = 3;
  40. var CONNECTED_REGISTRATION = 4;
  41. var CKPT_REGRMIND = 1;
  42. var CKPT_REGISTER3 = 2;
  43. var CKPT_REGCONN = 3;
  44. var CKPT_REGLAN = 4;
  45. var CKPT_REGDIAL = 5;
  46. var CKPT_ACT_MSG = 6;
  47. var CKPT_DONE = 7;
  48. var CKPT_MAX = 8;
  49. var CKPT_ISPDIAL = CKPT_MAX;
  50. var CKPT_REFDIAL = CKPT_MAX;
  51. var CKPT_MIGDIAL = CKPT_MAX;
  52. var CKPT_REGISTER1 = CKPT_MAX;
  53. var CKPT_ISPSIGNUP = CKPT_DONE;
  54. var dnCKPT = new Array(CKPT_MAX);
  55. var g_CurrentCKPT = null;
  56. var g_DialCKPT = null;
  57. var HKEY_LOCAL_MACHINE = 0x80000002;
  58. var OOBE_MAIN_REG_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OOBE";
  59. var CKPT_REG_KEY = "\\CKPT";
  60. var TOS_REG_VALUE = "TOS";
  61. var ERR_COMM_NO_ERROR = 0;
  62. var ERR_COMM_OOBE_COMP_MISSING = 1;
  63. var ERR_COMM_UNKNOWN = 2;
  64. var ERR_COMM_NOMODEM = 3;
  65. var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
  66. var DERR_DIALTONE = 680;
  67. var DERR_BUSY = 676;
  68. var DERR_VOICEANSWER = 677;
  69. var DERR_NOANSWER = 678;
  70. var DERR_NO_CARRIER = 679;
  71. var DERR_HARDWARE_FAILURE = 630;
  72. var DERR_PORT_ALREADY_OPEN = 602;
  73. var DERR_PORT_OR_DEVICE = 692;
  74. var DERR_PPP_TIMEOUT = 718;
  75. var DERR_REMOTE_DISCONNECT = 629;
  76. var FINISH_OK = 0x00000000;
  77. var FINISH_REBOOT = 0x00000001;
  78. var FINISH_BAD_PID = 0x00000002;
  79. var FINISH_BAD_EULA = 0x00000004;
  80. var FINISH_BAD_STAMP = 0x00000008;
  81. var LANGUAGE_REBOOT_NEVER = 0;
  82. var LANGUAGE_REBOOT_NOW = 1;
  83. var LANGUAGE_REBOOT_END = 2;
  84. var HIDE_BACK = 0x0001;
  85. var HIDE_NEXT = 0x0002;
  86. var HIDE_CANCEL = 0x0004;
  87. var HIDE_RESTORE = 0x0008;
  88. var NOLAUNCHISPSIGNUP = "{C37D92A5-CA34-11d2-B71C-00C04F794977}";
  89. var MSNCOMPLETED = "{1C0A22F2-CB6B-11d2-B544-00A0C949DA70}";
  90. var TapiObj = null;
  91. var InfoObj = null;
  92. var EulaObj = null;
  93. var LangObj = null;
  94. var PidObj = null;
  95. var StatusObj = null;
  96. var DirObj = null;
  97. var ApiObj = null;
  98. var RegisterObj = null;
  99. var g_strISPFile = "";
  100. var g_bStartup;
  101. var g_LastButtonText = null;
  102. var g_FirstFocusElement = null;
  103. var g = null;
  104. var g_SpecialChars = ".'-` ";
  105. var g_OOBEDir = "file://" + window.external.API.get_SystemDirectory() + "\\oobe\\";
  106. var g_bRedial = false;
  107. var g_LineProblem = 0;
  108. var g_bFirstServerError = true;
  109. var g_status = STATUS_OFF;
  110. var g_ServerErrorCount = 0;
  111. var g_IMEExists = false;
  112. var g_OEMAddBackURL = "";
  113. var g_DialingAvailableInCountry = true;
  114. var g_ModalDialogUp = false;
  115. var g_RemoveRemind = false;
  116. var MS_REGISTRATION = "{1C956940-8617-11D3-8B99-00A0C91E7F3C}";
  117. var OEM_REGISTRATION = "{ECD24360-B210-11D3-8B99-00A0C91E7F3C}";
  118. var g_bTapiDone = false;
  119. var g_OEMNameStr=window.external.Signup.get_OEMName();
  120. var L_MS_Text="Microsoft";
  121. var g_InitAutodial = false;
  122. var L_CheckConnectivity_Text = "Checking for connectivity...";
  123. var L_BlankTitle_Text = "";
  124. var g_IsMSRegistrationSuccessful = false;
  125. var g_IsOEMRegistrationSuccessful = false;
  126. if (null == ApiObj)
  127. {
  128. ApiObj = new Object;
  129. ApiObj = window.external.API;
  130. }
  131. if (null == StatusObj)
  132. {
  133. StatusObj = new Object;
  134. StatusObj = window.external.Status;
  135. }
  136. if (null == DirObj)
  137. {
  138. DirObj = new Object;
  139. DirObj = window.external.Directions;
  140. }
  141. if (null == InfoObj)
  142. {
  143. InfoObj = new Object;
  144. InfoObj = window.external.UserInfo;
  145. }
  146. if (null == RegisterObj)
  147. {
  148. RegisterObj = new Object;
  149. RegisterObj = window.external.Register;
  150. }
  151. if (null == TapiObj)
  152. {
  153. TapiObj = new Object;
  154. TapiObj = window.external.Tapi;
  155. }
  156. function OnSelectClick() {}
  157. function OnClick() {}
  158. function OnFocus() {}
  159. function SimpleNavBack()
  160. {
  161. g.window.history.back();
  162. }
  163. function HandleTextAreaFocus() {
  164. g.event.srcElement.style.borderStyle="ridge";
  165. }
  166. function HandleTextAreaBlur() {
  167. g.event.srcElement.style.borderStyle="";
  168. }
  169. function Start_OnKeyPress()
  170. {
  171. try
  172. {
  173. if (g.event == null)
  174. return;
  175. }
  176. catch(e)
  177. {
  178. return;
  179. }
  180. if ((g.event.keyCode == 13) &&
  181. (g.btnNext.disabled == false))
  182. {
  183. GoNext();
  184. }
  185. else
  186. {
  187. KeyPressIsValid();
  188. }
  189. }
  190. function CheckUserLocale()
  191. {
  192. var language = ApiObj.get_UserDefaultLCID;
  193. if (language == MAKELCID(MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN), SORT_DEFAULT) ||
  194. language == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL), SORT_DEFAULT) ||
  195. language == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT))
  196. return false;
  197. else
  198. return true;
  199. }
  200. function RemindChkBoxClick()
  201. {
  202. g_RemoveRemind = g.RemoveReminder.checked;
  203. if (g.btnNext.disabled)
  204. {
  205. g.btnNext.disabled = false;
  206. g.btnNext.onclick = GoNext;
  207. g.btnNext.focus();
  208. g.rb_reg_ms_no.checked = true;
  209. g.rb_reg_oem_no.checked = true;
  210. }
  211. }
  212. function Start_LoadMe()
  213. {
  214. InitFrameRef();
  215. var L_Title1_Text = "Ready to register with %1 and %2?";
  216. g.Title_Text.innerText = ApiObj.FormatMessage(L_Title1_Text, g_OEMNameStr, L_MS_Text);
  217. GetPageTitle();
  218. if (g_OEMNameStr.length != 0)
  219. {
  220. var L_OEM_Text = "Thank you for purchasing this computer from %1 featuring Microsoft Windows XP. We recommend you register with %2 and Microsoft. By registering your copy of Windows, Microsoft can notify you of future product updates, events, promotions, special offers and new products that you may be interested in.";
  221. g.welcome_namestr.innerText = ApiObj.FormatMessage(L_OEM_Text, g_OEMNameStr, g_OEMNameStr);
  222. var L_Question_Text = "Are you ready to register online with %1?";
  223. g.reg1_oem_TxtQuestion.innerText = ApiObj.FormatMessage(L_Question_Text, g_OEMNameStr);
  224. var L_Answer_Text = "Y<u>e</u>s, I'd like to register with %1 now";
  225. g.reg1_spn3.innerHTML = ApiObj.FormatMessage(L_Answer_Text, g_OEMNameStr);
  226. }
  227. g.WelcomePageText.style.visibility="visible";
  228. g.OEMName3.innerText=g_OEMNameStr;
  229. if ((g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked) && (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked))
  230. {
  231. g.btnNext.disabled = false;
  232. g_FirstFocusElement = g.btnNext;
  233. }
  234. else
  235. {
  236. g.btnNext.disabled = true;
  237. g_FirstFocusElement = g.btnQuit;
  238. }
  239. InitButtons();
  240. g_FirstFocusElement.focus();
  241. }
  242. function Reg1RadioClicked()
  243. {
  244. if (g.btnNext.disabled)
  245. {
  246. if ((g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked) && (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked))
  247. {
  248. g.btnNext.disabled = false;
  249. g.btnNext.onclick = GoNext;
  250. g.btnNext.focus();
  251. }
  252. }
  253. }
  254. 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");
  255. 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");
  256. var ProvinceNames = new Array("","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon");
  257. var g_StateName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  258. var g_ProvinceName2IndexMap= new ActiveXObject("Scripting.Dictionary");
  259. g_ProvinceName2IndexMap.CompareMode = 1;
  260. g_StateName2IndexMap.CompareMode = 1;
  261. var ii;
  262. for(ii=1;ii<=FullStateNames.length;ii++) {
  263. g_StateName2IndexMap.Add(FullStateNames[ii-1].toUpperCase(),ii);
  264. g_StateName2IndexMap.Add(StateAbbrevs[ii].toUpperCase(),ii);
  265. if(ii < ProvinceNames.length) {
  266. g_ProvinceName2IndexMap.Add(ProvinceNames[ii].toUpperCase(),ii);
  267. }
  268. }
  269. var L_Postal_Text = "Postal or <u>Z</u>IP code:";
  270. var L_AsteriskPostal_Text = "*Postal or <u>Z</u>IP code:";
  271. var L_Province_Text= "State/<u>P</u>rovince:";
  272. var L_AsteriskProvince_Text= "*State/<u>P</u>rovince:";
  273. var L_Canada_Text="Canada";
  274. var L_UnitedStates_Text="United States";
  275. function Reg3UserCountryChanged() {
  276. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  277. if(g_Country == L_UnitedStates_Text) {
  278. if(g.selUSState.style.display!="inline") {
  279. g.selUSState.style.display="inline";
  280. }
  281. g.selCAProvince.style.display="none";
  282. g.UserStateTextBox.style.display="none";
  283. if(g.UserStateTextBox.value!="") {
  284. var res=g_StateName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  285. if(res!=null) {
  286. g.selUSState.selectedIndex=res;
  287. }
  288. }
  289. g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  290. g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  291. } else if(g_Country == L_Canada_Text) {
  292. g.selUSState.style.display="none";
  293. g.selCAProvince.style.display="inline";
  294. g.UserStateTextBox.style.display="none";
  295. if(g.UserStateTextBox.value!="") {
  296. var res=g_ProvinceName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
  297. if(res!=null) {
  298. g.selCAProvince.selectedIndex=res;
  299. }
  300. }
  301. g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
  302. g.StateLabel.innerHTML = L_AsteriskProvince_Text;
  303. } else {
  304. g.selUSState.style.display="none";
  305. g.selCAProvince.style.display="none";
  306. g.UserStateTextBox.style.display="inline";
  307. g.LabelZIP.innerHTML = L_Postal_Text;
  308. g.StateLabel.innerHTML = L_Province_Text;
  309. }
  310. g_CountryIdx=g.selCountry.selectedIndex;
  311. Reg3UserStateChanged();
  312. }
  313. var L_FullName_Text="*<u>F</u>ull Name:";
  314. function Reg3UserStateChanged() {
  315. if(g.selUSState.style.display!="none")
  316. {
  317. g_StateIdx=g.selUSState.selectedIndex;
  318. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  319. g.StateLabel.htmlFor="selUSState";
  320. }
  321. else if (g.selCAProvince.style.display!="none")
  322. {
  323. g_StateIdx=g.selCAProvince.selectedIndex;
  324. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  325. g.StateLabel.htmlFor="selCAProvince";
  326. }
  327. else
  328. {
  329. g_State = g.UserStateTextBox.value;
  330. g.StateLabel.htmlFor="UserStateTextBox";
  331. }
  332. }
  333. var g_FirstName=InfoObj.get_FirstName();
  334. var g_LastName=InfoObj.get_LastName();
  335. var g_Address1=InfoObj.get_Address1();
  336. var g_Address2=InfoObj.get_Address2();
  337. var g_City=InfoObj.get_City();
  338. var g_ZipCode=InfoObj.get_Zip();
  339. var g_EmailAddr= InfoObj.get_PrimaryEmail();
  340. var g_PhoneNumber = InfoObj.get_PhoneNumber();
  341. var g_Country=InfoObj.get_Country();
  342. var g_CountryIdx=-1;
  343. var g_State=InfoObj.get_State();
  344. var g_StateIdx=0;
  345. function Reg3SaveSettings() {
  346. g_FirstName=g.UserFirstName.value;
  347. g_LastName=g.UserLastName.value;
  348. g_Address1=g.UserAddress.value;
  349. g_Address2=g.UserAddress2.value;
  350. g_ZipCode=g.UserZipCode.value;
  351. g_EmailAddr=g.UserEmailAddress.value;
  352. g_PhoneNumber=g.UserPhoneNumber.value;
  353. g_City=g.UserCity.value;
  354. g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
  355. if(g.UserStateTextBox.style.display!="none")
  356. {
  357. g_State=g.UserStateTextBox.value;
  358. }
  359. else if (g.selUSState.style.display!="none")
  360. {
  361. g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
  362. }
  363. else
  364. {
  365. g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  366. }
  367. InfoObj.set_FirstName(g_FirstName);
  368. InfoObj.set_LastName(g_LastName);
  369. InfoObj.set_Country(g_Country);
  370. InfoObj.set_State(g_State);
  371. InfoObj.set_Address1(g_Address1);
  372. InfoObj.set_Address2(g_Address2);
  373. InfoObj.set_PrimaryEmail(g_EmailAddr);
  374. InfoObj.set_PhoneNumber(g_PhoneNumber);
  375. InfoObj.set_Zip(g_ZipCode);
  376. InfoObj.set_City(g_City);
  377. TapiObj.set_CountryIndex(g.selCountry.selectedIndex);
  378. }
  379. function Reg3_LoadMe()
  380. {
  381. InitFrameRef();
  382. GetPageTitle();
  383. g_FirstFocusElement = g.UserFirstName;
  384. if (IsFarEastLocale())
  385. {
  386. g.MainPageCell.style.display="none";
  387. g.FieldTable.moveRow(2,0);
  388. g.FieldTable.moveRow(7,3);
  389. g.FieldTable.moveRow(7,4);
  390. g.FieldTable.moveRow(7,5);
  391. g.FE_ZIPLabel.innerHTML=g.LabelRight.innerHTML;
  392. g.FE_ZIPInput.innerHTML=g.MenuRight.innerHTML;
  393. g.FE_ZIPRow.style.display="inline";
  394. g.LabelRight.innerHTML="";
  395. g.MenuRight.innerHTML="";
  396. g.UserZipCode.size=30;
  397. g.UserZipCode.maxlength=120;
  398. g.UserStateTextBox.size=30;
  399. g.UserStateTextBox.maxlength=120;
  400. g_FirstFocusElement = g.UserLastName;
  401. if (IsKoreanLocale()) {
  402. g.LastNameRow.style.display="none";
  403. g.LabelFirstName.innerHTML=L_FullName_Text;
  404. g_FirstFocusElement = g.UserFirstName;
  405. }
  406. g.MainPageCell.style.display="inline";
  407. }
  408. g.selCountry.style.width=g.UserEmailAddress.offsetWidth;
  409. g.UserFirstName.value=g_FirstName;
  410. g.UserLastName.value=g_LastName;
  411. g.UserAddress.value=g_Address1;
  412. g.UserAddress2.value=g_Address2;
  413. g.UserZipCode.value=g_ZipCode;
  414. g.UserEmailAddress.value=g_EmailAddr;
  415. g.UserPhoneNumber.value=g_PhoneNumber;
  416. g.UserCity.value=g_City;
  417. g.selUSState.remove(0);
  418. for (var i = 0; i < StateAbbrevs.length; i++) {
  419. var oOption = g.document.createElement("OPTION");
  420. oOption.text = StateAbbrevs[i];
  421. if (StateAbbrevs[i] == g_State)
  422. {
  423. g_StateIdx = i;
  424. }
  425. g.selUSState.add(oOption);
  426. }
  427. for (i = 0; i < ProvinceNames.length; i++) {
  428. oOption = g.document.createElement("OPTION");
  429. oOption.text = ProvinceNames[i];
  430. if (ProvinceNames[i] == g_State)
  431. {
  432. g_StateIdx = i;
  433. }
  434. g.selCAProvince.add(oOption);
  435. }
  436. var fTapi = TapiObj.IsTAPIConfigured();
  437. g_CountryIdx = TapiObj.get_CountryIndex();
  438. if(g_CountryIdx>=0)
  439. {
  440. g.selCountry.selectedIndex=g_CountryIdx;
  441. if(g_Country == L_UnitedStates_Text)
  442. {
  443. g.selUSState.selectedIndex=g_StateIdx;
  444. }
  445. else if(g_Country == L_Canada_Text)
  446. {
  447. g.selCAProvince.selectedIndex=g_StateIdx;
  448. }
  449. else
  450. g.UserStateTextBox.value=g_State;
  451. }
  452. else
  453. {
  454. g.selCountry.selectedIndex = TapiObj.get_CountryIndex();
  455. }
  456. Reg3UserCountryChanged();
  457. Reg3UserStateChanged();
  458. InitButtons();
  459. g.error_mesg.innerHTML = L_RequiredField_Text;
  460. g.error_mesg.style.display="inline";
  461. g_FirstFocusElement.focus();
  462. }
  463. function GetCurrentProvince() {
  464. if(g.selCountry.options(g.selCountry.selectedIndex).text == L_UnitedStates_Text) {
  465. return g.selUSState.options(g.selUSState.selectedIndex).text;
  466. } else if(g.selCountry.options(g.selCountry.selectedIndex).text == L_Canada_Text) {
  467. return g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
  468. } else return g.UserStateTextBox.value;
  469. }
  470. function GetCurrentCountry() {
  471. return g.selCountry.options(g.selCountry.selectedIndex).text;
  472. }
  473. var L_Email_Text="Please enter a valid E-mail address or leave the E-mail text box empty.";
  474. var L_EnterValid_Text="* Please fill in the required fields.";
  475. var L_RequiredField_Text="* indicates required information";
  476. var g_PostToMS = true;
  477. var g_PostToOEM = true;
  478. var POST_TO_OEM = 1;
  479. var POST_TO_MS = 2;
  480. function navigatetoPrivacy(PrivPage)
  481. {
  482. if(g_CurrentCKPT == CKPT_REGISTER3) {
  483. Reg3SaveSettings();
  484. }
  485. if(PrivPage == "MS")
  486. g.navigate("rprvcyMS.htm");
  487. else
  488. g.navigate("rOEMpriv.htm");
  489. }
  490. function VerifyReg3Fields() {
  491. g.error_mesg.style.display="none";
  492. var LastErrorField = null;
  493. var CurReg3ErrStringArray = new Array();
  494. if(g.UserEmailAddress.value != "") {
  495. var re = new RegExp("^\\s*\\S+@\\S+\\.\\S\\S+","");
  496. if(re.exec(g.UserEmailAddress.value) == null) {
  497. LastErrorField = g.UserEmailAddress;
  498. g.LabelEmail.style.color = "red";
  499. } else {
  500. g.LabelEmail.style.color = "black";
  501. }
  502. }
  503. var CurCountry=GetCurrentCountry();
  504. if ((CurCountry == L_UnitedStates_Text)||(CurCountry == L_Canada_Text)) {
  505. if(g.UserZipCode.value == "") {
  506. LastErrorField = g.UserZipCode;
  507. g.LabelZIP.className="text-error";
  508. } else {
  509. g.LabelZIP.className="text-primary";
  510. }
  511. if(GetCurrentProvince() == "") {
  512. if(g.selUSState.style.display!="none") {
  513. LastErrorField = g.selUSState;
  514. } else {
  515. LastErrorField = g.selCAProvince;
  516. }
  517. g.StateLabel.className="text-error";
  518. } else {
  519. g.StateLabel.className="text-primary";
  520. }
  521. }
  522. if(g.UserCity.value == "") {
  523. LastErrorField = g.UserCity;
  524. g.LabelCity.className="text-error";
  525. } else {
  526. g.LabelCity.className="text-primary";
  527. }
  528. if(g.UserAddress.value == "") {
  529. LastErrorField = g.UserAddress;
  530. g.LabelAddress.className="text-error";
  531. } else {
  532. g.LabelAddress.className="text-primary";
  533. }
  534. if((g.UserLastName.value == "") && (g.LastNameRow.style.display!="none")) {
  535. LastErrorField = g.UserLastName;
  536. g.LabelLastName.className="text-error";
  537. } else {
  538. g.LabelLastName.className="text-primary";
  539. }
  540. if(g.UserFirstName.value == "") {
  541. g.LabelFirstName.className="text-error";
  542. LastErrorField = g.UserFirstName;
  543. } else {
  544. g.LabelFirstName.className="text-primary";
  545. }
  546. if(LastErrorField==null) {
  547. return true;
  548. }
  549. if(LastErrorField==g.UserEmailAddress) {
  550. g.error_mesg.innerText = L_Email_Text;
  551. } else {
  552. g.error_mesg.innerText = L_EnterValid_Text;
  553. }
  554. g.error_mesg.style.display="inline";
  555. try
  556. {
  557. g.btnNext.disabled=false;
  558. }
  559. catch(e) {}
  560. try
  561. {
  562. g.btnBack.disabled=false;
  563. }
  564. catch(e) {}
  565. try
  566. {
  567. g.btnSkip.disabled=false;
  568. }
  569. catch(e) {}
  570. InitButtons();
  571. LastErrorField.focus();
  572. return false;
  573. }
  574. function Start_CheckEnableNextButton()
  575. {
  576. try
  577. {
  578. if (g.event == null)
  579. return;
  580. }
  581. catch(e)
  582. {
  583. return;
  584. }
  585. if (Start_CheckLengthRequirement() &&
  586. Start_CheckLengthNotEqualSpaces())
  587. {
  588. g.btnNext.disabled = false;
  589. }
  590. else
  591. {
  592. g.btnNext.disabled = true;
  593. }
  594. InitButtons();
  595. }
  596. function Start_CheckLengthRequirement()
  597. {
  598. if ((g.edt_FirstName.value.length != 0) ||
  599. (g.edt_LastName.value.length != 0))
  600. return true;
  601. else
  602. return false;
  603. }
  604. function Start_CheckLengthNotEqualSpaces()
  605. {
  606. if ((g.edt_FirstName.value.length != NumberOfSpaces(g.edt_FirstName.value)) ||
  607. (g.edt_LastName.value.length != NumberOfSpaces(g.edt_LastName.value)))
  608. return true;
  609. else
  610. return false;
  611. }
  612. function DoFocus()
  613. {
  614. try
  615. {g_FirstFocusElement.focus();}
  616. catch(e){}
  617. }
  618. var g_RegConnRadioSticky = 1;
  619. function RegConn_LoadMe()
  620. {
  621. InitFrameRef();
  622. GetPageTitle();
  623. if (g_RegConnRadioSticky == 1)
  624. {
  625. g_FirstFocusElement = g.rb_conn_lan;
  626. g.rb_conn_lan.checked = true;
  627. }
  628. else
  629. {
  630. g_FirstFocusElement = g.rb_conn_modem;
  631. g.rb_conn_modem.checked = true;
  632. }
  633. InitButtons();
  634. DoFocus();
  635. }
  636. var ProxySettingsObj = null;
  637. function ProxySettings(ConfigString)
  638. {
  639. this.UseAuto = false;
  640. this.UseScript = false;
  641. this.ScriptUrl = "";
  642. this.UseProxy = false;
  643. this.Server = "";
  644. this.Port = "";
  645. if (ConfigString != null)
  646. {
  647. var i, j;
  648. var Args = ConfigString.split(/ /);
  649. for (i = 0; i < Args.length; i++)
  650. {
  651. switch (Args[i])
  652. {
  653. case 'u':
  654. var ProxyList = Args[++i];
  655. var HttpProxy = null;
  656. if (ProxyList.indexOf("=") == -1)
  657. {
  658. HttpProxy = ProxyList;
  659. }
  660. else
  661. {
  662. var Proxys = ProxyList.split(/;/);
  663. if (Proxys != null)
  664. {
  665. for (j = 0; j < Proxys.length; j++)
  666. {
  667. if (Proxys[j].indexOf("http=") == 0)
  668. {
  669. HttpProxy = Proxys[j].substring(5, Proxys[j].length);
  670. break;
  671. }
  672. }
  673. }
  674. }
  675. if (HttpProxy)
  676. {
  677. j = HttpProxy.lastIndexOf(':');
  678. if (j == -1)
  679. {
  680. this.Server = HttpProxy;
  681. }
  682. else
  683. {
  684. this.Server = HttpProxy.substring(0, j);
  685. this.Port = HttpProxy.substring(j+1, HttpProxy.length);
  686. }
  687. }
  688. break;
  689. case 'a':
  690. this.UseAuto = true;
  691. break;
  692. case 'm':
  693. this.UseProxy = true;
  694. break;
  695. }
  696. }
  697. }
  698. }
  699. function RegLan_LoadMe()
  700. {
  701. InitFrameRef();
  702. GetPageTitle();
  703. InitButtons();
  704. if (ProxySettingsObj == null)
  705. {
  706. var ConfigString = window.external.get_ProxySettings();
  707. ProxySettingsObj = new ProxySettings(ConfigString);
  708. }
  709. g.cb_auto_detect.checked = ProxySettingsObj.UseAuto;
  710. g.cb_use_proxy.checked = ProxySettingsObj.UseProxy;
  711. g.txt_proxy_url.value = ProxySettingsObj.Server;
  712. g.txt_proxy_port.value = ProxySettingsObj.Port;
  713. RegLan_upClickHandler();
  714. g_FirstFocusElement = g.btnNext;
  715. DoFocus();
  716. }
  717. function RegLan_upClickHandler()
  718. {
  719. if (g.cb_use_proxy.checked)
  720. {
  721. g.txt_proxy_url.style.backgroundColor = "#ffffff";
  722. g.txt_proxy_url.disabled = false;
  723. g.txt_proxy_port.style.backgroundColor = "#ffffff";
  724. g.txt_proxy_port.disabled = false;
  725. }
  726. else
  727. {
  728. g.txt_proxy_url.style.backgroundColor = "#dddddd";
  729. g.txt_proxy_url.disabled = true;
  730. g.txt_proxy_port.style.backgroundColor = "#dddddd";
  731. g.txt_proxy_port.disabled = true;
  732. }
  733. }
  734. function RegLan(Stage)
  735. {
  736. if (Stage == null)
  737. {
  738. var L_CheckingConnectivity_Text = "Checking connectivity...";
  739. Span_WPA_MainTitle.innerText = L_CheckingConnectivity_Text;
  740. ResetConnectedToInternetEx();
  741. ConnectedToInternetEx(true, "RegLan(1);");
  742. }
  743. else
  744. {
  745. if (ConnectedToInternetEx(false))
  746. {
  747. IcsConnect(ICS_CONN_TYPE_REG);
  748. }
  749. else
  750. {
  751. GoNavigate(CKPT_ACT_MSG);
  752. }
  753. }
  754. }
  755. function Activation_ResetNetworking()
  756. {
  757. if (window.external.CheckOnlineStatus)
  758. {
  759. ResetDialing();
  760. }
  761. if (g_InitAutodial)
  762. {
  763. window.external.InternetAutodialHangup();
  764. g_InitAutodial = false;
  765. }
  766. }
  767. function reg_desktop_error_LoadMe()
  768. {
  769. InitFrameRef();
  770. GetPageTitle();
  771. Activation_ResetNetworking();
  772. if (g_IsMSRegistrationSuccessful || g_IsOEMRegistrationSuccessful)
  773. {
  774. var L_RegThankYou_Text = "Thank You!";
  775. Span_WPA_MainTitle.innerText = L_RegThankYou_Text;
  776. g.acterror_description_SUCCESS1.style.display="inline";
  777. g.btnQuit.style.visibility = "hidden";
  778. var L_FinishButton_Text = "OK";
  779. g.btnNext.innerHTML = L_FinishButton_Text;
  780. var Accesskey_O = "O";
  781. g.btnNext.accessKey = Accesskey_O;
  782. }
  783. else
  784. {
  785. var L_RegUnable_Text = "Unable to register online";
  786. Span_WPA_MainTitle.innerText = L_RegUnable_Text;
  787. g.acterror_description1.style.display="inline";
  788. }
  789. InitButtons();
  790. g_FirstFocusElement = g.btnNext;
  791. DoFocus();
  792. }
  793. function _Default_LoadMe(SimpleBack, SimpleNext)
  794. {
  795. InitFrameRef();
  796. if (g.btnNext != null)
  797. g_FirstFocusElement = g.btnNext;
  798. else if (g.btnSkip != null)
  799. g_FirstFocusElement = g.btnSkip;
  800. else if (g.btnBack != null)
  801. g_FirstFocusElement = g.btnBack;
  802. InitButtons(SimpleBack, SimpleNext);
  803. if (g_FirstFocusElement != null)
  804. g_FirstFocusElement.focus();
  805. else
  806. g.document.body.focus();
  807. }
  808. function New_Default_LoadMe(SimpleBack, SimpleNext)
  809. {
  810. InitFrameRef();
  811. GetPageTitle();
  812. if (g.btnNext != null)
  813. g_FirstFocusElement = g.btnNext;
  814. else if (g.btnSkip != null)
  815. g_FirstFocusElement = g.btnSkip;
  816. else if (g.btnBack != null)
  817. g_FirstFocusElement = g.btnBack;
  818. InitButtons(SimpleBack, SimpleNext);
  819. if (g_FirstFocusElement != null)
  820. g_FirstFocusElement.focus();
  821. else
  822. g.document.body.focus();
  823. }
  824. function OEMPrivacy_LoadMe(NewSimpleBack, NewSimpleNext)
  825. {
  826. New_Default_LoadMe(NewSimpleBack, NewSimpleNext);
  827. if (g_OEMNameStr.length != 0)
  828. {
  829. var L_Title1_Text = "%1 Privacy Statement";
  830. g.Title_Text.innerText = ApiObj.FormatMessage(L_Title1_Text, g_OEMNameStr);
  831. GetPageTitle();
  832. }
  833. }
  834. function InitCKPT()
  835. {
  836. dnCKPT[CKPT_REGRMIND] = new CheckPoint("regsetup\\regrmnd.htm", 0, 0, 0, 0);
  837. dnCKPT[CKPT_REGISTER3] = new CheckPoint("regsetup\\rusrinfo.htm", 0, 0, 0, 0);
  838. dnCKPT[CKPT_REGCONN] = new CheckPoint("regsetup\\regconn.htm", 0, 0, 0, 0);
  839. dnCKPT[CKPT_REGLAN] = new CheckPoint("regsetup\\reglan.htm", 0, 0, 0, 0);
  840. dnCKPT[CKPT_REGDIAL] = new CheckPoint("regsetup\\rdrdyreg.htm", 0, 0, 0, 0);
  841. dnCKPT[CKPT_ACT_MSG] = new CheckPoint("regsetup\\rdeskerr.htm", 0, 0, 0, 0);
  842. dnCKPT[CKPT_DONE] = new CheckPoint("regsetup\\regdone.htm", 0, 0, 0, 0);
  843. PopCKPT();
  844. }
  845. function PushCKPT(ckpt)
  846. {
  847. if (ckpt > 0 && ckpt < CKPT_MAX)
  848. {
  849. var tos = 0;
  850. try
  851. {
  852. tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  853. }
  854. catch (e) {}
  855. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString(), ckpt);
  856. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, ++tos);
  857. g_CurrentCKPT = ckpt;
  858. }
  859. }
  860. function PopCKPT(ckptCheck)
  861. {
  862. var ckpt = 0;
  863. try
  864. {
  865. var tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
  866. if (tos > 0)
  867. {
  868. ckpt = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, (tos - 1).toString());
  869. if (null == ckptCheck || ckpt == ckptCheck)
  870. {
  871. ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, --tos);
  872. ApiObj.DeleteRegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString());
  873. }
  874. }
  875. }
  876. catch (e) {}
  877. if (ckpt > 0 && ckpt < CKPT_MAX)
  878. {
  879. g_CurrentCKPT = ckpt;
  880. }
  881. else
  882. g_CurrentCKPT = null;
  883. }
  884. function URLFromCKPT(ckpt)
  885. {
  886. var str = "";
  887. if (ckpt > 0 && ckpt < CKPT_MAX)
  888. {
  889. str = dnCKPT[ckpt].strURL;
  890. }
  891. return str;
  892. }
  893. function IndexFromCKPT(ckpt, status)
  894. {
  895. var index = 0;
  896. if (ckpt > 0 && ckpt < CKPT_MAX)
  897. {
  898. var checkpoint = dnCKPT[ckpt];
  899. index = checkpoint.rgindex[status];
  900. }
  901. return index;
  902. }
  903. function IsLocalFile()
  904. {
  905. try
  906. {
  907. return (-1 != g.location.protocol.indexOf("file"));
  908. }
  909. catch (e)
  910. {
  911. return false;
  912. }
  913. }
  914. function SetBack(strURL)
  915. {
  916. g_OEMAddBackURL = strURL;
  917. }
  918. function GoCancel(ckpt)
  919. {
  920. try
  921. {
  922. if (IsLocalFile() && g.event == null)
  923. return;
  924. }
  925. catch(e)
  926. {
  927. return;
  928. }
  929. switch (g_CurrentCKPT)
  930. {
  931. case CKPT_REGDIAL:
  932. GoNavigate(CKPT_DONE);
  933. break;
  934. case CKPT_REGISTER3:
  935. GoNavigate(CKPT_DONE);
  936. break;
  937. case CKPT_REGLAN:
  938. RegLan();
  939. break;
  940. }
  941. }
  942. function GoBack(ckpt)
  943. {
  944. try
  945. {
  946. if (IsLocalFile() && g.event == null)
  947. return;
  948. }
  949. catch(e)
  950. {
  951. return;
  952. }
  953. if (g_CurrentCKPT == g_DialCKPT)
  954. ResetDialing();
  955. if(g_CurrentCKPT == CKPT_REGISTER3)
  956. {
  957. Reg3SaveSettings();
  958. }
  959. var ckptPrevious = g_CurrentCKPT;
  960. PopCKPT();
  961. if (ckptPrevious == g_CurrentCKPT)
  962. {
  963. PopCKPT();
  964. }
  965. if (g_CurrentCKPT > 0 && g_CurrentCKPT < CKPT_MAX)
  966. {
  967. GoNavigate(g_CurrentCKPT);
  968. }
  969. }
  970. function StatusNavigate()
  971. {
  972. var iMove = IndexFromCKPT(g_CurrentCKPT, g_status) - window.external.get_StatusIndex;
  973. while (iMove > 0)
  974. {
  975. window.external.MoveNext();
  976. --iMove;
  977. }
  978. while (iMove < 0)
  979. {
  980. window.external.MovePrevious();
  981. ++iMove;
  982. }
  983. }
  984. function GoNavigate(ckptGoHere)
  985. {
  986. try
  987. {
  988. if (g_bStartup == false)
  989. {
  990. if (IsLocalFile())
  991. {
  992. if (g.event != null)
  993. {
  994. g.event.returnValue = false;
  995. g.event.cancelBubble = true;
  996. }
  997. }
  998. }
  999. else
  1000. g_bStartup = false;
  1001. }
  1002. catch(e)
  1003. {
  1004. return;
  1005. }
  1006. switch (ckptGoHere)
  1007. {
  1008. default:
  1009. PushCKPT(ckptGoHere);
  1010. g.navigate(g_OOBEDir + URLFromCKPT(ckptGoHere));
  1011. break;
  1012. }
  1013. }
  1014. function DisableAllButtons()
  1015. {
  1016. try
  1017. {
  1018. g.btnNext.disabled=true;
  1019. }
  1020. catch(e) {}
  1021. try
  1022. {
  1023. g.btnBack.disabled=true;
  1024. }
  1025. catch(e) {}
  1026. try
  1027. {
  1028. g.btnSkip.disabled=true;
  1029. }
  1030. catch(e) {}
  1031. try
  1032. {
  1033. InitButtons();
  1034. }
  1035. catch(e) {}
  1036. }
  1037. function GoQuit()
  1038. {
  1039. if (g_RemoveRemind)
  1040. window.external.DeleteRemind(0);
  1041. window.external.Finish();
  1042. }
  1043. function GoNext()
  1044. {
  1045. try
  1046. {
  1047. if (IsLocalFile() && g.event == null)
  1048. return;
  1049. }
  1050. catch(e)
  1051. {
  1052. return;
  1053. }
  1054. DisableAllButtons();
  1055. switch (g_CurrentCKPT)
  1056. {
  1057. case CKPT_REGRMIND:
  1058. if (g_RemoveRemind)
  1059. window.external.DeleteRemind(0);
  1060. if (g.rb_reg_ms_yes.checked || g.rb_reg_oem_yes.checked)
  1061. {
  1062. g_PostToMS = g.rb_reg_ms_yes.checked;
  1063. g_PostToOEM = g.rb_reg_oem_yes.checked;
  1064. GoNavigate(CKPT_REGISTER3);
  1065. }
  1066. else
  1067. {
  1068. window.external.Finish();
  1069. return;
  1070. }
  1071. break;
  1072. case CKPT_REGISTER3:
  1073. if(VerifyReg3Fields())
  1074. {
  1075. Span_WPA_MainTitle.innerText = "Checking connectivity...";
  1076. Reg3SaveSettings();
  1077. if (!ConnectedToInternetEx(true))
  1078. {
  1079. window.external.InternetAutodial();
  1080. ResetConnectedToInternetEx();
  1081. if (!ConnectedToInternetEx(true))
  1082. {
  1083. if (HasNetwork() && HasModem())
  1084. {
  1085. GoNavigate(CKPT_REGCONN);
  1086. }
  1087. else if (HasNetwork())
  1088. {
  1089. GoNavigate(CKPT_REGLAN);
  1090. }
  1091. else if (HasModem())
  1092. {
  1093. GoNavigate(CKPT_REGDIAL);
  1094. }
  1095. else
  1096. {
  1097. GoNavigate(CKPT_ACTIVERR);
  1098. }
  1099. }
  1100. else
  1101. {
  1102. PushCKPT(CKPT_REGDIAL);
  1103. g_InitAutodial = true;
  1104. window.external.Connect(CONNECTED_REGISTRATION, "reg.isp");
  1105. }
  1106. }
  1107. else
  1108. {
  1109. PushCKPT(CKPT_REGDIAL);
  1110. window.external.Connect(CONNECTED_REGISTRATION, "reg.isp");
  1111. }
  1112. }
  1113. break;
  1114. case CKPT_REGCONN:
  1115. if (g.rb_conn_lan.checked)
  1116. {
  1117. g_RegConnRadioSticky = 1;
  1118. GoNavigate(CKPT_REGLAN);
  1119. }
  1120. else
  1121. {
  1122. g_RegConnRadioSticky = 2;
  1123. PushCKPT(CKPT_REGDIAL);
  1124. Navigate(URLFromCKPT(CKPT_REGDIAL));
  1125. }
  1126. break;
  1127. case CKPT_REGLAN:
  1128. ProxySettingsObj.UseAuto = g.cb_auto_detect.checked;
  1129. ProxySettingsObj.UseProxy = g.cb_use_proxy.checked;
  1130. ProxySettingsObj.Server = g.txt_proxy_url.value;
  1131. ProxySettingsObj.Port = g.txt_proxy_port.value;
  1132. window.external.set_ProxySettings(
  1133. ProxySettingsObj.UseAuto,
  1134. ProxySettingsObj.UseScript,
  1135. ProxySettingsObj.ScriptUrl,
  1136. ProxySettingsObj.UseProxy,
  1137. ProxySettingsObj.Server + ((ProxySettingsObj.Port == "") ? "" : (":" + ProxySettingsObj.Port))
  1138. );
  1139. RegLan();
  1140. break;
  1141. case CKPT_REGDIAL:
  1142. GoNavigate(CKPT_DONE);
  1143. break;
  1144. case CKPT_ACT_MSG:
  1145. if (!g_IsMSRegistrationSuccessful && !g_IsOEMRegistrationSuccessful)
  1146. {
  1147. GoNavigate(CKPT_REGCONN);
  1148. break;
  1149. }
  1150. case CKPT_DONE:
  1151. if (g_RemoveRemind)
  1152. window.external.DeleteRemind(0);
  1153. window.external.Finish();
  1154. break;
  1155. default:
  1156. break;
  1157. }
  1158. }
  1159. function GoOffline()
  1160. {
  1161. GoNext();
  1162. }
  1163. function SetLastButtonText()
  1164. {
  1165. if (g.btnNext != null)
  1166. g_LastButtonText = g.btnNextText;
  1167. else if (g.btnBack != null)
  1168. g_LastButtonText = g.btnBackText;
  1169. else if (g.btnRestore != null)
  1170. g_LastButtonText = g.btnRestoreText;
  1171. else if (g.btnCancel != null)
  1172. g_LastButtonText = g.btnCancelText;
  1173. }
  1174. function InitFrameRef()
  1175. {
  1176. g_LastButtonText = null;
  1177. g_FirstFocusElement = null;
  1178. g_LastKeyDown = null;
  1179. g = document.frames("msoobeMain");
  1180. try
  1181. {
  1182. g.document.body.onkeydown = OnKeyDown;
  1183. SetLastButtonText();
  1184. }
  1185. catch(e){}
  1186. }
  1187. function HideButtons(buttons)
  1188. {
  1189. if (null != g.btnBack && (buttons & HIDE_BACK))
  1190. {
  1191. g.btnBack.Hide = true;
  1192. }
  1193. if (null != g.btnNext && (buttons & HIDE_NEXT))
  1194. {
  1195. g.btnNext.Hide = true;
  1196. }
  1197. if (null != g.spanCancel && (buttons & HIDE_CANCEL))
  1198. {
  1199. g.btnSkip.Hide = true;
  1200. }
  1201. if (null != g.spanRestore && (buttons & HIDE_RESTORE))
  1202. {
  1203. g.btnRestore.Hide = true;
  1204. }
  1205. }
  1206. function HandleButtonMouseOver()
  1207. {
  1208. }
  1209. function HandleButtonMouseOut()
  1210. {
  1211. }
  1212. function InitButtons(SimpleBack, SimpleNext)
  1213. {
  1214. if(g.btnSkip!=null) {
  1215. g.btnSkip.onmouseover = HandleButtonMouseOver;
  1216. g.btnSkip.onmouseout = HandleButtonMouseOut;
  1217. if(!g.btnSkip.disabled) {
  1218. g.btnSkip.onclick = GoCancel;
  1219. g.btnSkip.className="buttons";
  1220. } else {
  1221. g.btnSkip.className="buttons-disabled";
  1222. }
  1223. }
  1224. if (g.btnNext != null)
  1225. {
  1226. g.btnNext.onmouseover = HandleButtonMouseOver;
  1227. g.btnNext.onmouseout = HandleButtonMouseOut;
  1228. if (!g.btnNext.disabled)
  1229. {
  1230. if (SimpleNext == null)
  1231. {
  1232. g.btnNext.onclick = GoNext;
  1233. }
  1234. else
  1235. {
  1236. g.btnNext.onclick = SimpleNavNext;
  1237. }
  1238. g.btnNext.className="buttons";
  1239. }
  1240. else
  1241. {
  1242. g.btnNext.className="buttons-disabled";
  1243. }
  1244. }
  1245. if (g.btnBack != null)
  1246. {
  1247. g.btnBack.onmouseover = HandleButtonMouseOver;
  1248. g.btnBack.onmouseout = HandleButtonMouseOut;
  1249. if (!g.btnBack.disabled)
  1250. {
  1251. if (SimpleBack == null)
  1252. {
  1253. g.btnBack.onclick = GoBack;
  1254. }
  1255. else
  1256. {
  1257. g.btnBack.onclick = SimpleNavBack;
  1258. }
  1259. g.btnBack.className="buttons";
  1260. }
  1261. else
  1262. {
  1263. g.btnBack.className="buttons-disabled";
  1264. }
  1265. }
  1266. try
  1267. {
  1268. if(g.btnQuit != null) {
  1269. g.btnQuit.onmouseover = HandleButtonMouseOver;
  1270. g.btnQuit.onmouseout = HandleButtonMouseOut;
  1271. if(g.btnQuit.disabled == false) {
  1272. g.btnQuit.onclick = GoQuit;
  1273. g.btnQuit.className="buttons";
  1274. } else {
  1275. g.btnQuit.className="buttons-disabled";
  1276. }
  1277. }
  1278. } catch(e) {}
  1279. }
  1280. var g_LastKeyDown = null;
  1281. function OnKeyDown()
  1282. {
  1283. try
  1284. {
  1285. if (IsLocalFile() && g.event == null)
  1286. return;
  1287. }
  1288. catch(e)
  1289. {
  1290. return;
  1291. }
  1292. if (g.event.altKey)
  1293. {
  1294. g_LastKeyDown = String.fromCharCode(g.event.keyCode);
  1295. if (g_LastKeyDown != null)
  1296. g_LastKeyDown = g_LastKeyDown.toUpperCase();
  1297. }
  1298. else
  1299. g_LastKeyDown = null;
  1300. }
  1301. function KeyPressIsNumeric()
  1302. {
  1303. try
  1304. {
  1305. if (IsLocalFile() && g.event == null)
  1306. return;
  1307. }
  1308. catch(e)
  1309. {
  1310. return;
  1311. }
  1312. if (!IsNumeric(g.event.keyCode))
  1313. {
  1314. g.event.keyCode = 0;
  1315. g.event.returnValue = false;
  1316. }
  1317. }
  1318. function IsNumeric(keyCode)
  1319. {
  1320. if ((keyCode >= 48) && (keyCode <= 57))
  1321. return true;
  1322. else
  1323. return false;
  1324. }
  1325. function IsSpecial(keyCode)
  1326. {
  1327. return false;
  1328. }
  1329. function KeyPressIsValid()
  1330. {
  1331. try
  1332. {
  1333. if (IsLocalFile() && g.event == null)
  1334. return;
  1335. }
  1336. catch(e)
  1337. {
  1338. return;
  1339. }
  1340. if (!IsAlpha(g.event.keyCode) &&
  1341. !IsSpecial(g.event.keyCode) &&
  1342. !IsNumeric(g.event.keyCode))
  1343. {
  1344. g.event.keyCode = 0;
  1345. g.event.returnValue = false;
  1346. }
  1347. }
  1348. function KeyPressIsAlpha()
  1349. {
  1350. try
  1351. {
  1352. if (IsLocalFile() && g.event == null)
  1353. return;
  1354. }
  1355. catch(e)
  1356. {
  1357. return;
  1358. }
  1359. if (!IsAlpha(g.event.keyCode))
  1360. {
  1361. g.event.keyCode = 0;
  1362. g.event.returnValue = false;
  1363. }
  1364. }
  1365. function IsAlpha(keyCode)
  1366. {
  1367. return true;
  1368. }
  1369. function NumberOfSpaces(strValue)
  1370. {
  1371. var iSpaceCount = 0;
  1372. for (iPosition = 0; iPosition < strValue.length; iPosition ++)
  1373. {
  1374. if (strValue.charAt(iPosition) == ' ')
  1375. {
  1376. iSpaceCount++;
  1377. }
  1378. }
  1379. return iSpaceCount;
  1380. }
  1381. function KeyCodeToUpper()
  1382. {
  1383. var strKeyCode = String.fromCharCode(g.event.keyCode);
  1384. strKeyCode = strKeyCode.toUpperCase();
  1385. g.event.keyCode = strKeyCode.charCodeAt(0);
  1386. }
  1387. var vCurItem = 0;
  1388. function SetupPageLayout()
  1389. {
  1390. var WPAWindowHeight = document.body.clientHeight;
  1391. var WPAWindowWidth = document.body.clientWidth;
  1392. if(0 != window.external.Directions.get_AppMode())
  1393. {
  1394. document.all.ifrmMainFrame.style.height = WPAWindowHeight - 93;
  1395. document.all.ifrmMainFrame.style.width = WPAWindowWidth;
  1396. }
  1397. WPABackground.src = 'images/wpaback.jpg';
  1398. WPATop.src = 'images/wpatop.jpg';
  1399. WPABottom.src = 'images/wpabtm.jpg';
  1400. WPAFlag.src = 'images/wpaflag.jpg';
  1401. WPABottom.style.top = WPAWindowHeight - 45;
  1402. }
  1403. window.onresize = SetupPageLayout;
  1404. function InitApplication()
  1405. {
  1406. var bNoModem = false;
  1407. SetupPageLayout();
  1408. g_bStartup = true;
  1409. InitFrameRef();
  1410. if ( 1 == DirObj.get_Offline() || window.external.CheckDialReady() != ERR_COMM_NO_ERROR)
  1411. {
  1412. bNoModem = true;
  1413. g_status = STATUS_OFF;
  1414. }
  1415. InitCKPT();
  1416. if (0 != DirObj.get_AppMode)
  1417. {
  1418. do
  1419. {
  1420. PopCKPT();
  1421. }
  1422. while (null != g_CurrentCKPT);
  1423. }
  1424. GoNavigate(CKPT_REGRMIND);
  1425. spnPage.style.visibility = "visible";
  1426. }
  1427. function GetPageTitle()
  1428. {
  1429. Span_WPA_MainTitle.innerText = g.Title_Text.innerText;
  1430. }
  1431. </script>
  1432. </HEAD>
  1433. <BODY DIR=LTR bgcolor="#4E6FD6" topMargin=0 leftMargin=0 onload="InitApplication();" scroll=no tabIndex=-1 rightMargin=0>
  1434. <!-- WPA images, dynamic layout positioning will be done in SetupPageLayout() function -->
  1435. <IMG ID=WPABackground style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-99;" alt="">
  1436. <IMG ID=WPATop style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-97;" alt="">
  1437. <IMG ID=WPABottom style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-96;" alt="">
  1438. <!-- Don't alter this table structure. It's designed to support BiDi and Non-BiDi. -->
  1439. <TABLE WIDTH="95%" BORDER=0 style="POSITION: absolute; LEFT: 20px; TOP: 0px;" CELLPADDING=0 CELLSPACING=0>
  1440. <TR>
  1441. <TD nowrap VALIGN=MIDDLE>
  1442. <SPAN id=Span_WPA_MainTitle class="title" style="height: 28px;" tabIndex=-1>
  1443. </SPAN>
  1444. </TD>
  1445. <TD WIDTH="99%">&nbsp;
  1446. </TD>
  1447. <TD VALIGN=TOP>
  1448. <IMG ID=WPAFlag alt="">
  1449. </TD>
  1450. </TR>
  1451. </TABLE>
  1452. <SPAN id=spnPage style="VISIBILITY: hidden" tabIndex=-1>
  1453. <span id=spnMainFrame style="POSITION: absolute; LEFT: 0px; TOP: 48px; width=100%; height=100%;" tabIndex=-1>
  1454. <IFRAME ALLOWTRANSPARENCY="true" frameBorder=no width="100%" height="100%" id=ifrmMainFrame name=msoobeMain src="about:blank" tabIndex=0></IFRAME>
  1455. </SPAN>
  1456. </SPAN>
  1457. </BODY>
  1458. </HTML>