mirror of https://github.com/tongzx/nt5src
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
1981 lines
43 KiB
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Microsoft Out-of-Box Experience</TITLE>
|
|
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
|
<LINK REL="stylesheet" TYPE="text/css" HREF="regsetup\regstyl.css">
|
|
<script language=jscript src="oobeutil.js"></script>
|
|
<script language=jscript src="dialmgr.js"></script>
|
|
<script language=jscript src="error.js"></script>
|
|
<script language=jscript src="icsmgr.js"></script>
|
|
|
|
<script language=jscript>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var STATUS_MSN = 0;
|
|
var STATUS_OEM = 1;
|
|
var STATUS_NONE = 2;
|
|
var STATUS_OFF = 3;
|
|
var STATUS_MAX = 4;
|
|
var SNDX_WELCOME = 0;
|
|
var SNDX_MSN_ISP = 1;
|
|
var SNDX_MSN_REG = 2;
|
|
var SNDX_MSN_FINISH = 3;
|
|
var SNDX_OEM_REG = 1;
|
|
var SNDX_OEM_ISP = 2;
|
|
var SNDX_OEM_FINISH = 3;
|
|
var SNDX_NONE_REG = 1;
|
|
var SNDX_NONE_FINISH = 2;
|
|
var SNDX_OFF_EULA = 1;
|
|
var SNDX_OFF_PID = 2;
|
|
var SNDX_OFF_FINISH = 3;
|
|
function CheckPoint(strURL, i1, i2, i3, i4)
|
|
{
|
|
this.strURL = strURL;
|
|
this.rgindex = new Array(STATUS_MAX);
|
|
this.rgindex[STATUS_MSN] = i1;
|
|
this.rgindex[STATUS_OEM] = i2;
|
|
this.rgindex[STATUS_NONE] = i3;
|
|
this.rgindex[STATUS_OFF] = i4;
|
|
}
|
|
|
|
|
|
var CONNECTED_REFFERAL = 1;
|
|
var CONNECTED_ISP_SIGNUP = 2;
|
|
var CONNECTED_ISP_MIGRATE = 3;
|
|
var CONNECTED_REGISTRATION = 4;
|
|
|
|
|
|
|
|
var CKPT_REGRMIND = 1;
|
|
var CKPT_REGISTER3 = 2;
|
|
var CKPT_REGCONN = 3;
|
|
var CKPT_REGLAN = 4;
|
|
var CKPT_REGDIAL = 5;
|
|
var CKPT_ACT_MSG = 6;
|
|
var CKPT_DONE = 7;
|
|
var CKPT_MAX = 8;
|
|
|
|
var CKPT_ISPDIAL = CKPT_MAX;
|
|
var CKPT_REFDIAL = CKPT_MAX;
|
|
var CKPT_MIGDIAL = CKPT_MAX;
|
|
var CKPT_REGISTER1 = CKPT_MAX;
|
|
var CKPT_ISPSIGNUP = CKPT_DONE;
|
|
|
|
|
|
var dnCKPT = new Array(CKPT_MAX);
|
|
|
|
|
|
var g_CurrentCKPT = null;
|
|
var g_DialCKPT = null;
|
|
var HKEY_LOCAL_MACHINE = 0x80000002;
|
|
var OOBE_MAIN_REG_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OOBE";
|
|
var CKPT_REG_KEY = "\\CKPT";
|
|
var TOS_REG_VALUE = "TOS";
|
|
|
|
|
|
var ERR_COMM_NO_ERROR = 0;
|
|
var ERR_COMM_OOBE_COMP_MISSING = 1;
|
|
var ERR_COMM_UNKNOWN = 2;
|
|
var ERR_COMM_NOMODEM = 3;
|
|
var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
|
|
|
|
|
|
var DERR_DIALTONE = 680;
|
|
var DERR_BUSY = 676;
|
|
var DERR_VOICEANSWER = 677;
|
|
var DERR_NOANSWER = 678;
|
|
var DERR_NO_CARRIER = 679;
|
|
var DERR_HARDWARE_FAILURE = 630;
|
|
var DERR_PORT_ALREADY_OPEN = 602;
|
|
var DERR_PORT_OR_DEVICE = 692;
|
|
var DERR_PPP_TIMEOUT = 718;
|
|
var DERR_REMOTE_DISCONNECT = 629;
|
|
|
|
|
|
var FINISH_OK = 0x00000000;
|
|
var FINISH_REBOOT = 0x00000001;
|
|
var FINISH_BAD_PID = 0x00000002;
|
|
var FINISH_BAD_EULA = 0x00000004;
|
|
var FINISH_BAD_STAMP = 0x00000008;
|
|
|
|
|
|
var LANGUAGE_REBOOT_NEVER = 0;
|
|
var LANGUAGE_REBOOT_NOW = 1;
|
|
var LANGUAGE_REBOOT_END = 2;
|
|
|
|
|
|
var HIDE_BACK = 0x0001;
|
|
var HIDE_NEXT = 0x0002;
|
|
var HIDE_CANCEL = 0x0004;
|
|
var HIDE_RESTORE = 0x0008;
|
|
|
|
|
|
|
|
var NOLAUNCHISPSIGNUP = "{C37D92A5-CA34-11d2-B71C-00C04F794977}";
|
|
var MSNCOMPLETED = "{1C0A22F2-CB6B-11d2-B544-00A0C949DA70}";
|
|
|
|
|
|
var TapiObj = null;
|
|
var InfoObj = null;
|
|
var EulaObj = null;
|
|
var LangObj = null;
|
|
var PidObj = null;
|
|
var StatusObj = null;
|
|
var DirObj = null;
|
|
var ApiObj = null;
|
|
var RegisterObj = null;
|
|
|
|
|
|
var g_strISPFile = "";
|
|
var g_bStartup;
|
|
var g_LastButtonText = null;
|
|
var g_FirstFocusElement = null;
|
|
var g = null;
|
|
var g_SpecialChars = ".'-` ";
|
|
var g_OOBEDir = "file://" + window.external.API.get_SystemDirectory() + "\\oobe\\";
|
|
var g_bRedial = false;
|
|
var g_LineProblem = 0;
|
|
var g_bFirstServerError = true;
|
|
var g_status = STATUS_OFF;
|
|
var g_ServerErrorCount = 0;
|
|
var g_IMEExists = false;
|
|
var g_OEMAddBackURL = "";
|
|
var g_DialingAvailableInCountry = true;
|
|
var g_ModalDialogUp = false;
|
|
var g_RemoveRemind = false;
|
|
var MS_REGISTRATION = "{1C956940-8617-11D3-8B99-00A0C91E7F3C}";
|
|
var OEM_REGISTRATION = "{ECD24360-B210-11D3-8B99-00A0C91E7F3C}";
|
|
var g_bTapiDone = false;
|
|
var g_OEMNameStr=window.external.Signup.get_OEMName();
|
|
var L_MS_Text="Microsoft";
|
|
var g_InitAutodial = false;
|
|
|
|
var L_CheckConnectivity_Text = "Checking for connectivity...";
|
|
var L_BlankTitle_Text = "";
|
|
|
|
var g_IsMSRegistrationSuccessful = false;
|
|
var g_IsOEMRegistrationSuccessful = false;
|
|
|
|
|
|
if (null == ApiObj)
|
|
{
|
|
ApiObj = new Object;
|
|
ApiObj = window.external.API;
|
|
}
|
|
if (null == StatusObj)
|
|
{
|
|
StatusObj = new Object;
|
|
StatusObj = window.external.Status;
|
|
}
|
|
if (null == DirObj)
|
|
{
|
|
DirObj = new Object;
|
|
DirObj = window.external.Directions;
|
|
}
|
|
if (null == InfoObj)
|
|
{
|
|
InfoObj = new Object;
|
|
InfoObj = window.external.UserInfo;
|
|
}
|
|
if (null == RegisterObj)
|
|
{
|
|
RegisterObj = new Object;
|
|
RegisterObj = window.external.Register;
|
|
}
|
|
if (null == TapiObj)
|
|
{
|
|
TapiObj = new Object;
|
|
TapiObj = window.external.Tapi;
|
|
}
|
|
|
|
|
|
|
|
function OnSelectClick() {}
|
|
|
|
|
|
function OnClick() {}
|
|
|
|
|
|
function OnFocus() {}
|
|
|
|
|
|
function SimpleNavBack()
|
|
{
|
|
g.window.history.back();
|
|
}
|
|
|
|
function HandleTextAreaFocus() {
|
|
g.event.srcElement.style.borderStyle="ridge";
|
|
}
|
|
|
|
function HandleTextAreaBlur() {
|
|
g.event.srcElement.style.borderStyle="";
|
|
}
|
|
|
|
|
|
|
|
|
|
function Start_OnKeyPress()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
if ((g.event.keyCode == 13) &&
|
|
(g.btnNext.disabled == false))
|
|
{
|
|
GoNext();
|
|
}
|
|
else
|
|
{
|
|
KeyPressIsValid();
|
|
}
|
|
}
|
|
|
|
function CheckUserLocale()
|
|
{
|
|
|
|
|
|
|
|
var language = ApiObj.get_UserDefaultLCID;
|
|
|
|
if (language == MAKELCID(MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN), SORT_DEFAULT) ||
|
|
language == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL), SORT_DEFAULT) ||
|
|
language == MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT))
|
|
return false;
|
|
else
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function RemindChkBoxClick()
|
|
{
|
|
g_RemoveRemind = g.RemoveReminder.checked;
|
|
if (g.btnNext.disabled)
|
|
{
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.onclick = GoNext;
|
|
g.btnNext.focus();
|
|
|
|
g.rb_reg_ms_no.checked = true;
|
|
g.rb_reg_oem_no.checked = true;
|
|
}
|
|
}
|
|
|
|
function Start_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
var L_Title1_Text = "Ready to register with %1 and %2?";
|
|
g.Title_Text.innerText = ApiObj.FormatMessage(L_Title1_Text, g_OEMNameStr, L_MS_Text);
|
|
GetPageTitle();
|
|
|
|
if (g_OEMNameStr.length != 0)
|
|
{
|
|
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.";
|
|
g.welcome_namestr.innerText = ApiObj.FormatMessage(L_OEM_Text, g_OEMNameStr, g_OEMNameStr);
|
|
|
|
var L_Question_Text = "Are you ready to register online with %1?";
|
|
g.reg1_oem_TxtQuestion.innerText = ApiObj.FormatMessage(L_Question_Text, g_OEMNameStr);
|
|
|
|
var L_Answer_Text = "Y<u>e</u>s, I'd like to register with %1 now";
|
|
g.reg1_spn3.innerHTML = ApiObj.FormatMessage(L_Answer_Text, g_OEMNameStr);
|
|
|
|
}
|
|
g.WelcomePageText.style.visibility="visible";
|
|
g.OEMName3.innerText=g_OEMNameStr;
|
|
|
|
|
|
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))
|
|
{
|
|
g.btnNext.disabled = false;
|
|
g_FirstFocusElement = g.btnNext;
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.disabled = true;
|
|
g_FirstFocusElement = g.btnQuit;
|
|
}
|
|
InitButtons();
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
function Reg1RadioClicked()
|
|
{
|
|
if (g.btnNext.disabled)
|
|
{
|
|
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))
|
|
{
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.onclick = GoNext;
|
|
g.btnNext.focus();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
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");
|
|
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");
|
|
var ProvinceNames = new Array("","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon");
|
|
|
|
|
|
var g_StateName2IndexMap= new ActiveXObject("Scripting.Dictionary");
|
|
var g_ProvinceName2IndexMap= new ActiveXObject("Scripting.Dictionary");
|
|
|
|
g_ProvinceName2IndexMap.CompareMode = 1;
|
|
g_StateName2IndexMap.CompareMode = 1;
|
|
|
|
|
|
var ii;
|
|
for(ii=1;ii<=FullStateNames.length;ii++) {
|
|
|
|
g_StateName2IndexMap.Add(FullStateNames[ii-1].toUpperCase(),ii);
|
|
g_StateName2IndexMap.Add(StateAbbrevs[ii].toUpperCase(),ii);
|
|
|
|
if(ii < ProvinceNames.length) {
|
|
g_ProvinceName2IndexMap.Add(ProvinceNames[ii].toUpperCase(),ii);
|
|
}
|
|
}
|
|
|
|
var L_Postal_Text = "Postal or <u>Z</u>IP code:";
|
|
var L_AsteriskPostal_Text = "*Postal or <u>Z</u>IP code:";
|
|
var L_Province_Text= "State/<u>P</u>rovince:";
|
|
var L_AsteriskProvince_Text= "*State/<u>P</u>rovince:";
|
|
|
|
var L_Canada_Text="Canada";
|
|
var L_UnitedStates_Text="United States";
|
|
|
|
function Reg3UserCountryChanged() {
|
|
|
|
|
|
|
|
|
|
g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
|
|
|
|
if(g_Country == L_UnitedStates_Text) {
|
|
if(g.selUSState.style.display!="inline") {
|
|
g.selUSState.style.display="inline";
|
|
}
|
|
|
|
g.selCAProvince.style.display="none";
|
|
g.UserStateTextBox.style.display="none";
|
|
|
|
|
|
if(g.UserStateTextBox.value!="") {
|
|
var res=g_StateName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
|
|
if(res!=null) {
|
|
g.selUSState.selectedIndex=res;
|
|
}
|
|
}
|
|
g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
|
|
g.StateLabel.innerHTML = L_AsteriskProvince_Text;
|
|
} else if(g_Country == L_Canada_Text) {
|
|
g.selUSState.style.display="none";
|
|
g.selCAProvince.style.display="inline";
|
|
g.UserStateTextBox.style.display="none";
|
|
|
|
|
|
if(g.UserStateTextBox.value!="") {
|
|
var res=g_ProvinceName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
|
|
if(res!=null) {
|
|
g.selCAProvince.selectedIndex=res;
|
|
}
|
|
}
|
|
g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
|
|
g.StateLabel.innerHTML = L_AsteriskProvince_Text;
|
|
} else {
|
|
g.selUSState.style.display="none";
|
|
g.selCAProvince.style.display="none";
|
|
g.UserStateTextBox.style.display="inline";
|
|
g.LabelZIP.innerHTML = L_Postal_Text;
|
|
g.StateLabel.innerHTML = L_Province_Text;
|
|
}
|
|
|
|
g_CountryIdx=g.selCountry.selectedIndex;
|
|
|
|
Reg3UserStateChanged();
|
|
}
|
|
|
|
var L_FullName_Text="*<u>F</u>ull Name:";
|
|
|
|
function Reg3UserStateChanged() {
|
|
|
|
|
|
|
|
|
|
|
|
if(g.selUSState.style.display!="none")
|
|
{
|
|
g_StateIdx=g.selUSState.selectedIndex;
|
|
g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
|
|
g.StateLabel.htmlFor="selUSState";
|
|
}
|
|
else if (g.selCAProvince.style.display!="none")
|
|
{
|
|
g_StateIdx=g.selCAProvince.selectedIndex;
|
|
g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
|
|
g.StateLabel.htmlFor="selCAProvince";
|
|
}
|
|
else
|
|
{
|
|
g_State = g.UserStateTextBox.value;
|
|
g.StateLabel.htmlFor="UserStateTextBox";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
var g_FirstName=InfoObj.get_FirstName();
|
|
|
|
var g_LastName=InfoObj.get_LastName();
|
|
var g_Address1=InfoObj.get_Address1();
|
|
var g_Address2=InfoObj.get_Address2();
|
|
var g_City=InfoObj.get_City();
|
|
var g_ZipCode=InfoObj.get_Zip();
|
|
var g_EmailAddr= InfoObj.get_PrimaryEmail();
|
|
var g_PhoneNumber = InfoObj.get_PhoneNumber();
|
|
var g_Country=InfoObj.get_Country();
|
|
var g_CountryIdx=-1;
|
|
var g_State=InfoObj.get_State();
|
|
var g_StateIdx=0;
|
|
|
|
function Reg3SaveSettings() {
|
|
g_FirstName=g.UserFirstName.value;
|
|
|
|
g_LastName=g.UserLastName.value;
|
|
g_Address1=g.UserAddress.value;
|
|
g_Address2=g.UserAddress2.value;
|
|
g_ZipCode=g.UserZipCode.value;
|
|
g_EmailAddr=g.UserEmailAddress.value;
|
|
g_PhoneNumber=g.UserPhoneNumber.value;
|
|
g_City=g.UserCity.value;
|
|
g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
|
|
|
|
if(g.UserStateTextBox.style.display!="none")
|
|
{
|
|
g_State=g.UserStateTextBox.value;
|
|
}
|
|
else if (g.selUSState.style.display!="none")
|
|
{
|
|
g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
|
|
}
|
|
else
|
|
{
|
|
g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
|
|
}
|
|
|
|
InfoObj.set_FirstName(g_FirstName);
|
|
InfoObj.set_LastName(g_LastName);
|
|
|
|
InfoObj.set_Country(g_Country);
|
|
InfoObj.set_State(g_State);
|
|
InfoObj.set_Address1(g_Address1);
|
|
InfoObj.set_Address2(g_Address2);
|
|
InfoObj.set_PrimaryEmail(g_EmailAddr);
|
|
InfoObj.set_PhoneNumber(g_PhoneNumber);
|
|
InfoObj.set_Zip(g_ZipCode);
|
|
InfoObj.set_City(g_City);
|
|
|
|
TapiObj.set_CountryIndex(g.selCountry.selectedIndex);
|
|
|
|
}
|
|
|
|
function Reg3_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
GetPageTitle();
|
|
|
|
|
|
g_FirstFocusElement = g.UserFirstName;
|
|
|
|
if (IsFarEastLocale())
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g.MainPageCell.style.display="none";
|
|
|
|
|
|
|
|
|
|
g.FieldTable.moveRow(2,0);
|
|
g.FieldTable.moveRow(7,3);
|
|
g.FieldTable.moveRow(7,4);
|
|
g.FieldTable.moveRow(7,5);
|
|
|
|
g.FE_ZIPLabel.innerHTML=g.LabelRight.innerHTML;
|
|
g.FE_ZIPInput.innerHTML=g.MenuRight.innerHTML;
|
|
g.FE_ZIPRow.style.display="inline";
|
|
|
|
g.LabelRight.innerHTML="";
|
|
g.MenuRight.innerHTML="";
|
|
|
|
|
|
g.UserZipCode.size=30;
|
|
g.UserZipCode.maxlength=120;
|
|
|
|
g.UserStateTextBox.size=30;
|
|
g.UserStateTextBox.maxlength=120;
|
|
|
|
g_FirstFocusElement = g.UserLastName;
|
|
|
|
if (IsKoreanLocale()) {
|
|
g.LastNameRow.style.display="none";
|
|
g.LabelFirstName.innerHTML=L_FullName_Text;
|
|
g_FirstFocusElement = g.UserFirstName;
|
|
}
|
|
|
|
g.MainPageCell.style.display="inline";
|
|
}
|
|
|
|
|
|
g.selCountry.style.width=g.UserEmailAddress.offsetWidth;
|
|
|
|
g.UserFirstName.value=g_FirstName;
|
|
|
|
g.UserLastName.value=g_LastName;
|
|
g.UserAddress.value=g_Address1;
|
|
g.UserAddress2.value=g_Address2;
|
|
g.UserZipCode.value=g_ZipCode;
|
|
g.UserEmailAddress.value=g_EmailAddr;
|
|
g.UserPhoneNumber.value=g_PhoneNumber;
|
|
g.UserCity.value=g_City;
|
|
|
|
|
|
|
|
|
|
|
|
g.selUSState.remove(0);
|
|
|
|
for (var i = 0; i < StateAbbrevs.length; i++) {
|
|
var oOption = g.document.createElement("OPTION");
|
|
oOption.text = StateAbbrevs[i];
|
|
if (StateAbbrevs[i] == g_State)
|
|
{
|
|
g_StateIdx = i;
|
|
}
|
|
g.selUSState.add(oOption);
|
|
}
|
|
|
|
for (i = 0; i < ProvinceNames.length; i++) {
|
|
oOption = g.document.createElement("OPTION");
|
|
oOption.text = ProvinceNames[i];
|
|
if (ProvinceNames[i] == g_State)
|
|
{
|
|
g_StateIdx = i;
|
|
}
|
|
g.selCAProvince.add(oOption);
|
|
}
|
|
|
|
var fTapi = TapiObj.IsTAPIConfigured();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_CountryIdx = TapiObj.get_CountryIndex();
|
|
|
|
if(g_CountryIdx>=0)
|
|
{
|
|
g.selCountry.selectedIndex=g_CountryIdx;
|
|
if(g_Country == L_UnitedStates_Text)
|
|
{
|
|
g.selUSState.selectedIndex=g_StateIdx;
|
|
}
|
|
else if(g_Country == L_Canada_Text)
|
|
{
|
|
g.selCAProvince.selectedIndex=g_StateIdx;
|
|
}
|
|
else
|
|
g.UserStateTextBox.value=g_State;
|
|
}
|
|
else
|
|
{
|
|
|
|
g.selCountry.selectedIndex = TapiObj.get_CountryIndex();
|
|
}
|
|
|
|
Reg3UserCountryChanged();
|
|
Reg3UserStateChanged();
|
|
|
|
|
|
InitButtons();
|
|
|
|
g.error_mesg.innerHTML = L_RequiredField_Text;
|
|
g.error_mesg.style.display="inline";
|
|
|
|
g_FirstFocusElement.focus();
|
|
|
|
}
|
|
function GetCurrentProvince() {
|
|
if(g.selCountry.options(g.selCountry.selectedIndex).text == L_UnitedStates_Text) {
|
|
return g.selUSState.options(g.selUSState.selectedIndex).text;
|
|
} else if(g.selCountry.options(g.selCountry.selectedIndex).text == L_Canada_Text) {
|
|
return g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
|
|
} else return g.UserStateTextBox.value;
|
|
}
|
|
|
|
function GetCurrentCountry() {
|
|
return g.selCountry.options(g.selCountry.selectedIndex).text;
|
|
}
|
|
|
|
var L_Email_Text="Please enter a valid E-mail address or leave the E-mail text box empty.";
|
|
var L_EnterValid_Text="* Please fill in the required fields.";
|
|
var L_RequiredField_Text="* indicates required information";
|
|
|
|
var g_PostToMS = true;
|
|
var g_PostToOEM = true;
|
|
var POST_TO_OEM = 1;
|
|
var POST_TO_MS = 2;
|
|
|
|
|
|
|
|
function navigatetoPrivacy(PrivPage)
|
|
{
|
|
if(g_CurrentCKPT == CKPT_REGISTER3) {
|
|
Reg3SaveSettings();
|
|
}
|
|
|
|
if(PrivPage == "MS")
|
|
g.navigate("rprvcyMS.htm");
|
|
else
|
|
g.navigate("rOEMpriv.htm");
|
|
}
|
|
|
|
|
|
|
|
function VerifyReg3Fields() {
|
|
g.error_mesg.style.display="none";
|
|
var LastErrorField = null;
|
|
|
|
var CurReg3ErrStringArray = new Array();
|
|
|
|
|
|
|
|
|
|
if(g.UserEmailAddress.value != "") {
|
|
|
|
|
|
var re = new RegExp("^\\s*\\S+@\\S+\\.\\S\\S+","");
|
|
if(re.exec(g.UserEmailAddress.value) == null) {
|
|
LastErrorField = g.UserEmailAddress;
|
|
g.LabelEmail.style.color = "red";
|
|
} else {
|
|
g.LabelEmail.style.color = "black";
|
|
}
|
|
}
|
|
|
|
var CurCountry=GetCurrentCountry();
|
|
|
|
|
|
if ((CurCountry == L_UnitedStates_Text)||(CurCountry == L_Canada_Text)) {
|
|
if(g.UserZipCode.value == "") {
|
|
LastErrorField = g.UserZipCode;
|
|
g.LabelZIP.className="text-error";
|
|
} else {
|
|
g.LabelZIP.className="text-primary";
|
|
}
|
|
|
|
if(GetCurrentProvince() == "") {
|
|
if(g.selUSState.style.display!="none") {
|
|
LastErrorField = g.selUSState;
|
|
} else {
|
|
LastErrorField = g.selCAProvince;
|
|
}
|
|
g.StateLabel.className="text-error";
|
|
|
|
} else {
|
|
g.StateLabel.className="text-primary";
|
|
}
|
|
}
|
|
|
|
|
|
if(g.UserCity.value == "") {
|
|
LastErrorField = g.UserCity;
|
|
g.LabelCity.className="text-error";
|
|
} else {
|
|
g.LabelCity.className="text-primary";
|
|
}
|
|
|
|
if(g.UserAddress.value == "") {
|
|
LastErrorField = g.UserAddress;
|
|
g.LabelAddress.className="text-error";
|
|
} else {
|
|
g.LabelAddress.className="text-primary";
|
|
}
|
|
|
|
if((g.UserLastName.value == "") && (g.LastNameRow.style.display!="none")) {
|
|
LastErrorField = g.UserLastName;
|
|
g.LabelLastName.className="text-error";
|
|
} else {
|
|
g.LabelLastName.className="text-primary";
|
|
}
|
|
|
|
if(g.UserFirstName.value == "") {
|
|
g.LabelFirstName.className="text-error";
|
|
LastErrorField = g.UserFirstName;
|
|
} else {
|
|
g.LabelFirstName.className="text-primary";
|
|
}
|
|
|
|
if(LastErrorField==null) {
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
if(LastErrorField==g.UserEmailAddress) {
|
|
g.error_mesg.innerText = L_Email_Text;
|
|
} else {
|
|
g.error_mesg.innerText = L_EnterValid_Text;
|
|
}
|
|
|
|
g.error_mesg.style.display="inline";
|
|
|
|
try
|
|
{
|
|
g.btnNext.disabled=false;
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnBack.disabled=false;
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnSkip.disabled=false;
|
|
}
|
|
catch(e) {}
|
|
InitButtons();
|
|
|
|
LastErrorField.focus();
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Start_CheckEnableNextButton()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (Start_CheckLengthRequirement() &&
|
|
Start_CheckLengthNotEqualSpaces())
|
|
{
|
|
g.btnNext.disabled = false;
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.disabled = true;
|
|
}
|
|
InitButtons();
|
|
}
|
|
|
|
function Start_CheckLengthRequirement()
|
|
{
|
|
if ((g.edt_FirstName.value.length != 0) ||
|
|
(g.edt_LastName.value.length != 0))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function Start_CheckLengthNotEqualSpaces()
|
|
{
|
|
if ((g.edt_FirstName.value.length != NumberOfSpaces(g.edt_FirstName.value)) ||
|
|
(g.edt_LastName.value.length != NumberOfSpaces(g.edt_LastName.value)))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
function DoFocus()
|
|
{
|
|
try
|
|
{g_FirstFocusElement.focus();}
|
|
catch(e){}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var g_RegConnRadioSticky = 1;
|
|
|
|
function RegConn_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
GetPageTitle();
|
|
|
|
if (g_RegConnRadioSticky == 1)
|
|
{
|
|
g_FirstFocusElement = g.rb_conn_lan;
|
|
g.rb_conn_lan.checked = true;
|
|
}
|
|
else
|
|
{
|
|
g_FirstFocusElement = g.rb_conn_modem;
|
|
g.rb_conn_modem.checked = true;
|
|
}
|
|
|
|
InitButtons();
|
|
|
|
DoFocus();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ProxySettingsObj = null;
|
|
|
|
function ProxySettings(ConfigString)
|
|
{
|
|
this.UseAuto = false;
|
|
this.UseScript = false;
|
|
this.ScriptUrl = "";
|
|
this.UseProxy = false;
|
|
this.Server = "";
|
|
this.Port = "";
|
|
|
|
if (ConfigString != null)
|
|
{
|
|
var i, j;
|
|
var Args = ConfigString.split(/ /);
|
|
|
|
for (i = 0; i < Args.length; i++)
|
|
{
|
|
switch (Args[i])
|
|
{
|
|
case 'u':
|
|
var ProxyList = Args[++i];
|
|
var HttpProxy = null;
|
|
|
|
|
|
if (ProxyList.indexOf("=") == -1)
|
|
{
|
|
HttpProxy = ProxyList;
|
|
}
|
|
else
|
|
{
|
|
var Proxys = ProxyList.split(/;/);
|
|
if (Proxys != null)
|
|
{
|
|
for (j = 0; j < Proxys.length; j++)
|
|
{
|
|
if (Proxys[j].indexOf("http=") == 0)
|
|
{
|
|
HttpProxy = Proxys[j].substring(5, Proxys[j].length);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (HttpProxy)
|
|
{
|
|
j = HttpProxy.lastIndexOf(':');
|
|
if (j == -1)
|
|
{
|
|
this.Server = HttpProxy;
|
|
}
|
|
else
|
|
{
|
|
this.Server = HttpProxy.substring(0, j);
|
|
this.Port = HttpProxy.substring(j+1, HttpProxy.length);
|
|
}
|
|
}
|
|
break;
|
|
|
|
case 'a':
|
|
this.UseAuto = true;
|
|
break;
|
|
|
|
case 'm':
|
|
this.UseProxy = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function RegLan_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
GetPageTitle();
|
|
|
|
InitButtons();
|
|
|
|
if (ProxySettingsObj == null)
|
|
{
|
|
var ConfigString = window.external.get_ProxySettings();
|
|
ProxySettingsObj = new ProxySettings(ConfigString);
|
|
}
|
|
|
|
g.cb_auto_detect.checked = ProxySettingsObj.UseAuto;
|
|
g.cb_use_proxy.checked = ProxySettingsObj.UseProxy;
|
|
g.txt_proxy_url.value = ProxySettingsObj.Server;
|
|
g.txt_proxy_port.value = ProxySettingsObj.Port;
|
|
|
|
RegLan_upClickHandler();
|
|
|
|
g_FirstFocusElement = g.btnNext;
|
|
DoFocus();
|
|
}
|
|
|
|
function RegLan_upClickHandler()
|
|
{
|
|
if (g.cb_use_proxy.checked)
|
|
{
|
|
g.txt_proxy_url.style.backgroundColor = "#ffffff";
|
|
g.txt_proxy_url.disabled = false;
|
|
g.txt_proxy_port.style.backgroundColor = "#ffffff";
|
|
g.txt_proxy_port.disabled = false;
|
|
}
|
|
else
|
|
{
|
|
g.txt_proxy_url.style.backgroundColor = "#dddddd";
|
|
g.txt_proxy_url.disabled = true;
|
|
g.txt_proxy_port.style.backgroundColor = "#dddddd";
|
|
g.txt_proxy_port.disabled = true;
|
|
}
|
|
}
|
|
|
|
function RegLan(Stage)
|
|
{
|
|
if (Stage == null)
|
|
{
|
|
|
|
|
|
|
|
var L_CheckingConnectivity_Text = "Checking connectivity...";
|
|
Span_WPA_MainTitle.innerText = L_CheckingConnectivity_Text;
|
|
ResetConnectedToInternetEx();
|
|
ConnectedToInternetEx(true, "RegLan(1);");
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
|
|
if (ConnectedToInternetEx(false))
|
|
{
|
|
IcsConnect(ICS_CONN_TYPE_REG);
|
|
}
|
|
else
|
|
{
|
|
GoNavigate(CKPT_ACT_MSG);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Activation_ResetNetworking()
|
|
{
|
|
if (window.external.CheckOnlineStatus)
|
|
{
|
|
ResetDialing();
|
|
}
|
|
|
|
if (g_InitAutodial)
|
|
{
|
|
window.external.InternetAutodialHangup();
|
|
g_InitAutodial = false;
|
|
}
|
|
}
|
|
|
|
|
|
function reg_desktop_error_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
GetPageTitle();
|
|
|
|
Activation_ResetNetworking();
|
|
|
|
if (g_IsMSRegistrationSuccessful || g_IsOEMRegistrationSuccessful)
|
|
{
|
|
var L_RegThankYou_Text = "Thank You!";
|
|
Span_WPA_MainTitle.innerText = L_RegThankYou_Text;
|
|
g.acterror_description_SUCCESS1.style.display="inline";
|
|
g.btnQuit.style.visibility = "hidden";
|
|
|
|
var L_FinishButton_Text = "OK";
|
|
g.btnNext.innerHTML = L_FinishButton_Text;
|
|
|
|
var Accesskey_O = "O";
|
|
g.btnNext.accessKey = Accesskey_O;
|
|
}
|
|
else
|
|
{
|
|
var L_RegUnable_Text = "Unable to register online";
|
|
Span_WPA_MainTitle.innerText = L_RegUnable_Text;
|
|
g.acterror_description1.style.display="inline";
|
|
}
|
|
|
|
InitButtons();
|
|
|
|
g_FirstFocusElement = g.btnNext;
|
|
DoFocus();
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function _Default_LoadMe(SimpleBack, SimpleNext)
|
|
{
|
|
InitFrameRef();
|
|
|
|
if (g.btnNext != null)
|
|
g_FirstFocusElement = g.btnNext;
|
|
else if (g.btnSkip != null)
|
|
g_FirstFocusElement = g.btnSkip;
|
|
else if (g.btnBack != null)
|
|
g_FirstFocusElement = g.btnBack;
|
|
|
|
InitButtons(SimpleBack, SimpleNext);
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
else
|
|
g.document.body.focus();
|
|
}
|
|
|
|
function New_Default_LoadMe(SimpleBack, SimpleNext)
|
|
{
|
|
InitFrameRef();
|
|
GetPageTitle();
|
|
|
|
if (g.btnNext != null)
|
|
g_FirstFocusElement = g.btnNext;
|
|
else if (g.btnSkip != null)
|
|
g_FirstFocusElement = g.btnSkip;
|
|
else if (g.btnBack != null)
|
|
g_FirstFocusElement = g.btnBack;
|
|
|
|
InitButtons(SimpleBack, SimpleNext);
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
else
|
|
g.document.body.focus();
|
|
}
|
|
|
|
|
|
function OEMPrivacy_LoadMe(NewSimpleBack, NewSimpleNext)
|
|
{
|
|
New_Default_LoadMe(NewSimpleBack, NewSimpleNext);
|
|
|
|
if (g_OEMNameStr.length != 0)
|
|
{
|
|
var L_Title1_Text = "%1 Privacy Statement";
|
|
g.Title_Text.innerText = ApiObj.FormatMessage(L_Title1_Text, g_OEMNameStr);
|
|
GetPageTitle();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function InitCKPT()
|
|
{
|
|
dnCKPT[CKPT_REGRMIND] = new CheckPoint("regsetup\\regrmnd.htm", 0, 0, 0, 0);
|
|
dnCKPT[CKPT_REGISTER3] = new CheckPoint("regsetup\\rusrinfo.htm", 0, 0, 0, 0);
|
|
dnCKPT[CKPT_REGCONN] = new CheckPoint("regsetup\\regconn.htm", 0, 0, 0, 0);
|
|
dnCKPT[CKPT_REGLAN] = new CheckPoint("regsetup\\reglan.htm", 0, 0, 0, 0);
|
|
dnCKPT[CKPT_REGDIAL] = new CheckPoint("regsetup\\rdrdyreg.htm", 0, 0, 0, 0);
|
|
dnCKPT[CKPT_ACT_MSG] = new CheckPoint("regsetup\\rdeskerr.htm", 0, 0, 0, 0);
|
|
dnCKPT[CKPT_DONE] = new CheckPoint("regsetup\\regdone.htm", 0, 0, 0, 0);
|
|
PopCKPT();
|
|
}
|
|
|
|
function PushCKPT(ckpt)
|
|
{
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
var tos = 0;
|
|
try
|
|
{
|
|
tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
|
|
}
|
|
catch (e) {}
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString(), ckpt);
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, ++tos);
|
|
g_CurrentCKPT = ckpt;
|
|
}
|
|
}
|
|
|
|
function PopCKPT(ckptCheck)
|
|
{
|
|
var ckpt = 0;
|
|
try
|
|
{
|
|
var tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
|
|
if (tos > 0)
|
|
{
|
|
ckpt = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, (tos - 1).toString());
|
|
|
|
if (null == ckptCheck || ckpt == ckptCheck)
|
|
{
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, --tos);
|
|
ApiObj.DeleteRegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString());
|
|
}
|
|
}
|
|
}
|
|
catch (e) {}
|
|
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
g_CurrentCKPT = ckpt;
|
|
}
|
|
else
|
|
g_CurrentCKPT = null;
|
|
}
|
|
|
|
function URLFromCKPT(ckpt)
|
|
{
|
|
var str = "";
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
str = dnCKPT[ckpt].strURL;
|
|
}
|
|
return str;
|
|
}
|
|
|
|
function IndexFromCKPT(ckpt, status)
|
|
{
|
|
var index = 0;
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
var checkpoint = dnCKPT[ckpt];
|
|
index = checkpoint.rgindex[status];
|
|
}
|
|
return index;
|
|
}
|
|
|
|
|
|
function IsLocalFile()
|
|
{
|
|
try
|
|
{
|
|
return (-1 != g.location.protocol.indexOf("file"));
|
|
}
|
|
catch (e)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SetBack(strURL)
|
|
{
|
|
g_OEMAddBackURL = strURL;
|
|
}
|
|
|
|
|
|
function GoCancel(ckpt)
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
|
|
switch (g_CurrentCKPT)
|
|
{
|
|
case CKPT_REGDIAL:
|
|
GoNavigate(CKPT_DONE);
|
|
break;
|
|
case CKPT_REGISTER3:
|
|
GoNavigate(CKPT_DONE);
|
|
break;
|
|
case CKPT_REGLAN:
|
|
RegLan();
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
function GoBack(ckpt)
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
|
|
if (g_CurrentCKPT == g_DialCKPT)
|
|
ResetDialing();
|
|
|
|
if(g_CurrentCKPT == CKPT_REGISTER3)
|
|
{
|
|
Reg3SaveSettings();
|
|
}
|
|
|
|
var ckptPrevious = g_CurrentCKPT;
|
|
PopCKPT();
|
|
|
|
if (ckptPrevious == g_CurrentCKPT)
|
|
{
|
|
|
|
PopCKPT();
|
|
}
|
|
|
|
if (g_CurrentCKPT > 0 && g_CurrentCKPT < CKPT_MAX)
|
|
{
|
|
GoNavigate(g_CurrentCKPT);
|
|
}
|
|
}
|
|
|
|
function StatusNavigate()
|
|
{
|
|
var iMove = IndexFromCKPT(g_CurrentCKPT, g_status) - window.external.get_StatusIndex;
|
|
while (iMove > 0)
|
|
{
|
|
window.external.MoveNext();
|
|
--iMove;
|
|
}
|
|
while (iMove < 0)
|
|
{
|
|
window.external.MovePrevious();
|
|
++iMove;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
function GoNavigate(ckptGoHere)
|
|
{
|
|
try
|
|
{
|
|
if (g_bStartup == false)
|
|
{
|
|
if (IsLocalFile())
|
|
{
|
|
if (g.event != null)
|
|
{
|
|
g.event.returnValue = false;
|
|
g.event.cancelBubble = true;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
g_bStartup = false;
|
|
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
switch (ckptGoHere)
|
|
{
|
|
default:
|
|
PushCKPT(ckptGoHere);
|
|
g.navigate(g_OOBEDir + URLFromCKPT(ckptGoHere));
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DisableAllButtons()
|
|
{
|
|
try
|
|
{
|
|
g.btnNext.disabled=true;
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnBack.disabled=true;
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnSkip.disabled=true;
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
InitButtons();
|
|
}
|
|
catch(e) {}
|
|
}
|
|
|
|
function GoQuit()
|
|
{
|
|
|
|
|
|
|
|
if (g_RemoveRemind)
|
|
window.external.DeleteRemind(0);
|
|
|
|
window.external.Finish();
|
|
}
|
|
|
|
function GoNext()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
DisableAllButtons();
|
|
|
|
switch (g_CurrentCKPT)
|
|
{
|
|
case CKPT_REGRMIND:
|
|
if (g_RemoveRemind)
|
|
window.external.DeleteRemind(0);
|
|
|
|
if (g.rb_reg_ms_yes.checked || g.rb_reg_oem_yes.checked)
|
|
{
|
|
g_PostToMS = g.rb_reg_ms_yes.checked;
|
|
g_PostToOEM = g.rb_reg_oem_yes.checked;
|
|
GoNavigate(CKPT_REGISTER3);
|
|
}
|
|
else
|
|
{
|
|
window.external.Finish();
|
|
return;
|
|
}
|
|
break;
|
|
case CKPT_REGISTER3:
|
|
if(VerifyReg3Fields())
|
|
{
|
|
Span_WPA_MainTitle.innerText = "Checking connectivity...";
|
|
Reg3SaveSettings();
|
|
if (!ConnectedToInternetEx(true))
|
|
{
|
|
|
|
window.external.InternetAutodial();
|
|
ResetConnectedToInternetEx();
|
|
|
|
|
|
if (!ConnectedToInternetEx(true))
|
|
{
|
|
|
|
|
|
if (HasNetwork() && HasModem())
|
|
{
|
|
GoNavigate(CKPT_REGCONN);
|
|
}
|
|
else if (HasNetwork())
|
|
{
|
|
GoNavigate(CKPT_REGLAN);
|
|
}
|
|
else if (HasModem())
|
|
{
|
|
GoNavigate(CKPT_REGDIAL);
|
|
}
|
|
else
|
|
{
|
|
GoNavigate(CKPT_ACTIVERR);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
PushCKPT(CKPT_REGDIAL);
|
|
|
|
g_InitAutodial = true;
|
|
|
|
|
|
|
|
|
|
window.external.Connect(CONNECTED_REGISTRATION, "reg.isp");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
PushCKPT(CKPT_REGDIAL);
|
|
|
|
|
|
|
|
|
|
|
|
window.external.Connect(CONNECTED_REGISTRATION, "reg.isp");
|
|
}
|
|
}
|
|
break;
|
|
case CKPT_REGCONN:
|
|
if (g.rb_conn_lan.checked)
|
|
{
|
|
g_RegConnRadioSticky = 1;
|
|
GoNavigate(CKPT_REGLAN);
|
|
}
|
|
else
|
|
{
|
|
g_RegConnRadioSticky = 2;
|
|
PushCKPT(CKPT_REGDIAL);
|
|
Navigate(URLFromCKPT(CKPT_REGDIAL));
|
|
}
|
|
break;
|
|
case CKPT_REGLAN:
|
|
|
|
ProxySettingsObj.UseAuto = g.cb_auto_detect.checked;
|
|
ProxySettingsObj.UseProxy = g.cb_use_proxy.checked;
|
|
ProxySettingsObj.Server = g.txt_proxy_url.value;
|
|
ProxySettingsObj.Port = g.txt_proxy_port.value;
|
|
|
|
window.external.set_ProxySettings(
|
|
ProxySettingsObj.UseAuto,
|
|
ProxySettingsObj.UseScript,
|
|
ProxySettingsObj.ScriptUrl,
|
|
ProxySettingsObj.UseProxy,
|
|
ProxySettingsObj.Server + ((ProxySettingsObj.Port == "") ? "" : (":" + ProxySettingsObj.Port))
|
|
);
|
|
|
|
RegLan();
|
|
break;
|
|
case CKPT_REGDIAL:
|
|
GoNavigate(CKPT_DONE);
|
|
break;
|
|
case CKPT_ACT_MSG:
|
|
if (!g_IsMSRegistrationSuccessful && !g_IsOEMRegistrationSuccessful)
|
|
{
|
|
GoNavigate(CKPT_REGCONN);
|
|
break;
|
|
}
|
|
|
|
case CKPT_DONE:
|
|
if (g_RemoveRemind)
|
|
window.external.DeleteRemind(0);
|
|
window.external.Finish();
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function GoOffline()
|
|
{
|
|
GoNext();
|
|
}
|
|
|
|
|
|
|
|
function SetLastButtonText()
|
|
{
|
|
if (g.btnNext != null)
|
|
g_LastButtonText = g.btnNextText;
|
|
else if (g.btnBack != null)
|
|
g_LastButtonText = g.btnBackText;
|
|
else if (g.btnRestore != null)
|
|
g_LastButtonText = g.btnRestoreText;
|
|
else if (g.btnCancel != null)
|
|
g_LastButtonText = g.btnCancelText;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function InitFrameRef()
|
|
{
|
|
|
|
g_LastButtonText = null;
|
|
g_FirstFocusElement = null;
|
|
g_LastKeyDown = null;
|
|
|
|
g = document.frames("msoobeMain");
|
|
|
|
try
|
|
{
|
|
|
|
g.document.body.onkeydown = OnKeyDown;
|
|
SetLastButtonText();
|
|
}
|
|
catch(e){}
|
|
|
|
}
|
|
|
|
function HideButtons(buttons)
|
|
{
|
|
if (null != g.btnBack && (buttons & HIDE_BACK))
|
|
{
|
|
g.btnBack.Hide = true;
|
|
}
|
|
|
|
if (null != g.btnNext && (buttons & HIDE_NEXT))
|
|
{
|
|
g.btnNext.Hide = true;
|
|
}
|
|
|
|
|
|
if (null != g.spanCancel && (buttons & HIDE_CANCEL))
|
|
{
|
|
g.btnSkip.Hide = true;
|
|
}
|
|
|
|
if (null != g.spanRestore && (buttons & HIDE_RESTORE))
|
|
{
|
|
g.btnRestore.Hide = true;
|
|
}
|
|
|
|
}
|
|
|
|
function HandleButtonMouseOver()
|
|
{
|
|
|
|
|
|
}
|
|
|
|
function HandleButtonMouseOut()
|
|
{
|
|
|
|
|
|
}
|
|
|
|
function InitButtons(SimpleBack, SimpleNext)
|
|
{
|
|
if(g.btnSkip!=null) {
|
|
g.btnSkip.onmouseover = HandleButtonMouseOver;
|
|
g.btnSkip.onmouseout = HandleButtonMouseOut;
|
|
|
|
if(!g.btnSkip.disabled) {
|
|
g.btnSkip.onclick = GoCancel;
|
|
|
|
|
|
|
|
|
|
|
|
g.btnSkip.className="buttons";
|
|
} else {
|
|
g.btnSkip.className="buttons-disabled";
|
|
}
|
|
}
|
|
|
|
if (g.btnNext != null)
|
|
{
|
|
g.btnNext.onmouseover = HandleButtonMouseOver;
|
|
g.btnNext.onmouseout = HandleButtonMouseOut;
|
|
|
|
if (!g.btnNext.disabled)
|
|
{
|
|
if (SimpleNext == null)
|
|
{
|
|
g.btnNext.onclick = GoNext;
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.onclick = SimpleNavNext;
|
|
}
|
|
g.btnNext.className="buttons";
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.className="buttons-disabled";
|
|
}
|
|
}
|
|
|
|
if (g.btnBack != null)
|
|
{
|
|
g.btnBack.onmouseover = HandleButtonMouseOver;
|
|
g.btnBack.onmouseout = HandleButtonMouseOut;
|
|
|
|
if (!g.btnBack.disabled)
|
|
{
|
|
if (SimpleBack == null)
|
|
{
|
|
g.btnBack.onclick = GoBack;
|
|
}
|
|
else
|
|
{
|
|
g.btnBack.onclick = SimpleNavBack;
|
|
}
|
|
g.btnBack.className="buttons";
|
|
}
|
|
else
|
|
{
|
|
g.btnBack.className="buttons-disabled";
|
|
}
|
|
}
|
|
|
|
try
|
|
{
|
|
if(g.btnQuit != null) {
|
|
g.btnQuit.onmouseover = HandleButtonMouseOver;
|
|
g.btnQuit.onmouseout = HandleButtonMouseOut;
|
|
|
|
|
|
if(g.btnQuit.disabled == false) {
|
|
g.btnQuit.onclick = GoQuit;
|
|
g.btnQuit.className="buttons";
|
|
} else {
|
|
g.btnQuit.className="buttons-disabled";
|
|
}
|
|
}
|
|
} catch(e) {}
|
|
}
|
|
|
|
|
|
var g_LastKeyDown = null;
|
|
function OnKeyDown()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.event.altKey)
|
|
{
|
|
g_LastKeyDown = String.fromCharCode(g.event.keyCode);
|
|
if (g_LastKeyDown != null)
|
|
g_LastKeyDown = g_LastKeyDown.toUpperCase();
|
|
}
|
|
else
|
|
g_LastKeyDown = null;
|
|
}
|
|
|
|
|
|
function KeyPressIsNumeric()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!IsNumeric(g.event.keyCode))
|
|
{
|
|
g.event.keyCode = 0;
|
|
g.event.returnValue = false;
|
|
}
|
|
}
|
|
|
|
function IsNumeric(keyCode)
|
|
{
|
|
if ((keyCode >= 48) && (keyCode <= 57))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function IsSpecial(keyCode)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
}
|
|
|
|
function KeyPressIsValid()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!IsAlpha(g.event.keyCode) &&
|
|
!IsSpecial(g.event.keyCode) &&
|
|
!IsNumeric(g.event.keyCode))
|
|
{
|
|
g.event.keyCode = 0;
|
|
g.event.returnValue = false;
|
|
}
|
|
}
|
|
|
|
function KeyPressIsAlpha()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!IsAlpha(g.event.keyCode))
|
|
{
|
|
g.event.keyCode = 0;
|
|
g.event.returnValue = false;
|
|
}
|
|
}
|
|
|
|
function IsAlpha(keyCode)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
function NumberOfSpaces(strValue)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
var iSpaceCount = 0;
|
|
for (iPosition = 0; iPosition < strValue.length; iPosition ++)
|
|
{
|
|
if (strValue.charAt(iPosition) == ' ')
|
|
{
|
|
iSpaceCount++;
|
|
}
|
|
}
|
|
return iSpaceCount;
|
|
}
|
|
function KeyCodeToUpper()
|
|
{
|
|
var strKeyCode = String.fromCharCode(g.event.keyCode);
|
|
strKeyCode = strKeyCode.toUpperCase();
|
|
g.event.keyCode = strKeyCode.charCodeAt(0);
|
|
}
|
|
|
|
|
|
|
|
var vCurItem = 0;
|
|
|
|
function SetupPageLayout()
|
|
{
|
|
var WPAWindowHeight = document.body.clientHeight;
|
|
var WPAWindowWidth = document.body.clientWidth;
|
|
|
|
if(0 != window.external.Directions.get_AppMode())
|
|
{
|
|
document.all.ifrmMainFrame.style.height = WPAWindowHeight - 93;
|
|
document.all.ifrmMainFrame.style.width = WPAWindowWidth;
|
|
}
|
|
|
|
WPABackground.src = 'images/wpaback.jpg';
|
|
WPATop.src = 'images/wpatop.jpg';
|
|
WPABottom.src = 'images/wpabtm.jpg';
|
|
WPAFlag.src = 'images/wpaflag.jpg';
|
|
|
|
WPABottom.style.top = WPAWindowHeight - 45;
|
|
}
|
|
|
|
window.onresize = SetupPageLayout;
|
|
|
|
function InitApplication()
|
|
{
|
|
var bNoModem = false;
|
|
SetupPageLayout();
|
|
|
|
g_bStartup = true;
|
|
InitFrameRef();
|
|
if ( 1 == DirObj.get_Offline() || window.external.CheckDialReady() != ERR_COMM_NO_ERROR)
|
|
{
|
|
bNoModem = true;
|
|
g_status = STATUS_OFF;
|
|
}
|
|
|
|
|
|
InitCKPT();
|
|
|
|
|
|
if (0 != DirObj.get_AppMode)
|
|
{
|
|
do
|
|
{
|
|
PopCKPT();
|
|
}
|
|
while (null != g_CurrentCKPT);
|
|
}
|
|
|
|
GoNavigate(CKPT_REGRMIND);
|
|
|
|
spnPage.style.visibility = "visible";
|
|
|
|
}
|
|
|
|
function GetPageTitle()
|
|
{
|
|
Span_WPA_MainTitle.innerText = g.Title_Text.innerText;
|
|
}
|
|
|
|
</script>
|
|
|
|
</HEAD>
|
|
|
|
|
|
<BODY DIR=LTR bgcolor="#4E6FD6" topMargin=0 leftMargin=0 onload="InitApplication();" scroll=no tabIndex=-1 rightMargin=0>
|
|
|
|
<!-- WPA images, dynamic layout positioning will be done in SetupPageLayout() function -->
|
|
<IMG ID=WPABackground style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-99;" alt="">
|
|
<IMG ID=WPATop style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-97;" alt="">
|
|
<IMG ID=WPABottom style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-96;" alt="">
|
|
|
|
<!-- Don't alter this table structure. It's designed to support BiDi and Non-BiDi. -->
|
|
<TABLE WIDTH="95%" BORDER=0 style="POSITION: absolute; LEFT: 20px; TOP: 0px;" CELLPADDING=0 CELLSPACING=0>
|
|
<TR>
|
|
<TD nowrap VALIGN=MIDDLE>
|
|
<SPAN id=Span_WPA_MainTitle class="title" style="height: 28px;" tabIndex=-1>
|
|
</SPAN>
|
|
</TD>
|
|
|
|
<TD WIDTH="99%">
|
|
</TD>
|
|
|
|
<TD VALIGN=TOP>
|
|
<IMG ID=WPAFlag alt="">
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<SPAN id=spnPage style="VISIBILITY: hidden" tabIndex=-1>
|
|
<span id=spnMainFrame style="POSITION: absolute; LEFT: 0px; TOP: 48px; width=100%; height=100%;" tabIndex=-1>
|
|
<IFRAME ALLOWTRANSPARENCY="true" frameBorder=no width="100%" height="100%" id=ifrmMainFrame name=msoobeMain src="about:blank" tabIndex=0></IFRAME>
|
|
</SPAN>
|
|
</SPAN>
|
|
|
|
</BODY>
|
|
</HTML>
|