--- /dev/null
+/*\r
+*\r
+* Copyright (c) 2007 Andrew Tetlaw\r
+* \r
+* Permission is hereby granted, free of charge, to any person\r
+* obtaining a copy of this software and associated documentation\r
+* files (the "Software"), to deal in the Software without\r
+* restriction, including without limitation the rights to use, copy,\r
+* modify, merge, publish, distribute, sublicense, and/or sell copies\r
+* of the Software, and to permit persons to whom the Software is\r
+* furnished to do so, subject to the following conditions:\r
+* \r
+* The above copyright notice and this permission notice shall be\r
+* included in all copies or substantial portions of the Software.\r
+* \r
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+* SOFTWARE.\r
+* * \r
+*\r
+*\r
+* FastInit\r
+* http://tetlaw.id.au/view/javascript/fastinit\r
+* Andrew Tetlaw\r
+* Version 1.4.1 (2007-03-15)\r
+* Based on:\r
+* http://dean.edwards.name/weblog/2006/03/faster\r
+* http://dean.edwards.name/weblog/2006/06/again/\r
+* Help from:\r
+* http://www.cherny.com/webdev/26/domloaded-object-literal-updated\r
+* \r
+*/\r
+var FastInit = {\r
+ onload : function() {\r
+ if (FastInit.done) { return; }\r
+ FastInit.done = true;\r
+ for(var x = 0, al = FastInit.f.length; x < al; x++) {\r
+ FastInit.f[x]();\r
+ }\r
+ },\r
+ addOnLoad : function() {\r
+ var a = arguments;\r
+ for(var x = 0, al = a.length; x < al; x++) {\r
+ if(typeof a[x] === 'function') {\r
+ if (FastInit.done ) {\r
+ a[x]();\r
+ } else {\r
+ FastInit.f.push(a[x]);\r
+ }\r
+ }\r
+ }\r
+ },\r
+ listen : function() {\r
+ if (/WebKit|khtml/i.test(navigator.userAgent)) {\r
+ FastInit.timer = setInterval(function() {\r
+ if (/loaded|complete/.test(document.readyState)) {\r
+ clearInterval(FastInit.timer);\r
+ delete FastInit.timer;\r
+ FastInit.onload();\r
+ }}, 10);\r
+ } else if (document.addEventListener) {\r
+ document.addEventListener('DOMContentLoaded', FastInit.onload, false);\r
+ } else if(!FastInit.iew32) {\r
+ if(window.addEventListener) {\r
+ window.addEventListener('load', FastInit.onload, false);\r
+ } else if (window.attachEvent) {\r
+ return window.attachEvent('onload', FastInit.onload);\r
+ }\r
+ }\r
+ },\r
+ f:[],done:false,timer:null,iew32:false\r
+};\r
+/*@cc_on @*/\r
+/*@if (@_win32)\r
+FastInit.iew32 = true;\r
+document.write('<script id="__ie_onload" defer src="' + ((location.protocol == 'https:') ? '//0' : 'javascript:void(0)') + '"><\/script>');\r
+document.getElementById('__ie_onload').onreadystatechange = function(){if (this.readyState == 'complete') { FastInit.onload(); }};\r
+/*@end @*/\r
+FastInit.listen();\r