3
* Copyright (c) 2007 Andrew Tetlaw
5
* Permission is hereby granted, free of charge, to any person
6
* obtaining a copy of this software and associated documentation
7
* files (the "Software"), to deal in the Software without
8
* restriction, including without limitation the rights to use, copy,
9
* modify, merge, publish, distribute, sublicense, and/or sell copies
10
* of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
13
* The above copyright notice and this permission notice shall be
14
* included in all copies or substantial portions of the Software.
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
* http://tetlaw.id.au/view/javascript/fastinit
30
* Version 1.3 (2007-01-09)
32
* http://dean.edwards.name/weblog/2006/03/faster
33
* http://dean.edwards.name/weblog/2006/06/again/
35
* http://www.cherny.com/webdev/26/domloaded-object-literal-updated
40
if (FastInit.done) { return; }
42
for(var x = 0, al = FastInit.f.length; x < al; x++) {
46
addOnLoad : function() {
48
for(var x = 0, al = a.length; x < al; x++) {
49
if(typeof a[x] === 'function') { FastInit.f.push(a[x]); }
53
if (/WebKit|khtml/i.test(navigator.userAgent)) {
54
FastInit.timer = setInterval(function() {
55
if (/loaded|complete/.test(document.readyState)) {
56
clearInterval(FastInit.timer);
57
delete FastInit.timer;
60
} else if (document.addEventListener) {
61
document.addEventListener('DOMContentLoaded', FastInit.onload, false);
62
} else if(!FastInit.iew32) {
63
Event.observe(window, 'load', FastInit.onload);
66
f:[],done:false,timer:null,iew32:false
70
FastInit.iew32 = true;
71
document.write('<script id="__ie_onload" defer src="' + ((location.protocol == 'https:') ? '//0' : 'javascript:void(0)') + '"><\/script>');
72
document.getElementById('__ie_onload').onreadystatechange = function(){if (this.readyState == 'complete') { FastInit.onload(); }};