includes/clientside/static/loader.js
changeset 581 5e8fd89c02ea
parent 520 4c16e87cfeae
child 582 a38876c0793c
--- a/includes/clientside/static/loader.js	Wed Jun 18 22:43:16 2008 -0400
+++ b/includes/clientside/static/loader.js	Sun Jun 22 18:13:59 2008 -0400
@@ -1,14 +1,13 @@
 // Some final stuff - loader routines, etc.
 
+var onload_complete = false;
+
 function mdgInnerLoader(e)
 {
-  if(window.location.hash == '#comments') ajaxComments();
-  window.onkeydown=isKeyPressed;
-  window.onkeyup=function(e) { isKeyPressed(e); };
+  window.onkeydown = isKeyPressed;
+  window.onkeyup = function(e) { isKeyPressed(e); };
   Fat.fade_all();
   fadeInfoBoxes();
-  //initTextareas();
-  //buildSearchBoxes();
   jBoxInit();
   if(typeof (dbx_set_key) == 'function')
   {
@@ -17,17 +16,32 @@
   initSliders();
   runOnloadHooks(e);
 }
+
+// if some dumb plugin set an onload function, preserve it 
 var ld;
-if(window.onload) ld = window.onload;
-else ld = function() {return;};
-function enano_init(e) {
+if ( window.onload)
+{
+  ld = window.onload;
+}
+else
+{
+  ld = function() {return;};
+}
+
+// Enano's main init function.
+function enano_init(e)
+{
   if ( typeof(ld) == 'function' )
   {
     ld(e);
   }
   mdgInnerLoader(e);
+  
+  // we're loaded; set flags to true
+  onload_complete = true;
 }
 
+// don't init the page if less than IE6
 if ( typeof(KILL_SWITCH) == 'boolean' && !KILL_SWITCH )
 {
   window.onload = enano_init;