Index: gridder.module
===================================================================
--- gridder.module
+++ gridder.module
@@ -47,14 +47,12 @@
 		  fixFlash: true,
 		  size: 960
 	  }
-	  createGridder = function() {
+
+	  Drupal.behaviors.createGridder = function() {
 	    document.body.appendChild(
 	      document.createElement('script'))
 	        .src='".$base_url ."/". $path . "/gridder.js';
-	  }
-	  $(document).ready(function(){
-	   createGridder();
-    });";
+	  };";
     drupal_add_js($gridder_js, 'inline');
     drupal_add_css($path .'/gridder.css', 'module', 'all', FALSE);
   }
Index: gridder.js
===================================================================
--- gridder.js
+++ gridder.js
@@ -390,25 +390,12 @@
 	};
 }
 
-/* This method will loop itself until jQuery is loaded, pausing the script.
- * When jQuery is loaded it'll continue the script.
- */
-var checkJQuery = function () {
-	if (typeof(window.jQuery) === "undefined") {
-		setTimeout(function () {
-			checkJQuery();
-		}, 10);
-	}
-	else {
-		window.grid.setupWindow();
-		window.grid.createGrid();
-	}
-};
 
 // Initiate the script, if it already is initiated, toggle setup window
 if (typeof(window.grid) === "undefined") {
 	window.grid = new Grid();
-	checkJQuery();
+	window.grid.setupWindow();
+	window.grid.createGrid();
 }
 else {
 	window.grid.toggleSetupWindow();
