+ }
+
+ // If the last script to fire was in the body,
+ // we assume that it's trying to do a document.write
+ var s = document.getElementsByTagName("script");
+ s = s[s.length-1].parentNode.nodeName == "HEAD";
+
+ // Only execute if we're doing a sane way, or the window
+ // is loaded, or the final script is in the head
+ // and there's something to execute
+ if ( ( !$.badReady || isFinal || s ) && $.$$ready ) {