about summary refs log tree commit diff
path: root/docs/tool/Help/javascript/BrowserStyles.js
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-02 08:21:29 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-02 08:21:29 +0000
commit61bfe2d70cae6be8c4086a210a5451135ccca9ea (patch)
tree62bf7808b1b2bfe5f56fe1e329871fb0991d0687 /docs/tool/Help/javascript/BrowserStyles.js
parenta13b94f9e0bca8ea892311d9d9e0c0bc48616ea7 (diff)
downloadzcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.tar.gz
zcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.zip
added doc tool
Diffstat (limited to 'docs/tool/Help/javascript/BrowserStyles.js')
-rw-r--r--docs/tool/Help/javascript/BrowserStyles.js77
1 files changed, 77 insertions, 0 deletions
diff --git a/docs/tool/Help/javascript/BrowserStyles.js b/docs/tool/Help/javascript/BrowserStyles.js
new file mode 100644
index 00000000..71666418
--- /dev/null
+++ b/docs/tool/Help/javascript/BrowserStyles.js
@@ -0,0 +1,77 @@
+
+//
+//  Browser Styles
+// ____________________________________________________________________________
+
+var agt=navigator.userAgent.toLowerCase();
+var browserType;
+var browserVer;
+
+if (agt.indexOf("opera") != -1)
+    {
+    browserType = "Opera";
+
+    if (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1)
+        {  browserVer = "Opera5";  }
+    else if (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1)
+        {  browserVer = "Opera6";  }
+    else if (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1)
+        {  browserVer = "Opera7";  }
+    }
+
+else if (agt.indexOf("khtml") != -1 || agt.indexOf("konq") != -1 || agt.indexOf("safari") != -1)
+    {
+    browserType = "KHTML";
+    }
+
+else if (agt.indexOf("msie") != -1)
+    {
+    browserType = "IE";
+
+    if (agt.indexOf("msie 4") != -1)
+        {  browserVer = "IE4";  }
+    else if (agt.indexOf("msie 5") != -1)
+        {  browserVer = "IE5";  }
+    else if (agt.indexOf("msie 6") != -1)
+        {  browserVer = "IE6";  }
+    else if (agt.indexOf("msie 7") != -1)
+        {  browserVer = "IE7";  }
+    }
+
+else if (agt.indexOf("gecko") != -1)
+    {
+    browserType = "Gecko";
+    }
+
+// Opera already taken care of.
+else if (agt.indexOf("mozilla") != -1 && agt.indexOf("compatible") == -1 && agt.indexOf("spoofer") == -1 &&
+           agt.indexOf("webtv") == -1 && agt.indexOf("hotjava") == -1)
+    {
+    browserType = "Netscape";
+
+    if (agt.indexOf("mozilla/4") != -1)
+        {  browserVer = "Netscape4";  }
+    }
+
+
+function OpeningBrowserTags()
+    {
+    if (browserType)
+        {
+        document.write('<div class='+browserType+'>');
+
+        if (browserVer)
+            {  document.write('<div class='+browserVer+'>');  }
+        }
+    };
+
+function ClosingBrowserTags()
+    {
+    if (browserType)
+        {
+        document.write('</div>');
+
+        if (browserVer)
+            {  document.write('</div>');  }
+        }
+    };