PageSourceSearch

https://bahnaktuell.net/BA2/wordpress/wp-content/themes/Patricks/script.js

js bahnaktuell.net collected 2026-09-25 00:11:42 UTC 6,353 bytes, 219 lines download raw bytes

1/* begin Page */
2var artEventHelper = {
3  'bind' : function (obj, evt, fn) {
4    if (obj.addEventListener)
5      obj.addEventListener(evt, fn, false);
6    else if (obj.attachEvent)
7      obj.attachEvent('on' + evt, fn);
8    else
9      obj['on' + evt] = fn;
10  }
11};
12
13var artLoadEvent = (function() {
14  var userAgent = navigator.userAgent.toLowerCase();
15  var browser = {
16    version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
17    safari: /webkit/.test(userAgent),
18    opera: /opera/.test(userAgent),
19    msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
20    mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
21  };
22
23  var list = [];
24
25  var done = false;
26  var ready = function () {
27    if (done) return;
28    done = true;
29    for (var i = 0; i < list.length; i++)
30      list[i]();
31  };
32  
33  if (document.addEventListener && !browser.opera)
34    document.addEventListener('DOMContentLoaded', ready, false);
35  
36  if (browser.msie && window == top) {
37    (function () {
38      try {
39        document.documentElement.doScroll('left');
40      } catch (e) {
41        setTimeout(arguments.callee, 10);
42        return;
43      }
44      ready();
45    })();
46  }
47  
48  if (browser.opera) {
49    document.addEventListener('DOMContentLoaded', function () {
50      for (var i = 0; i < document.styleSheets.length; i++) {
51        if (document.styleSheets[i].disabled) {
52          setTimeout(arguments.callee, 10);
53          return;
54        }
55      }
56      ready();
57    }, false);
58  }
59  
60  if (browser.safari) {
61    var numStyles;
62    (function(){
63      if (document.readyState != 'loaded' && document.readyState != 'complete') {
64        setTimeout(arguments.callee, 10);
65        return;
66      }
67      if ('undefined' == typeof numStyles) {
68        numStyles = document.getElementsByTagName('style').length;
69        var links = document.getElementsByTagName('link');
70        for (var i = 0; i < links.length; i++) {
71          numStyles += (links[i].getAttribute('rel') == 'stylesheet') ? 1 : 0;
72        }
73        if (document.styleSheets.length != numStyles) {
74          setTimeout(arguments.callee, 0);
75          return;
76        }
77      }
78      ready();
79    })();
80  }
81
82  artEventHelper.bind(window, 'load', ready);
83
84  return ({
85    add: function(f) {
86      list.push(f);
87    }
88  })
89})();
90
91(function () {
92  // fix ie blinking
93  var m = document.uniqueID && document.compatMode && !window.XMLHttpRequest && document.execCommand;
94  try{ if(!!m) { m("BackgroundImageCache", false, true); } }
95  catch(oh){};
96})();
97
98function xGetElementsByClassName(clsName, parentEle, tagName) {
99  var elements = null;
100  var found = [];
101  var slash = String.fromCharCode(92);
102  var re = new RegExp(slash + "b" + clsName + slash + "b");
103  if (!parentEle) parentEle = document;
104  if (!tagName) tagName = '*';
105  elements = parentEle.getElementsByTagName(tagName);
106  if (elements) {
107    for (var i = 0; i < elements.length; ++i) {
108      if (elements[i].className.search(re) != -1) {
109        found[found.length] = elements[i];
110      }
111    }
112  }
113  return found;
114}
115
116var styleUrlCached = null;
117function GetStyleUrl() {
118  if (null == styleUrlCached) {
119    var ns;
120    styleUrlCached = '';
121    ns = document.getElementsByTagName('link');
122    for (var i = 0; i < ns.length; i++) {
123      var l = ns[i];
124      if (l.href && /style\.css(\?.*)?$/.test(l.href)){
125        return styleUrlCached = l.href.replace(/style\.css(\?.*)?$/,'');
126	  }
127    }
128    
129	ns = document.getElementsByTagName('style');
130	for (var i = 0; i < ns.length; i++) {
131      var matches = new RegExp('import\\s+"([^"]+\\/)style\\.css"').exec(ns[i].innerHTML);
132      if (null != matches && matches.length > 0)
133        return styleUrlCached = matches[1];
134    }
135  }
136  return styleUrlCached;
137}
138
139
140function artButtonSetupJsHover(btn)
141{
142  artEventHelper.bind(btn, 'mouseover', function() {
143    var spans = btn.getElementsByTagName("span");
144    if (spans.length > 0)
145      spans[0].className += " hover";
146  });
147  artEventHelper.bind(btn, 'mouseout', function() {
148    var spans = btn.getElementsByTagName("span");
149    if (spans.length > 0)
150      spans[0].className = spans[0].className.replace(/hover/, "");
151  });
152}
153
154function artButtonsSetupJsHover() {
155  var elements = xGetElementsByClassName("btn", document, "span");
156  for (var i = 0; i < elements.length; i++) {
157    if (!elements[i].tagName) continue;
158    artButtonSetupJsHover(elements[i].parentNode);
159  }
160}
161artLoadEvent.add(artButtonsSetupJsHover);
162
163/* end Page */
164
165/* begin Menu */
166function Insert_Separators()
167{
168  var menus = xGetElementsByClassName("artmenu", document);
169  for (var i = 0; i < menus.length; i++) {
170    var menu = menus[i];
171    var childs = menu.childNodes;
172    var listItems = [];
173    for (var j = 0; j < childs.length; j++){
174      var el = childs[j];
175      if (String(el.tagName).toLowerCase() == "li")listItems.push(el);
176    }
177    for (var j = 0; j < listItems.length - 1; j++){
178      var span = document.createElement('span');
179      span.className = 'separator';
180      var li = document.createElement('li');
181      li.appendChild(span);
182      listItems[j].parentNode.insertBefore(li, listItems[j].nextSibling);
183    }
184  }
185}
186artLoadEvent.add(Insert_Separators);
187
188function Menu_IE6Setup() {
189  var isIE6 = navigator.userAgent.toLowerCase().indexOf("msie") != -1 
190    && navigator.userAgent.toLowerCase().indexOf("msie 7") == -1;
191  if (!isIE6) return;
192  var aTmp2, i, j, oLI, aUL, aA;
193  var aTmp = xGetElementsByClassName("artmenu", document, "ul");
194  for (i=0;i<aTmp.length;i++) {
195    aTmp2 = aTmp[i].getElementsByTagName("li");
196    for (j=0;j<aTmp2.length;j++) {
197      oLI = aTmp2[j];
198      aUL = oLI.getElementsByTagName("ul");
199      if (aUL && aUL.length) {
200        oLI.UL = aUL[0];
201        aA = oLI.getElementsByTagName("a");
202        if (aA && aA.length)
203          oLI.A = aA[0];
204        oLI.onmouseenter = function() {
205          this.className += " artmenuhover";
206          this.UL.className += " artmenuhoverUL";
207          if (this.A) this.A.className += " artmenuhoverA";
208        };
209        oLI.onmouseleave = function() {
210          this.className = this.className.replace(/menuhover/,"");
211          this.UL.className = this.UL.className.replace(/menuhoverUL/,"");
212          if (this.A) this.A.className = this.A.className.replace(/menuhoverA/,"");
213        };
214      }
215    }
216  }
217}
218artLoadEvent.add(Menu_IE6Setup);
219/* end Menu */

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.