Small update
[iDB.git] / javascript.js
blob2f3b53306a16c46383af47d7e3eaa743cff41839
1 /*
2     This program is free software; you can redistribute it and/or modify
3     it under the terms of the Revised BSD License.
5     This program is distributed in the hope that it will be useful,
6     but WITHOUT ANY WARRANTY; without even the implied warranty of
7     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8     Revised BSD License for more details.
10     Copyright 2004-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
11     Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13     $FileInfo: javascript.js - Last Update: 08/02/2019 SVN 905 - Author: cooldude2k $
15 function getid(id) {
16 var itm;
17 itm = document.getElementById(id);
18 return itm; }
20 function toggletag(id) {
21 var itm;
22 itm = document.getElementById(id);
23 if (itm.style.display == "none") {
24 itm.style.display = ""; }
25 else {
26 itm.style.display = "none"; } }
28 function bgchange(id,color) {
29 var itm;
30 itm = document.getElementById(id);
31 itm.style.backgroundColor = ''+color+''; }
33 function innerchange(tag,text1,text2) {
34 var usrname;
35 usrname = document.getElementsByTagName(tag);
36 for (var i = 0; i < usrname.length; i++) {
37 if(usrname[i].innerHTML==text1) {
38 usrname[i].innerHTML = text2; } } }
40 function addsmiley(id,code) {
41 var itm;
42 itm = document.getElementById(id);
43 var pretext = itm.value;
44 itm.value = pretext + code; }
46 function GetUserTimeZone() {
47     if (!Intl || !Intl.DateTimeFormat().resolvedOptions().timeZone) {
48         throw 'Time zones are not available in this environment';
49     }
51     try {
52         tzname = Intl.DateTimeFormat().resolvedOptions().timeZone;
53     }
54     catch (ex) {
55         tzname = false;
56         return false;
57     }
58     if(tzname!=false)
59     {
60     document.getElementById("YourOffSet").value = tzname;
61     return true;
62     }