home *** CD-ROM | disk | FTP | other *** search
/ Kompuutteri Kaikille K-CD 2003 #3 / K-CD_2003-03.iso / Explorer6 / DA / IEMIL_1.CAB / BROWSELC.DLL / HTML / MBCOMMON.JS < prev    next >
Text File  |  2002-09-10  |  3KB  |  101 lines

  1. // LocStudio
  2. // following string variables need to be localized:
  3. var L_Refresh_Text = "Opdater";
  4.  
  5. function InsertReloadHREF(sTitle){
  6. // assuming that this error page is called with a parametrized URL:
  7. // res://browselc.dll/mb404.htm#http://www..windowsmedia/com 
  8.  
  9.     thisURL = document.location.href;
  10.  
  11.     //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining 
  12.     //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
  13.     //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
  14.     startXBarURL = thisURL.indexOf("#", 1) + 1;
  15.  
  16.     var xBarURL = "";
  17.     if (startXBarURL > 0)
  18.     {
  19.         xBarURL = thisURL.substring(startXBarURL, thisURL.length);
  20.  
  21.         // Security precaution: filter out illegal chars from "xBarURL"
  22.         forbiddenChars = new RegExp("[<>\'\"]", "g");    // Global search/replace
  23.         xBarURL = xBarURL.replace(forbiddenChars, "");
  24.     }
  25.  
  26.     if (xBarURL.length > 0)
  27.     {
  28.         document.write('<a href="' + xBarURL + '">' + sTitle + "</a>");
  29.     }
  30.     else
  31.     {
  32.         document.write('<a href="javascript:document.location.reload();">' + sTitle + "</a>");
  33.     }
  34. }
  35.  
  36. function IncludeCSS()
  37. {
  38.     var cssFile;
  39.     if (window.screen.colorDepth <= 8) {
  40.         cssFile = "mediabar256.css";
  41.     }
  42.     else {
  43.         cssFile = "mediabar.css";
  44.     }
  45.     document.write("<link rel='stylesheet' type='text/css' href='" + cssFile + "'>");
  46. }
  47.  
  48. function ShowHideShellLinks()
  49. {
  50.     var bHaveMyMusic = false;
  51.     var bHaveMyVideo = false;
  52.  
  53.     var appVersion = window.clientInformation.appVersion;
  54.     var versionInfo = appVersion.split(";");
  55.     if (versionInfo.length < 3) {
  56.         return; // bad version string, bail out w/o enabling shell links
  57.     }
  58.     var winVer = versionInfo[2];
  59.     
  60.     // test for Win NT
  61.     var winNT = "Windows NT";
  62.     var offsNum = winVer.indexOf(winNT);
  63.     if (offsNum > 0)
  64.     {
  65.         // what NT version?
  66.         numVer = parseFloat(winVer.substring(offsNum + winNT.length));
  67.         ntMajor = Math.floor(numVer);
  68.         ntMinor = Math.round((numVer - ntMajor) * 10);
  69.         if (ntMajor >= 5)
  70.         {
  71.             if (ntMinor >= 1)
  72.             {
  73.                 // only XP or newer knows My Music / My Video
  74.                 bHaveMyMusic = true;
  75.                 bHaveMyVideo = true;
  76.             }
  77.         }
  78.     }
  79.     else
  80.     {
  81.         if (versionInfo.length > 3)
  82.         {
  83.             // test for Win ME
  84.             var win9X = versionInfo[3];
  85.             if (win9X.indexOf("4.90") > 0)
  86.             {
  87.                 // only ME knows My Music / My Video
  88.                 bHaveMyMusic = true;
  89.                 bHaveMyVideo = true;
  90.             }
  91.         }
  92.     }
  93.  
  94.     if (bHaveMyMusic) {
  95.         divMyMusic.style.display="";
  96.     }
  97.     if (bHaveMyVideo) {
  98.         divMyVideo.style.display="";
  99.     }
  100.  
  101. }