// fix document.readyState for Firefox < 3.6 var d = document if ( typeof d.readyState !== 'string' && top.netscape ) { d.readyState = 'loading'; d.addEventListener('DOMContentLoaded', function() { d.readyState = 'interactive'; }, true); addEventListener('load', function() { d.readyState = 'complete'; }, true); }