home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / supercd / allscrpt.js < prev    next >
Encoding:
Text File  |  1999-07-06  |  5.5 KB  |  116 lines

  1. // Determine browser type
  2.     bname = navigator.appName
  3.     bVer = parseInt(navigator.appVersion)
  4.  
  5.     if (bname == "Netscape" && bVer >=4) br = "n4plus"
  6.     else if (bname == "Microsoft Internet Explorer" && bVer >= 4) br = "e4plus"
  7.     else if (bname == "Microsoft Internet Explorer" && bVer < 4) br = "e3"
  8.     else br = "notie"
  9.  
  10. // determine operating system of viewer
  11.     userAgent = navigator.userAgent
  12.     userAgent = userAgent.toLowerCase()
  13.     linux = false
  14.     win16 = false
  15.     if (userAgent.indexOf("linux") != -1) {
  16.          linux = true
  17.     }
  18.     if (userAgent.indexOf("Win16") != -1) {
  19.          win16 = true
  20.     }
  21.  
  22.  
  23.  
  24. // ONCLICK WARNING FOR HTTP LINKS
  25.  
  26. function webWarning () {
  27.     if (br == 'e4plus' || br == 'n4plus') {
  28.         if ((top.length ==0) || (top.getCookie('PCPLUS_CD1') == null)) {
  29.             return confirm('Accessing this link will require you to go on-line.\r\rIf you are not connected to a network, this means\ryou need a modem and Internet account setup\rand switched on. Do you wish to continue?');
  30.         }
  31.         else {return true}
  32.     }
  33.     else {
  34.         alert('Accessing this link will require you to go on-line.\r\rIf you are not connected to a network, this means\ryou need a modem and Internet account setup\rand switched on.');
  35.         return true;
  36.     }
  37. }
  38.  
  39.  
  40. // ONCLICK WARNING FOR EMAIL LINKS
  41.  
  42. function emailWarning () {
  43.     if (br == 'e4plus' || br == 'n4plus') {
  44.         if ((top.length ==0) || (top.getCookie('PCPLUS_CD3') == null)) {
  45.             return confirm('Accessing this link will require you to have an\re-mail client set up and integrated correctly.\r\rIf it is you will be taken to a New Message window\rwhere you can type in your message and then send it.\rIf you are not connected to a network, this means\ryou need a modem and Internet account setup and\rswitched on. Do you wish to continue?');
  46.         }
  47.         else {return true}
  48.     }
  49.     else {
  50.         alert('Accessing this link will require you to have an\re-mail client set up and integrated correctly.\r\rIf it is you will be taken to a New Message window\rwhere you can type in your message and then send it.\rIf you are not connected to a network, this means\ryou need a modem and Internet account setup and\rswitched on.');
  51.         return true;
  52.     }
  53. }
  54.  
  55. // ON-CLICK WARNING FOR THIRD-PARTY LINKS
  56. // note: cookie PCPLUS_CD4 was used to suppress initial opening page - shouldn't be used for a while
  57. function linkWarning () {
  58.     if (br == 'e4plus' || br == 'n4plus') {
  59.         if ((top.length ==0) || (top.getCookie('PCPLUS_CD1') == null)) {
  60.             alert('This link takes you to pages authored by a third party.\r\rThey may contain links that lead onto the internet.\rIf you are not connected to a network, you will\rneed a modem and Internet account setup\rand switched on in order to follow them.');
  61.             return true;
  62.         }
  63.         else {return true}
  64.     }
  65.     else {
  66.         alert('This link takes you to pages authoured by a third party.\r\rThey may contain links that lead onto the internet.\rIf you are not connected to a network, this means\ryou need a modem and Internet account setup\rand switched on in order to follow them.');
  67.         return true;
  68.     }
  69. }
  70.  
  71. // RUN WARNING - only for the Netscape Open/Save Dialog Tweek these days
  72.  
  73. function runWarning() {
  74.     if (br=='n4plus' && ((top.length ==0) || top.getCookie('PCPLUS_CDN') != null)) {
  75.         return confirm("Alert! To run files directly from Netscape you must have\rthe Netscape Open/Save dialog enabled. If it is,\ryou will get a 'Security Hazard' dialog box next. Choose 'Open'\rto run the file.\r\rIf you just get a 'Save to disk' dialog, you will not be able to use Netscape\rto install this software. Use the Built-in browser instead.\r\rSee the Netscape page under 'Help' for more information.\r\rDo you wish to continue?");    
  76.     }
  77.     else if (br=="notie" || br=='n4plus') {
  78.         alert('Alert! This will not work.\r\rYour browser\rdoes not allow the execution of files directly from\rthe SuperCD. If you do not understand this, click OK,\rgo to the Help section on the SuperCD and read the\rinstructions.\r\rIf you do not want to install Internet Explorer to\ruse this interface, please use the standalone version\rcalled PCPlus.exe which is on the SuperCD.');
  79.         return false;
  80.     }
  81. }
  82.  
  83. function zipWarning() {
  84.     alert("To copy zip files to your hard-drive, select 'Save to disk'\rin the next dialog box. Then use WinZip or similar utility\rto decompress them there.")
  85. }
  86.  
  87. // MOUSEOVER IMAGE SWAP
  88.  
  89. // here's a good one for all you Netscape fans: I've had to disable roll-overs for Netscape
  90. // because it will not recognize a variable declared in the header of the page (ie btnType) from
  91. // within the *.js file that page includes. Why not? Doing so isn't some great W3C-stiffling move // by MS, it's just plain sensible. I'm sure there's some tedious workaround, but I'm not going 
  92. // hunting for it. You can live without the rollovers, cancha?
  93.  
  94. function btnMouseOver (btnName, btnType) {
  95.     if (br=='e4plus') {
  96.         document.images[btnName].src = button2[btnType].src
  97.     }
  98.     else if (!(br=='n4plus' && ((top.length ==0) || top.getCookie('PCPLUS_CDN') != null))) {
  99.         alert('Alert! This will not work.\r\rYou are not running Internet Explorer. Your browser\rdoes not allow the execution of files directly from\rthe SuperCD. If you do not understand this, click OK,\rgo to the Help section on the SuperCD and read the\rinstructions.\r\rIf you do not want to install Internet Explorer to\ruse this interface, please use the standalone version\rcalled PCPlus.exe which is on the SuperCD.');
  100.         return false;
  101.     }
  102. }
  103.  
  104.  
  105. // MOUSEOUT IMAGE SWAP
  106.  
  107. function btnMouseOut (btnName, btnType) {
  108.     if (br=='e4plus') {
  109.         document.images[btnName].src = button1[btnType].src
  110.     }
  111. }
  112.  
  113.  
  114.  
  115.  
  116.