home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 December / PCWDEC06.iso / Shared / regwiz.cab / RegWizUI.dll / HTML / EULA.VBS < prev    next >
Encoding:
Text File  |  2004-09-08  |  2.6 KB  |  124 lines

  1. Option Explicit
  2.  
  3. Dim strAcceptUrl, strDeclineUrl
  4.  
  5.  
  6. Function OnDecline()
  7. '{
  8.     Call window.location.replace (CStr(CANCEL_HTM))
  9. '}
  10. End Function
  11.  
  12. Function OnAccept()
  13. '{    
  14.     Dim strAccountID, objRequest
  15.     Dim nRegForce, nSubmitResult
  16.  
  17.     Set objRequest = gobjExternal.GetParam ( PROP_REGREQUEST )
  18.  
  19.     If IsObject (objRequest) Then
  20.     '{
  21.         strAccountID = objRequest.Item ( PROP_ACCOUNTID )
  22.         Set objRequest = Nothing
  23.     '}
  24.     End If
  25.  
  26.     If "" = strAccountID Then
  27.         strAcceptUrl = PROFILE_HTM
  28.     Else
  29.     '{
  30.         nSubmitResult = SubmitDataForRegistration ( MODE_AUTH )
  31.  
  32.         If REGWIZ_STATUS_NOINTERNET = nSubmitResult Then
  33.         '{
  34.             ' Hide Cancel button for force registration
  35.             nRegForce = gobjExternal.GetParam ( PROP_FORCE_REG )
  36.  
  37.             If 1 = nRegForce Then
  38.             '{
  39.                 strAcceptUrl = SUBMITONCONNECT_HTM
  40.             '}
  41.             Else
  42.             '{
  43.                 strAcceptUrl = REMINDME_HTM
  44.             '}
  45.             End If
  46.         '}
  47.         End If
  48.     '}
  49.     End If
  50.  
  51.     Call window.location.replace (CStr(strAcceptUrl))
  52. '}
  53. End Function
  54.  
  55. Function OnEulaBodyLoad()
  56. '{
  57.     Dim sIni, sTemp
  58.  
  59.     ' Always check if we are running in MgHtml's instance.
  60.     Call SetExternalObject (gobjExternal)
  61.     
  62.     strAcceptUrl  = PROFILE_HTM
  63.     strDeclineUrl = CANCEL_HTM
  64.  
  65.     gsEulaLang = REGWIZ_LANG_ID
  66.     
  67.     Call window.setTimeout ( "SetDefaultEulaText()", 300 )
  68. '}
  69. End Function
  70.  
  71. Function SetDefaultEulaText()
  72. '{
  73.     ' Populate the country list
  74.     Dim szCountry, szLang, szVal, strEulaTextLang, strTempLang
  75.     Dim nLength, nCtr
  76.  
  77.     Call SortArray ( gCountryArray, gCountryArraySorted )
  78.     nLength = getArrayLength ( gCountryArraySorted )
  79.  
  80.     strEulaTextLang = Replace ( gsEulaLang, "-", "_" )
  81.  
  82.     for nCtr = 0 To (nLength-1)
  83.     '{
  84.         szVal = GetCountryNameAndLangCode ( nCtr )
  85.  
  86.         szCountry = split(szVal,"$")(0)
  87.         szLang = split(szVal,"$")(1)
  88.         
  89.         call AddToOptionList(idCountryList, szLang, szCountry)
  90.  
  91.         strTempLang = Replace ( strEulaTextLang, "_", "-" )
  92.  
  93.         If strTempLang = szLang Then
  94.         '{
  95.             idCountryList.options(nCtr).selected = true
  96.         '}
  97.         End If
  98.     '}
  99.     next    
  100.  
  101.     ' language specific country should be selected by default. Ex. for us build it is "United States", for french build it is "France"
  102.     idEulaText.value = eval("STR_EULA_CONTENT_" & strEulaTextLang)
  103. '}
  104. End Function
  105.  
  106. Function ShowEulaContents()
  107. '{
  108.     Dim strEulaTextLang
  109.     strEulaTextLang = Replace ( idCountryList.value, "-", "_" )
  110.  
  111.     idEulaText.readOnly = false
  112.     idEulaText.value = eval("STR_EULA_CONTENT_" & strEulaTextLang)
  113.     idEulaText.readOnly = true
  114.  
  115.     gsEulaLang = idCountryList.value
  116. '}
  117. End Function
  118.  
  119. Function PrintPrivacyPolicy()
  120. '{
  121.     ' Calling printDoc()    
  122.     Call printDoc (1)    
  123. '}    
  124. End Function