diff --git automodal.js automodal.js
index 8c05a2d..8930d74 100644
--- automodal.js
+++ automodal.js
@@ -1,16 +1,9 @@
 (function ($) {
   Drupal.behaviors.automodal = function () {
-    var selector = Drupal.settings.automodal.selector || '.automodal';
-    
-    var settings = {
-      autoResize: true,
-      autoFit: true,
-      width: 600,
-      height: 400,
-      //onSubmit: function (a, b) {} 
-    }
-    
-    $(selector).click(function () {
+    var selector = Drupal.settings.automodal.selector;
+    var settings = Drupal.settings.automodal.settings;
+
+    $(selector + ':not(.automodal-processed)').addClass('automodal-processed').click(function () {
       settings.url = $(this).attr('href') || '#';
       
       if (settings.url.indexOf('?') >= 0) {
diff --git automodal.module automodal.module
index 172ea45..e399323 100644
--- automodal.module
+++ automodal.module
@@ -57,20 +57,13 @@ function automodal_request_is_child() {
  * Implements hook_init();
  */
 function automodal_init() {
-  
-  $is_client = automodal_request_is_child();
-  
-  if ($is_client) {
-    modalframe_child_js();
-  }
-  else {
-    $settings = array('automodal'=>array(
-      'selector' => variable_get('automodal_default_selector', '.automodal'),
-    ));
-    $base = drupal_get_path('module', 'automodal');
-    modalframe_parent_js();
-    drupal_add_js($settings, 'setting');
-    drupal_add_js($base . '/automodal.js');
+  if (!empty($_COOKIE['has_js'])) {
+    if (automodal_request_is_child()) {
+      modalframe_child_js();
+    }
+    elseif (variable_get('automodal_autoscan', 0)) {
+      automodal_add_automodal();
+    }
   }
 }
 
@@ -78,6 +71,9 @@ function automodal_init() {
  * Settings for automodal.
  */
 function automodal_settings_form($form, $form_state = NULL) {
+  drupal_set_title('Automodal Settings');
+  $form = array();
+
   $form['automodal_default_selector'] = array(
     '#type' => 'textfield',
     '#title' => t('CSS 3 Selector'),
@@ -87,6 +83,11 @@ function automodal_settings_form($form, $form_state = NULL) {
     '#maxlength' => 256,
     '#required' => FALSE,
   );
+  $form['automodal_autoscan'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Scan all pages adding automodal automatically'),
+    '#default_value' => variable_get('automodal_autoscan', 0),
+  );
   
   $opts = array(
     'attributes' => array('class' => 'automodal'),
@@ -95,10 +96,35 @@ function automodal_settings_form($form, $form_state = NULL) {
     '#type' => 'markup',
     '#value' => l('This anchor has the class "automodal".', 'admin/settings/automodal/test', $opts) . '<br/>',
   );
+  // for the automodal test
+  if (!variable_get('automodal_autoscan', 0)) automodal_add_automodal();
   
   return system_settings_form($form);
 }
 
 function automodal_test() {
   return t('It works!');
+}
+
+function automodal_add_automodal($automodal_settings = array(), $automodal_selector = '') {
+  $automodal_default_settings = array(
+    'autoResize' => true,
+    'autoFit' => true,
+    'draggable' => true,
+    'width' => 600,
+    'height' => 400,
+  );
+  $automodal_default_selector = variable_get('automodal_default_selector', '.automodal');
+
+  $automodal_settings = empty($automodal_settings) ? $automodal_default_settings : $automodal_settings;
+  $automodal_selector = empty($automodal_selector) ? $automodal_default_selector : $automodal_selector;
+
+  $settings = array('automodal'=>array(
+    'selector' => $automodal_selector,
+    'settings' => $automodal_settings,
+  ));
+  $base = drupal_get_path('module', 'automodal');
+  modalframe_parent_js();
+  drupal_add_js($settings, 'setting');
+  drupal_add_js($base . '/automodal.js');
 }
\ No newline at end of file
