summaryrefslogtreecommitdiffstats
path: root/HTML
diff options
context:
space:
mode:
authorLaurent Montel <lmontel@mandriva.org>2003-11-27 12:32:52 +0000
committerLaurent Montel <lmontel@mandriva.org>2003-11-27 12:32:52 +0000
commit1ab0ffc9d54580940416058d326dfca58b7ffa36 (patch)
tree9be055d82e2fb3d27640e83af8cfeb86feb1dd1e /HTML
parent8c1f9bec49d425330470fdcdf320067b4ade099d (diff)
downloadindexhtml-1ab0ffc9d54580940416058d326dfca58b7ffa36.tar
indexhtml-1ab0ffc9d54580940416058d326dfca58b7ffa36.tar.gz
indexhtml-1ab0ffc9d54580940416058d326dfca58b7ffa36.tar.bz2
indexhtml-1ab0ffc9d54580940416058d326dfca58b7ffa36.tar.xz
indexhtml-1ab0ffc9d54580940416058d326dfca58b7ffa36.zip
Add
Diffstat (limited to 'HTML')
-rw-r--r--HTML/mdk_redirect.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/HTML/mdk_redirect.js b/HTML/mdk_redirect.js
new file mode 100644
index 0000000..80c6538
--- /dev/null
+++ b/HTML/mdk_redirect.js
@@ -0,0 +1,27 @@
+function LANGUAGE() {
+ var s = navigator.browserLanguage || navigator.language;
+ if (s[2] == '-') {
+ s = s.substring(0, 2) + '_' + s.substring(3, 5).toUpperCase()
+ }
+ if (s == "pt_BR" || s == "zh_CN") return s;
+ return s.substring(0, 2);
+}
+
+
+function myname() {
+ var s = window.location.pathname
+ var i
+ i = s.lastIndexOf("/")
+ if (i >= 0) s = s.substring(i + 1, 99)
+ i = s.lastIndexOf(".html")
+ if (i >= 0) s = s.substring(0, i)
+ return s;
+}
+
+function may_redirect()
+{
+ var name = myname()
+ if (name.indexOf("-") == -1)
+ window.location.href = '../../mdk/indexhtml/' + name + '-' + LANGUAGE() + '.html';
+}
+