home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2003 June (Bonus) / Services_2003.bin / services_2003 / library / script / browserSwitchStartPage.js < prev    next >
Encoding:
Text File  |  2003-02-27  |  1.7 KB  |  65 lines

  1. // There are 3 browserswitch js-files, which need to be kept consistent:
  2. // /sample/library/script/browserSwitch.js
  3. // /sample/library/script/browserSwitchPrePages.js
  4. // /sample/library/script/browserSwitchStartPage.js
  5. // 
  6. // Differences:
  7. // 1st) They differ in the redirect-paths: only "browserSwitchStartPage.js" needs to be modified
  8. // 2nd) "browserSwitchStartPage.js" has no function browserdetect()
  9.  
  10.  
  11. // Browserswitch: IE < 5 / NS < 6
  12. if (!document.getElementById && !document.all)
  13. {
  14.     window.location="services_2003/browser.htm";
  15. }
  16.  
  17.  
  18. //  Useage of IE4 (compatible installation):
  19. if (  navigator.appVersion.indexOf('MSIE 4')!=-1  && navigator.appVersion.indexOf('compatible;')!=-1 ) 
  20.     window.location="services_2003/browser.htm";  
  21. }
  22.  
  23. //Schlieâ–€t Opera aus
  24. if (navigator.appName == "Opera") 
  25.     window.location="services_2003/browser.htm";
  26. }
  27.  
  28.  
  29. // !OPTIONAL! !OPTIONAL! !OPTIONAL! !OPTIONAL! !OPTIONAL! !OPTIONAL! !OPTIONAL!
  30. //  Browserswitch: NS == 6 
  31. // May be used if there are functional limitations with NS 6 
  32. // If not used: deactivate corresponding script on page browser.htm!
  33. // if (navigator.userAgent.indexOf('Gecko')!=-1) 
  34. //    {
  35. //        window.location="SAMPLE/browser.htm";
  36. //    }
  37.  
  38.  
  39.  
  40. //This function is only called by start.htm
  41. function browserdetect(){
  42.     var Schalter = 0;
  43.     // Browserswitch: IE < 5 / NS < 6
  44.     if (!document.getElementById && !document.all)
  45.     {
  46.         var Schalter = 1; 
  47.     }
  48.     
  49.     //  Useage of IE4 (compatible installation):
  50.     if (navigator.appVersion.indexOf('MSIE 4')!=-1  && navigator.appVersion.indexOf('compatible;')!=-1 ) 
  51.     { 
  52.         var Schalter = 1; 
  53.     }
  54.     
  55.     if (navigator.appName == "Opera") 
  56.     { 
  57.         var Schalter = 1; 
  58.     }
  59.     
  60.     return Schalter;
  61. }
  62.  
  63.