Common subdirectories: opinionlab-DRUPAL-6--1/css and ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/css
Common subdirectories: opinionlab-DRUPAL-6--1/CVS and ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/CVS
Common subdirectories: opinionlab-DRUPAL-6--1/images and ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/images
Common subdirectories: opinionlab-DRUPAL-6--1/js and ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/js
diff -upN opinionlab-DRUPAL-6--1/opinionlab-event.tpl.php ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-event.tpl.php
--- opinionlab-DRUPAL-6--1/opinionlab-event.tpl.php	1970-01-01 01:00:00.000000000 +0100
+++ ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-event.tpl.php	2010-07-14 10:36:34.000000000 +0100
@@ -0,0 +1,63 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ *
+ * Template file for the OpinionLab Javascript code - Event version
+ */
+?>
+
+<script type="text/javascript" language="JavaScript">
+/* OnlineOpinion v<?php print $olvar['version'] ?> */
+/* This product and other products of OpinionLab, Inc. are protected by U.S.
+   Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
+/* Create new OnlineOpinion Object instance */
+var oOobj1 = new OnlineOpinion.ocode();
+/* OnlineOpinion Object Preferences */
+oOobj1.Preferences = {
+  /* Configure Object Persistence (REQUIRED) */
+  Persistence: {
+    enabled: <?php print $olvar['persistence_enabled'] ?>,           // Disappear onClick
+    cookie_name: '<?php print $olvar['persistence_cookie_name'] ?>', // cookie name
+    cookie_type: '<?php print $olvar['persistence_cookie_type'] ?>', // Remembers which page got rated
+    expiration: <?php print $olvar['persistence_expiration'] ?>      // How long to remember each page got Rated (secs)
+  },
+  /* Configure Object Parameters (REQUIRED) */
+  Render: {
+    type: '<?php print $olvar['render_type'] ?>'
+  },
+  Plugins: {
+    /* Configure URL Rewrite (optional) */
+    URLRewrite: {
+      active: <?php print $olvar['plugin_urlrewrite_active'] ?>,
+      regex_search_pattern: '<?php print $olvar['plugin_urlrewrite_regex_search_pattern'] ?>' ,
+      regex_replace_pattern: '<?php print $olvar['plugin_urlrewrite_regex_replace_pattern'] ?>',
+      full_url_rewrite: '<?php print $olvar['plugin_urlrewrite_full_url_rewrite'] ?>'
+    },
+    /* Configure Embedded Comment Card (optional) */
+    CardOnPage: {
+      enabled: <?php print $olvar['plugin_cardonpage_enabled'] ?>,
+      close_link: '<?php print $olvar['plugin_cardonpage_close_link'] ?>'
+    },
+    Events: {
+      /* Configure Events items (required for events) */
+      poE: <?php print $olvar['plugin_events_poe'] ?>, // Probability on Entry
+      poC: <?php print $olvar['plugin_events_poc'] ?>, // Probability on Click
+      poX: <?php print $olvar['plugin_events_pox'] ?>, // Probability on Exit
+      onEntryDelay: <?php print $olvar['plugin_events_onentry_delay'] ?>, // How long to delay card on Entry (in secs)
+      clickDelay: <?php print $olvar['plugin_events_click_delay'] ?> // How long to delay card on Click (in secs)
+    }
+  }
+}
+/* Configure Custom Variables to Accompany Survey (optional) */
+// oOobj1.Metrics.custom.clientID = 1234;
+// oOobj1.Metrics.custom.countryCode = "usa";
+/* Call Back on Page Entry (REQUIRED for Event Driven Objects) */
+OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.onEntry()});
+/* Call Back on Page Exit (REQUIRED for Event Driven Objects) */
+OnlineOpinion.util.SafeAddOnUnLoadEvent(function(){oOobj1.onExit()});
+/* Call Back on Site Exit (optional for Site Exit Event Driven Objects) */
+//OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.onEntry();OnlineOpinion.util.walkAnchors(document.body, 10, /^(http:\/\/pegasus\.local|http:\/\/www\.google\.com)/i, oOobj1)});
+/*  OnlineOpinion v<?php print $olvar['version'] ?>, Copyright <?php print $olvar['copyright_year'] ?> Opinionlab, Inc. */
+</script>
diff -upN opinionlab-DRUPAL-6--1/opinionlab-float.tpl.php ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-float.tpl.php
--- opinionlab-DRUPAL-6--1/opinionlab-float.tpl.php	1970-01-01 01:00:00.000000000 +0100
+++ ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-float.tpl.php	2010-07-14 10:36:34.000000000 +0100
@@ -0,0 +1,59 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ *
+ * Template file for the OpinionLab Javascript code - Floating version
+ *
+ */
+?>
+
+
+<script type="text/javascript" language="JavaScript">
+/* OnlineOpinion v<?php print $olvar['version'] ?> */
+/* This product and other products of OpinionLab, Inc. are protected by U.S.
+   Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
+/* Create new OnlineOpinion Object instance */
+var oOobj1 = new OnlineOpinion.ocode();
+/* OnlineOpinion Object Preferences */
+oOobj1.Preferences = {
+  /* Configure Object Persistence (REQUIRED) */
+  Persistence: {
+    enabled: <?php print $olvar['persistence_enabled'] ?>,           // Disappear onClick
+    cookie_name: '<?php print $olvar['persistence_cookie_name'] ?>', // cookie name
+    cookie_type: '<?php print $olvar['persistence_cookie_type'] ?>', // Remembers which page got rated
+    expiration: <?php print $olvar['persistence_expiration'] ?>      // How long to remember each page got Rated (secs)
+  },
+  /* Configure Object Parameters (REQUIRED) */
+  Render: {
+    type: '<?php print $olvar['render_type'] ?>',
+    main_div_id: '<?php print $olvar['render_main_div_id'] ?>',
+    main_content_id: '<?php print $olvar['render_main_content_id'] ?>',
+    float_style: '<?php print $olvar['render_float_style'] ?>',
+    img_path: '<?php print $olvar['render_img_path'] ?>',
+    feedback_html: '<?php print $olvar['render_feedback_html'] ?>',
+    click_html: '<?php print $olvar['render_click_html'] ?>'
+  },
+  Plugins: {
+    /* Configure URL Rewrite (optional) */
+    URLRewrite: {
+      active: <?php print $olvar['plugin_urlrewrite_active'] ?>,
+      regex_search_pattern: '<?php print $olvar['plugin_urlrewrite_regex_search_pattern'] ?>' ,
+      regex_replace_pattern: '<?php print $olvar['plugin_urlrewrite_regex_replace_pattern'] ?>',
+      full_url_rewrite: '<?php print $olvar['plugin_urlrewrite_full_url_rewrite'] ?>'
+    },
+    /* Configure Embedded Comment Card (optional) */
+    CardOnPage: {
+      enabled: <?php print $olvar['plugin_cardonpage_enabled'] ?>,
+      close_link: '<?php print $olvar['plugin_cardonpage_close_link'] ?>'
+    }
+  }
+}
+/* Configure Custom Variables to Accompany Survey (optional) */
+// oOobj1.Metrics.custom.clientID = 1234;
+// oOobj1.Metrics.custom.countryCode = "usa";
+/* Object Registration (REQUIRED for [+] Floating Icon) */
+OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.render(function(){oOobj1.show()})});
+/*  OnlineOpinion v<?php print $olvar['version'] ?>, Copyright <?php print $olvar['copyright_year'] ?> Opinionlab, Inc. */
+</script>
diff -upN opinionlab-DRUPAL-6--1/opinionlab.info ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab.info
--- opinionlab-DRUPAL-6--1/opinionlab.info	2009-11-16 13:36:53.000000000 +0000
+++ ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab.info	2010-07-08 15:05:49.000000000 +0100
@@ -2,3 +2,10 @@
 name = OpinionLab
 description = Adds OpinionLab code to all your site's pages.
 core = 6.x
+
+; Information added by drupal.org packaging script on 2010-06-16
+version = "6.x-1.x-dev"
+core = "6.x"
+project = "opinionlab"
+datestamp = "1276690318"
+
diff -upN opinionlab-DRUPAL-6--1/opinionlab-inline.tpl.php ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-inline.tpl.php
--- opinionlab-DRUPAL-6--1/opinionlab-inline.tpl.php	1970-01-01 01:00:00.000000000 +0100
+++ ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-inline.tpl.php	2010-07-14 10:36:34.000000000 +0100
@@ -0,0 +1,50 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ *
+ * Template file for the OpinionLab Javascript code - Inline version
+ *
+ */
+?>
+
+<script type="text/javascript" language="JavaScript">
+/* OnlineOpinion v<?php print $olvar['version'] ?> */
+/* This product and other products of OpinionLab, Inc. are protected by U.S.
+   Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
+/* Create new OnlineOpinion Object instance */
+var oOobj1 = new OnlineOpinion.ocode();
+/* OnlineOpinion Object Preferences */
+oOobj1.Preferences = {
+  /* Configure Object Persistence (REQUIRED) */
+  Persistence: {
+    enabled: <?php print $olvar['persistence_enabled'] ?>,           // Disappear onClick
+    cookie_name: '<?php print $olvar['persistence_cookie_name'] ?>', // cookie name
+    cookie_type: '<?php print $olvar['persistence_cookie_type'] ?>', // Remembers which page got rated
+    expiration: <?php print $olvar['persistence_expiration'] ?>      // How long to remember each page got Rated (secs)
+  },
+  /* Configure Object Parameters (REQUIRED) */
+  Render: {
+    type: '<?php print $olvar['render_type'] ?>'
+  },
+  Plugins: {
+    /* Configure URL Rewrite (optional) */
+    URLRewrite: {
+      active: <?php print $olvar['plugin_urlrewrite_active'] ?>,
+      regex_search_pattern: '<?php print $olvar['plugin_urlrewrite_regex_search_pattern'] ?>' ,
+      regex_replace_pattern: '<?php print $olvar['plugin_urlrewrite_regex_replace_pattern'] ?>',
+      full_url_rewrite: '<?php print $olvar['plugin_urlrewrite_full_url_rewrite'] ?>'
+    },
+    /* Configure Embedded Comment Card (optional) */
+    CardOnPage: {
+      enabled: <?php print $olvar['plugin_cardonpage_enabled'] ?>,
+      close_link: '<?php print $olvar['plugin_cardonpage_close_link'] ?>'
+    }
+  }
+}
+/* Configure Custom Variables to Accompany Survey (optional) */
+// oOobj1.Metrics.custom.clientID = 1234;
+// oOobj1.Metrics.custom.countryCode = "usa";
+/*  OnlineOpinion v<?php print $olvar['version'] ?>, Copyright <?php print $olvar['copyright_year'] ?> Opinionlab, Inc. */
+</script>
diff -upN opinionlab-DRUPAL-6--1/opinionlab.module ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab.module
--- opinionlab-DRUPAL-6--1/opinionlab.module	2009-11-16 13:36:53.000000000 +0000
+++ ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab.module	2010-07-14 10:36:34.000000000 +0100
@@ -1,15 +1,22 @@
 <?php
 // $Id: opinionlab.module,v 1.1 2009/11/16 13:36:53 cytefx Exp $
-/*
+
+/**
  * @file
  * Drupal Module: OpinionLab
  * Adds the required Javascript to the bottom of all your Drupal pages
  * to allow the opinion lab floating icon to be displayed.
- *
- * @author: John Jones
- *
  */
 
+/**
+ * Implementation of hook_init
+ */
+function opinionlab_init() {
+  if (_opinionlab_match_path()) {
+    drupal_add_css(drupal_get_path('module', 'opinionlab') . '/css/oo_style.css');
+  }
+}
+
 function opinionlab_help($path, $arg) {
   switch ($path) {
     case 'admin/help#opinionlab':
@@ -18,249 +25,276 @@ function opinionlab_help($path, $arg) {
 }
 
 function opinionlab_admin_settings() {
+  $olsdef = _opinionlab_settings_default_values();
 
   $form['persistence'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Persistence Settings'),
-        '#collapsible' => TRUE,
-        '#collapsed' => TRUE,
-        '#description' => t('Persistence settings for the opinion lab widget')
+    '#type' => 'fieldset',
+    '#title' => t('Persistence Settings'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+    '#description' => t('Persistence settings for the opinion lab widget')
   );
 
   $form['persistence']['opinionlab_persistence_enabled'] = array(
-      '#type' => 'checkbox',
-      '#title' => t("Should the feedback link hidden after clicked on"),
-      '#default_value' => check_plain(variable_get("opinionlab_persistence_enabled", 1)),
+    '#type' => 'checkbox',
+    '#title' => t("Hide the feedback link for the user who just clicked on it"),
+    '#default_value' => variable_get("opinionlab_persistence_enabled", $olsdef['opinionlab_persistence_enabled']),
   );
 
   $form['persistence']['opinionlab_persistence_cookie_name'] = array(
-      '#type' => 'textfield',
-      '#title' => t("What is the name of the cookie to store the persistance state in"),
-      '#default_value' => check_plain(variable_get("opinionlab_persistence_cookie_name", 'oo_r')),
+    '#type' => 'textfield',
+    '#title' => t("Name of the cookie to store the persistance state in"),
+    '#default_value' => variable_get("opinionlab_persistence_cookie_name", $olsdef['opinionlab_persistence_cookie_name']),
   );
 
   $form['persistence']['opinionlab_persistence_cookie_type'] = array(
-      '#type' => 'textfield',
-      '#title' => t("What is the type of page that gets the feedback link on"),
-      '#default_value' => check_plain(variable_get("opinionlab_persistence_cookie_type", 'page')),
+    '#type' => 'textfield',
+    '#title' => t("Type of page that gets the feedback link on"),
+    '#default_value' => variable_get("opinionlab_persistence_cookie_type", $olsdef['opinionlab_persistence_cookie_type']),
   );
 
   $form['persistence']['opinionlab_persistence_expiration'] = array(
-      '#type' => 'textfield',
-      '#title' => t("What is the expiration before the feedback link reappears"),
-      '#default_value' => check_plain(variable_get("opinionlab_persistence_expiration", '3600')),
+    '#type' => 'textfield',
+    '#title' => t("Time before the feedback link reappears"),
+    '#default_value' => variable_get("opinionlab_persistence_expiration", $olsdef['opinionlab_persistence_expiration']),
   );
 
   $form['render'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Render Settings'),
-        '#collapsible' => TRUE,
-        '#description' => t('How the opinion lab widget will be rendered on the screen')
+    '#type' => 'fieldset',
+    '#title' => t('Render Settings'),
+    '#collapsible' => TRUE,
+    '#description' => t('How the opinion lab widget will be rendered on the screen')
   );
 
   $form['render']['opinionlab_render_type'] = array(
-      '#type' => 'select',
-      '#title' => t("render type: What is the render method of this widget"),
-      '#default_value' => check_plain(variable_get("opinionlab_render_type", 'floating')),
+    '#type' => 'select',
+    '#title' => t("Render method of this widget"),
+    '#default_value' => variable_get("opinionlab_render_type", $olsdef['opinionlab_render_type']),
+
+    '#options' => array(
+      'floating' => t('Floating'),
+      'inline' => t('Inline'),
+      'static' => t('Static'),
+      'event' => t('Event'),
+    ),
 
-      '#options' => array(
-        'floating' => t('Floating'),
-        'inline' => t('Inline'),
-        'static' => t('Static'),
-        'event' => t('Event'),
-      ),
+  );
 
+  $form['visibility'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Page specific visibility settings'),
+    '#collapsible' => TRUE,
+  );
+  $options = array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.'));
+  $description = t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
+  $form['visibility']['opinionlab_visibility'] = array(
+    '#type' => 'radios',
+    '#title' => t('Include the OpinionLab feedback link on specific pages'),
+    '#options' => $options,
+    '#default_value' => variable_get('opinionlab_visibility', $olsdef['opinionlab_visibility']),
+  );
+  $form['visibility']['opinionlab_pages'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Pages'),
+    '#default_value' => variable_get('opinionlab_pages', $olsdef['opinionlab_pages']),
+    '#description' => $description,
   );
 
- return system_settings_form($form);
+  return system_settings_form($form);
 }
 
 function opinionlab_admin_plugin_settings() {
-
+  $olsdef = _opinionlab_settings_default_values();
 
   $form['plugins'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Plugin Settings'),
-        '#collapsible' => FALSE,
-        '#collapsed' => FALSE,
-        '#description' => t('Opinion lab widget plugin settings')
+    '#type' => 'fieldset',
+    '#title' => t('Plugin Settings'),
+    '#collapsible' => FALSE,
+    '#collapsed' => FALSE,
+    '#description' => t('Opinion lab widget plugin settings')
   );
 
   $form['plugins']['urlrewrite'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('URL rewrite Settings'),
-        '#collapsible' => TRUE,
-        '#collapsed' => FALSE,
-        '#description' => t('Opinion lab widget url rewrite settings')
+    '#type' => 'fieldset',
+    '#title' => t('URL rewrite Settings'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+    '#description' => t('Opinion lab widget URL rewrite settings')
   );
 
   $form['plugins']['urlrewrite']['opinionlab_plugin_urlrewrite_active'] = array(
-      '#type' => 'checkbox',
-      '#title' => t("Active"),
-      '#default_value' => check_plain(variable_get("opinionlab_plugin_urlrewrite_active", 0)),
+    '#type' => 'checkbox',
+    '#title' => t("Active"),
+    '#default_value' => variable_get("opinionlab_plugin_urlrewrite_active", $olsdef['opinionlab_plugin_urlrewrite_active']),
   );
 
   $form['plugins']['urlrewrite']['opinionlab_plugin_urlrewrite_regex_search_pattern'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Regex Search Pattern"),
-      '#default_value' => check_plain(variable_get("opinionlab_plugin_urlrewrite_regex_search_pattern", '')),
+    '#type' => 'textfield',
+    '#title' => t("Regex Search Pattern"),
+    '#default_value' => variable_get("opinionlab_plugin_urlrewrite_regex_search_pattern", $olsdef['opinionlab_plugin_urlrewrite_regex_search_pattern']),
   );
 
   $form['plugins']['urlrewrite']['opinionlab_plugin_urlrewrite_regex_replace_pattern'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Regex Replace Pattern"),
-      '#default_value' => check_plain(variable_get("opinionlab_plugin_urlrewrite_regex_replace_pattern", '')),
+    '#type' => 'textfield',
+    '#title' => t("Regex Replace Pattern"),
+    '#default_value' => variable_get("opinionlab_plugin_urlrewrite_regex_replace_pattern", $olsdef['opinionlab_plugin_urlrewrite_regex_replace_pattern']),
   );
 
   $form['plugins']['urlrewrite']['opinionlab_plugin_urlrewrite_full_url_rewrite'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Full URL Rewrite"),
-      '#default_value' => check_plain(variable_get("opinionlab_plugin_urlrewrite_full_url_rewrite", '')),
+    '#type' => 'textfield',
+    '#title' => t("Full URL Rewrite"),
+    '#default_value' => variable_get("opinionlab_plugin_urlrewrite_full_url_rewrite", $olsdef['opinionlab_plugin_urlrewrite_full_url_rewrite']),
   );
 
   $form['plugins']['cardonpage'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Card on page Settings'),
-        '#collapsible' => TRUE,
-        '#collapsed' => TRUE,
-        '#description' => t('Opinion lab widget card on page settings')
+    '#type' => 'fieldset',
+    '#title' => t('Card on page Settings'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+    '#description' => t('Opinion lab widget "card on page" settings')
   );
 
   $form['plugins']['cardonpage']['opinionlab_plugin_cardonpage_enabled'] = array(
-      '#type' => 'checkbox',
-      '#title' => t("Enabled"),
-      '#default_value' => check_plain(variable_get("opinionlab_plugin_cardonpage_enabled", 0)),
+    '#type' => 'checkbox',
+    '#title' => t("Enabled"),
+    '#default_value' => variable_get("opinionlab_plugin_cardonpage_enabled", $olsdef['opinionlab_plugin_cardonpage_enabled']),
   );
 
   $form['plugins']['cardonpage']['opinionlab_plugin_cardonpage_close_link'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Close Link"),
-      '#default_value' => check_plain(variable_get("opinionlab_plugin_cardonpage_close_link", '')),
+    '#type' => 'textfield',
+    '#title' => t("Close Link"),
+    '#default_value' => variable_get("opinionlab_plugin_cardonpage_close_link", $olsdef['opinionlab_plugin_cardonpage_close_link']),
   );
 
- return system_settings_form($form);
+  return system_settings_form($form);
 }
 
 function opinionlab_admin_event_settings() {
+  $olsdef = _opinionlab_settings_default_values();
 
   $form['events'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Event Settings'),
-        '#collapsible' => FALSE,
-        '#collapsed' => FALSE,
-        '#description' => t('Opinion lab widget event settings')
+    '#type' => 'fieldset',
+    '#title' => t('Event Settings'),
+    '#collapsible' => FALSE,
+    '#collapsed' => FALSE,
+    '#description' => t('Opinion lab widget event settings')
   );
 
-  $form['events']['opinionlab_events_poE'] = array(   
-      '#type' => 'textfield',
-      '#title' => t("Events poE"),
-      '#default_value' => check_plain(variable_get("opinionlab_events_poE", '0.0')),
+  $form['events']['opinionlab_events_poE'] = array(
+    '#type' => 'textfield',
+    '#title' => t("Events poE"),
+    '#default_value' => variable_get("opinionlab_events_poE", $olsdef['opinionlab_events_poE']),
   );
 
   $form['events']['opinionlab_events_poC'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Events poC"),
-      '#default_value' => check_plain(variable_get("opinionlab_events_poC", '0.0')),
+    '#type' => 'textfield',
+    '#title' => t("Events poC"),
+    '#default_value' => variable_get("opinionlab_events_poC", $olsdef['opinionlab_events_poC']),
   );
 
   $form['events']['opinionlab_events_poX'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Events poX"),
-      '#default_value' => check_plain(variable_get("opinionlab_events_poX", '0.0')),
+    '#type' => 'textfield',
+    '#title' => t("Events poX"),
+    '#default_value' => variable_get("opinionlab_events_poX", $olsdef['opinionlab_events_poX']),
   );
 
   $form['events']['opinionlab_events_onEntryDelay'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Events delay for entry"),
-      '#default_value' => check_plain(variable_get("opinionlab_events_onEntryDelay", '0')),
+    '#type' => 'textfield',
+    '#title' => t("Events delay for entry"),
+    '#default_value' => variable_get("opinionlab_events_onEntryDelay", $olsdef['opinionlab_events_onEntryDelay']),
   );
 
   $form['events']['opinionlab_events_clickDelay'] = array(
-      '#type' => 'textfield',
-      '#title' => t("Events click Delay"),
-      '#default_value' => check_plain(variable_get("opinionlab_events_clickDelay", '0')),
+    '#type' => 'textfield',
+    '#title' => t("Events click delay"),
+    '#default_value' => variable_get("opinionlab_events_clickDelay", $olsdef['opinionlab_events_clickDelay']),
   );
 
   return system_settings_form($form);
 }
 
 function opinionlab_admin_static_settings() {
+  $olsdef = _opinionlab_settings_default_values();
 
   $form['float'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Static Settings'),
-        '#collapsible' => FALSE,
-        '#collapsed' => FALSE,
-        '#description' => t('Opinion lab widget static renderer settings, used if render type is static')
+    '#type' => 'fieldset',
+    '#title' => t('Static Settings'),
+    '#collapsible' => FALSE,
+    '#collapsed' => FALSE,
+    '#description' => t('Opinion lab widget static renderer settings, used if render type is static')
   );
 
   $form['float']['opinionlab_render_main_div_id'] = array(
-      '#type' => 'textfield',
-      '#title' => t("main div id: What is the main div of the widget"),
-      '#default_value' => check_plain(variable_get("opinionlab_render_main_div_id", 'oo_feedback_float')),
+    '#type' => 'textfield',
+    '#title' => t("Main DIV's id for the widget"),
+    '#default_value' => variable_get("opinionlab_render_main_div_id", $olsdef['opinionlab_render_main_div_id']),
   );
 
   $form['float']['opinionlab_render_main_html'] = array(
-      '#type' => 'textarea',
-      '#title' => t("main html: What is the html to be displayed (STATIC)"),
-      '#default_value' => variable_get("opinionlab_render_main_html", '<img src="/'.drupal_get_path('module', 'opinionlab') . '/images/sm_000_oo.gif" width="9px" height="9px" alt="Feedback" />Feedback'),
+    '#type' => 'textarea',
+    '#title' => t("HTML code to be displayed"),
+    '#default_value' => variable_get("opinionlab_render_main_html", $olsdef['opinionlab_render_main_html']),
   );
 
   return system_settings_form($form);
 }
 
-
 function opinionlab_admin_float_settings() {
-
+  $olsdef = _opinionlab_settings_default_values();
+  
   $form['float'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Floating Settings'),
-        '#collapsible' => FALSE,
-        '#collapsed' => FALSE,
-        '#description' => t('Opinion lab widget float renderer settings, used if render type is floating')
+    '#type' => 'fieldset',
+    '#title' => t('Floating Settings'),
+    '#collapsible' => FALSE,
+    '#collapsed' => FALSE,
+    '#description' => t('Opinion lab widget float renderer settings, used if render type is floating')
   );
 
   $form['float']['opinionlab_render_main_div_id'] = array(
-      '#type' => 'textfield',
-      '#title' => t("main div id: What is the main div of the widget"),
-      '#default_value' => check_plain(variable_get("opinionlab_render_main_div_id", 'oo_feedback_float')),
+    '#type' => 'textfield',
+    '#title' => t("Main DIV's id for the widget"),
+    '#default_value' => variable_get("opinionlab_render_main_div_id", $olsdef['opinionlab_render_main_div_id']),
   );
 
   $form['float']['opinionlab_render_main_content_id'] = array(
-      '#type' => 'textfield',
-      '#title' => t("main content id: What is the id of the widget content"),
-      '#default_value' => check_plain(variable_get("opinionlab_render_main_content_id", 'content')),
+    '#type' => 'textfield',
+    '#title' => t("Main content's ID for the widget"),
+    '#default_value' => variable_get("opinionlab_render_main_content_id", $olsdef['opinionlab_render_main_content_id']),
   );
 
   $form['float']['opinionlab_render_float_style'] = array(
-      '#type' => 'textfield',
-      '#title' => t("float_ style: Can be set to \"rightOfContent\" or \"fixedPreserveContent\""),
-      '#default_value' => check_plain(variable_get("opinionlab_render_float_style", '')),
+    '#type' => 'select',
+    '#title' => t("Floating style"),
+    '#default_value' => variable_get("opinionlab_render_float_style", $olsdef['opinionlab_render_float_style']),
+    '#options' => array(
+      'rightOfContent' => 'rightOfContent',
+      'fixedPreserveContent' => 'fixedPreserveContent',
+    ),
   );
 
   $form['float']['opinionlab_render_img_path'] = array(
-      '#type' => 'textfield',
-      '#title' => t("image location: What is the image path for the widget"),
-      '#default_value' => check_plain(variable_get("opinionlab_render_img_path", '/'.drupal_get_path('module', 'opinionlab') . '/images/oo_black.gif')),
+    '#type' => 'textfield',
+    '#title' => t("Image location"),
+    '#default_value' => variable_get("opinionlab_render_img_path", $olsdef['opinionlab_render_img_path']),
   );
 
   $form['float']['opinionlab_render_feedback_html'] = array(
-      '#type' => 'textfield',
-      '#title' => t("feedback html: What is the feedback text"),
-      '#default_value' => check_plain(variable_get("opinionlab_render_feedback_html", 'Feedback')),
+    '#type' => 'textfield',
+    '#title' => t("Feedback text"),
+    '#default_value' => variable_get("opinionlab_render_feedback_html", $olsdef['opinionlab_render_feedback_html']),
   );
 
   $form['float']['opinionlab_render_click_html'] = array(
-      '#type' => 'textarea',
-      '#title' => t("click html: What is the html that appears when clicked/hovered over the widget"),
-      '#default_value' => variable_get("opinionlab_render_click_html", 'Click here to<br>rate this page'),
+    '#type' => 'textarea',
+    '#title' => t("HTML to show when clicked/hovered over the widget"),
+    '#default_value' => variable_get("opinionlab_render_click_html", $olsdef['opinionlab_render_click_html']),
   );
 
   return system_settings_form($form);
 }
 
 function opinionlab_perm() {
-  return array('administer Opinionlab configuration');
+  return array('administer opinionlab configuration');
 }
 
 /**
@@ -332,112 +366,170 @@ function opinionlab_menu() {
 }
 
 /**
- * Implementation of hook_nodeapi().
+ * Implementation of hook_theme().
  */
-function opinionlab_nodeapi($node, $op, $teaser = NULL, $page = NULL) {
-  switch ($op) {
-    case 'view':
-      drupal_add_css(drupal_get_path('module', 'opinionlab') . '/css/oo_style.css');
-      drupal_add_js(drupal_get_path('module', 'opinionlab') . '/js/oo_engine_c.js');
-      break;
-  }
+function opinionlab_theme($existing, $type, $theme, $path) {
+  return array(
+    'opinionlab_float' => array(
+      'template' => 'opinionlab-float',
+      'arguments' => array('olvar' => NULL),
+    ),
+    'opinionlab_static' => array(
+      'template' => 'opinionlab-static',
+      'arguments' => array('olvar' => NULL),
+    ),
+    'opinionlab_event' => array(
+      'template' => 'opinionlab-event',
+      'arguments' => array('olvar' => NULL),
+    ),
+    'opinionlab_inline' => array(
+      'template' => 'opinionlab-inline',
+      'arguments' => array('olvar' => NULL),
+    ),
+  );
 }
 
+
 /**
  * Implementation of hook_footer()  to insert Javascript at the end of the page
  */
 function opinionlab_footer($main = 0) {
+  if (_opinionlab_match_path()) {
 
-  //dont display on add/edit or admin pages (move to admin to control)
-  if (arg(0) == 'admin' || (arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
-    return;
-  }
+    drupal_add_js(drupal_get_path('module', 'opinionlab') . '/js/oo_engine_c.js');
 
-  $script = '<script type="text/javascript" language="JavaScript">'."\n";
-  $script .= '/* OnlineOpinion v4.1.5 */'."\n";
-  $script .= '/* This product and other products of OpinionLab, Inc. are protected by U.S. Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */'."\n";
-
-  $script .= '/* Create new OnlineOpinion Object instance */'."\n";
-  $script .= 'var oOobj1 = new OnlineOpinion.ocode(); '."\n";
-
-  $script .= '/* OnlineOpinion Object Preferences */'."\n";
-  $script .= 'oOobj1.Preferences = {'."\n";
-  $script .= '  /* Configure Object Persitence (REQUIRED) */'."\n";
-  $script .= '  Persistence: {'."\n";
-  $script .= '    enabled: '.variable_get("opinionlab_persistence_enabled", 1).',          // Disapear onClick'."\n";
-  $script .= '    cookie_name: \''.variable_get("opinionlab_persistence_cookie_name","oo_r").'\',    // cookie name '."\n";
-  $script .= '    cookie_type: \''.variable_get("opinionlab_persistence_cookie_type","page").'\',    // Remembers which page got rated'."\n";
-  $script .= '    expiration: '.variable_get("opinionlab_persistence_expiration","3600").'        // How long to remember each page got Rated (in secs)'."\n";
-  $script .= '  },'."\n";
-  $script .= '  /* Configure Object Parameters (REQUIRED) */'."\n";
-  $script .= '  Render: {'."\n";
-  $script .= '    type: \''.variable_get("opinionlab_render_type", 'floating').'\','."\n";
-  if (variable_get("opinionlab_render_type", '') == 'floating') {
-    $script .= '    main_div_id: \''.variable_get("opinionlab_render_main_div_id", 'oo_feedback_float').'\','."\n";
-    $script .= '    main_content_id: "'.variable_get("opinionlab_render_main_content_id", 'content').'",   // Determines ID float style references as content'."\n";
-    $script .= '    float_style: "'.variable_get("opinionlab_render_float_style", '').'",              // Can be set to "rightOfContent" or "fixedPreserveContent"'."\n";
-    $script .= '    img_path: \''.variable_get("opinionlab_render_img_path", drupal_get_path('module', 'opinionlab') . '/images/oo_black.gif').'\','."\n";
-    $script .= '    feedback_html: \''.variable_get("opinionlab_render_feedback_html", 'Feedback').'\','."\n";
-    $script .= '    click_html: \''.variable_get("opinionlab_render_click_html", 'Click here to<br>rate this page').'\''."\n";
-  }
-  if (variable_get("opinionlab_render_type", '') == 'static') {
-    $script .= '    main_div_id: \''.variable_get("opinionlab_render_main_div_id", 'oo_feedback_float').'\','."\n";
-    $script .= '    main_html: "'.variable_get("opinionlab_render_main_html", '<img src="/'.drupal_get_path('module', 'opinionlab') . '/images/sm_000_oo.gif" width="9px" height="9px" alt="Feedback" />Feedback').'"'."\n";
+    $olsdef = _opinionlab_settings_default_values();
+
+    $olvar = array();
+    $olvar['version'] = '4.1.5';
+    $olvar['copyright_year'] = '2009';
+
+    $olvar['persistence_enabled'] = check_plain(variable_get('opinionlab_persistence_enabled', $olsdef['opinionlab_persistence_enabled']));
+    $olvar['persistence_cookie_name'] = check_plain(variable_get('opinionlab_persistence_cookie_name', $olsdef['opinionlab_persistence_cookie_name']));
+    $olvar['persistence_cookie_type'] = check_plain(variable_get('opinionlab_persistence_cookie_type', $olsdef['opinionlab_persistence_cookie_type']));
+    $olvar['persistence_expiration'] = check_plain(variable_get('opinionlab_persistence_expiration', $olsdef['opinionlab_persistence_expiration']));
+
+    $olvar['render_type'] = check_plain(variable_get('opinionlab_render_type', $olsdef['opinionlab_render_type']));
+
+    $olvar['plugin_urlrewrite_active'] = check_plain(variable_get('opinionlab_plugin_urlrewrite_active', $olsdef['opinionlab_plugin_urlrewrite_active']));
+    $olvar['plugin_urlrewrite_regex_search_pattern'] = check_plain(variable_get('opinionlab_plugin_urlrewrite_regex_search_pattern', $olsdef['opinionlab_plugin_urlrewrite_regex_search_pattern']));
+    $olvar['plugin_urlrewrite_regex_replace_pattern'] = check_plain(variable_get('opinionlab_plugin_urlrewrite_regex_replace_pattern', $olsdef['opinionlab_plugin_urlrewrite_regex_replace_pattern']));
+    $olvar['plugin_urlrewrite_full_url_rewrite'] = check_plain(variable_get('opinionlab_plugin_urlrewrite_full_url_rewrite', $olsdef['opinionlab_plugin_urlrewrite_full_url_rewrite']));
+
+    $olvar['plugin_cardonpage_enabled'] = check_plain(variable_get('opinionlab_plugin_cardonpage_enabled', $olsdef['opinionlab_plugin_cardonpage_enabled']));
+    $olvar['plugin_cardonpage_close_link'] = check_plain(variable_get('opinionlab_plugin_cardonpage_close_link', $olsdef['opinionlab_plugin_cardonpage_close_link']));
+
+    switch (variable_get("opinionlab_render_type", $olsdef['opinionlab_render_type'])) {
+      case 'floating': {
+        $olvar['render_main_div_id'] = check_plain(variable_get('opinionlab_render_main_div_id', $olsdef['opinionlab_render_main_div_id']));
+        $olvar['render_main_content_id'] = check_plain(variable_get('opinionlab_render_main_content_id', $olsdef['opinionlab_render_main_content_id']));
+        $olvar['render_float_style'] = check_plain(variable_get('opinionlab_render_float_style', $olsdef['opinionlab_render_float_style']));
+        $olvar['render_img_path'] = check_plain(variable_get('opinionlab_render_img_path', $olsdef['opinionlab_render_img_path']));
+        $olvar['render_feedback_html'] = filter_xss_admin(variable_get('opinionlab_render_feedback_html', $olsdef['opinionlab_render_feedback_html']));
+        $olvar['render_click_html'] = filter_xss_admin(variable_get('opinionlab_render_click_html', $olsdef['opinionlab_render_click_html']));
+
+        return theme('opinionlab_float', $olvar);
+        break;
+      }
+      case 'static': {
+        $olvar['render_main_div_id'] = check_plain(variable_get('opinionlab_render_main_div_id', $olsdef['opinionlab_render_main_div_id']));
+        $olvar['render_main_html'] = filter_xss_admin(variable_get('opinionlab_render_main_html', $olsdef['opinionlab_render_main_html']));
+
+        return theme('opinionlab_static', $olvar);
+        break;
+      }
+      case 'event': {
+        $olvar['plugin_events_poe'] = check_plain(variable_get('opinionlab_events_poE', $olsdef['opinionlab_events_poE']));
+        $olvar['plugin_events_poc'] = check_plain(variable_get('opinionlab_events_poC', $olsdef['opinionlab_events_poC']));
+        $olvar['plugin_events_pox'] = check_plain(variable_get('opinionlab_events_poX', $olsdef['opinionlab_events_poX']));
+        $olvar['plugin_events_onentry_delay'] = check_plain(variable_get('opinionlab_events_onEntryDelay', $olsdef['opinionlab_events_onEntryDelay']));
+        $olvar['plugin_events_click_delay'] = check_plain(variable_get('opinionlab_events_clickDelay', $olsdef['opinionlab_events_clickDelay']));
+
+        return theme('opinionlab_event', $olvar);
+        break;
+      }
+      case 'inline':
+      default: return theme('opinionlab_inline', $olvar);
+    }
   }
-  $script .= '  },'."\n";
-  $script .= '  Plugins: {'."\n";
-  $script .= '    /* Configure URL Rewrite (optional) */'."\n";
-  $script .= '    URLRewrite: {'."\n";
-  $script .= '      active: '.variable_get("opinionlab_plugin_urlrewrite_active", 0).','."\n";
-  $script .= '      regex_search_pattern: "'.variable_get("opinionlab_plugin_urlrewrite_regex_search_pattern", '') .'" ,'."\n";
-  $script .= '      regex_replace_pattern: "'. variable_get("opinionlab_plugin_urlrewrite_regex_replace_pattern", '') .'",'."\n";
-  $script .= '      full_url_rewrite: "'. variable_get("opinionlab_plugin_urlrewrite_full_url_rewrite", '') .'"'."\n";
-  $script .= '    },'."\n";
-  $script .= '    /* Configure Embedded Comment Card (optional) */'."\n";
-  $script .= '    CardOnPage: {'."\n";
-  $script .= '      enabled: '.variable_get("opinionlab_plugin_cardonpage_enabled", 0).','."\n";
-  $script .= '      close_link: "'. variable_get("opinionlab_plugin_cardonpage_close_link", '') .'"'."\n";
-  if (variable_get("opinionlab_render_type", '') == 'event') {
-    $script .= '    },'."\n";
-    $script .= '    Events: {'."\n";
-    $script .= '      /* Configure Events items (required for events) */'."\n";
-    $script .= '      poE: '.variable_get("opinionlab_events_poE", 0.0).', // Probability on Entry'."\n";
-    $script .= '      poC: '.variable_get("opinionlab_events_poC", 0.0) .', // Probability on Click'."\n";
-    $script .= '      poX: '. variable_get("opinionlab_events_poX", 0.0) .', // Probability on Exit'."\n";
-    $script .= '      onEntryDelay: '. variable_get("opinionlab_events_onEntryDelay", 0) .', // How long to delay card on Entry (in secs)'."\n";
-    $script .= '      clickDelay: '. variable_get("opinionlab_events_clickDelay", 0) .' // How long to delay card on Click (in secs)'."\n";
+}
+
+/**
+ * Helper function to check whether or not the JS code must be included on the page being loaded
+ */
+function _opinionlab_match_path() {
+  // Match path if necessary
+  $ol_pages = variable_get('opinionlab_pages', _opinionlab_settings_default_values('opinionlab_pages'));
+  if ($ol_pages != '') {
+    $path = drupal_get_path_alias($_GET['q']);
+    // Compare with the internal and path alias (if any).
+    $page_match = drupal_match_path($path, $ol_pages);
+    if ($path != $_GET['q']) {
+      $page_match = $page_match || drupal_match_path($_GET['q'], $ol_pages);
+    }
+    // When visibility has a value of 0, the JS code is included on
+    // all pages except those listed in 'pages'. When set to 1, it
+    // is included only on those pages listed in 'pages'.
+    $visibility = variable_get('opinionlab_visibility', _opinionlab_settings_default_values('opinionlab_visibility'));
+    $page_match = !($visibility xor $page_match);
   }
-  $script .= '    }'."\n";
-  $script .= '  }'."\n";
-  $script .= '}'."\n";
-
-  $script .= '/* Configure Custom Variables to Accompany Survey (optional) */'."\n";
-  $script .= '// oOobj1.Metrics.custom.clientID = 1234;'."\n";
-  $script .= '// oOobj1.Metrics.custom.countryCode = "usa";'."\n";
-
-  if (variable_get("opinionlab_render_type", '') == 'floating') {
-    $script .= '/* Object Registration (REQUIRED for [+] Floating Icon) */'."\n";
-    $script .= 'OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.render(function(){oOobj1.show()})'."\n";
-    $script .= '});'."\n";
+  else {
+    $page_match = TRUE;
   }
 
-  if (variable_get("opinionlab_render_type", '') == 'event') {
-    $script .= '/* Call Back on Page Entry (REQUIRED for Event Driven Objects) */'."\n";
-    $script .= 'OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.onEntry()});'."\n";
+  return $page_match;
+}
+
+/**
+ * Helper function to get the default values for OpinionLab settings
+ *
+ * @param string $variable "The variable you want to know the default value for.
+ * If NULL, the whole array will be returned".
+ */
+function _opinionlab_settings_default_values($variable = NULL) {
+  static $ols_defaults;
 
-    $script .= '/* Call Back on Page Exit (REQUIRED for Event Driven Objects) */'."\n";
-    $script .= 'OnlineOpinion.util.SafeAddOnUnLoadEvent(function(){oOobj1.onExit()});'."\n";
+  if (count($ols_defaults) == 0) {
+    $ols_defaults = array();
 
-    $script .= '/* Call Back on Site Exit (optional for Site Exit Event Driven Objects) */'."\n";
-    $script .= '//OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.onEntry();OnlineOpinion.util.walkAnchors(document.body, 10, /^(http:\/\/pegasus\.local|http:\/\/www\.google\.com)/i, oOobj1)});'."\n";
-  }
+    $ols_defaults['opinionlab_persistence_enabled'] = 1;
+    $ols_defaults['opinionlab_persistence_cookie_name'] = 'oo_r';
+    $ols_defaults['opinionlab_persistence_cookie_type'] = 'page';
+    $ols_defaults['opinionlab_persistence_expiration'] = 3600;
+
+    $ols_defaults['opinionlab_render_type'] = 'floating';
+
+    $ols_defaults['opinionlab_plugin_urlrewrite_active'] = 0;
+    $ols_defaults['opinionlab_plugin_urlrewrite_regex_search_pattern'] = '';
+    $ols_defaults['opinionlab_plugin_urlrewrite_regex_replace_pattern'] = '';
+    $ols_defaults['opinionlab_plugin_urlrewrite_full_url_rewrite'] = '';
+
+    $ols_defaults['opinionlab_plugin_cardonpage_enabled'] = 0;
+    $ols_defaults['opinionlab_plugin_cardonpage_close_link'] = '';
+    
+    $ols_defaults['opinionlab_events_poE'] = '0.0';
+    $ols_defaults['opinionlab_events_poC'] = '0.0';
+    $ols_defaults['opinionlab_events_poX'] = '0.0';
+    $ols_defaults['opinionlab_events_onEntryDelay'] = '0';
+    $ols_defaults['opinionlab_events_clickDelay'] = '0';
+
+    $ols_defaults['opinionlab_render_main_html'] = '<img src="/' . drupal_get_path('module', 'opinionlab') . '/images/sm_000_oo.gif" width="9px" height="9px" alt="Feedback" />Feedback';
+
+    $ols_defaults['opinionlab_render_main_div_id'] = 'oo_feedback_float';
+    $ols_defaults['opinionlab_render_main_content_id'] = 'content';
+    $ols_defaults['opinionlab_render_float_style'] = 'rightOfContent';
+    $ols_defaults['opinionlab_render_img_path'] = '/' . drupal_get_path('module', 'opinionlab') . '/images/oo_black.gif';
+    $ols_defaults['opinionlab_render_feedback_html'] = 'Feedback';
+    $ols_defaults['opinionlab_render_click_html'] = 'Click here to<br />rate this page';
 
-  if (variable_get("opinionlab_render_type", '') == 'static') {
-    $script .= '/* Object Registration (REQUIRED for Static Icon) */'."\n";
-    $script .= 'OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.render(function(){oOobj1.show()})});'."\n";
+    $ols_defaults['opinionlab_visibility'] = 0;
+    $ols_defaults['opinionlab_pages'] = "admin\nadmin/*\nnode/*/edit\nnode/add\nnode/add/*";
   }
 
-  $script .= '/*  OnlineOpinion v4.1.5, Copyright 2009 Opinionlab, Inc. */'."\n";
-  $script .= '</script>'."\n";
-  return $script;
+  if ($variable != NULL) {
+    return $ols_defaults[$variable];
+  }
+  else {
+    return $ols_defaults;
+  }
 }
diff -upN opinionlab-DRUPAL-6--1/opinionlab-static.tpl.php ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-static.tpl.php
--- opinionlab-DRUPAL-6--1/opinionlab-static.tpl.php	1970-01-01 01:00:00.000000000 +0100
+++ ../bzr-branches/trunk/drupal/sites/all/modules/opinionlab/opinionlab-static.tpl.php	2010-07-14 10:36:34.000000000 +0100
@@ -0,0 +1,54 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ *
+ * Template file for the OpinionLab Javascript code - Static version
+ *
+ */
+?>
+
+<script type="text/javascript" language="JavaScript">
+/* OnlineOpinion v<?php print $olvar['version'] ?> */
+/* This product and other products of OpinionLab, Inc. are protected by U.S.
+   Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
+/* Create new OnlineOpinion Object instance */
+var oOobj1 = new OnlineOpinion.ocode();
+/* OnlineOpinion Object Preferences */
+oOobj1.Preferences = {
+  /* Configure Object Persistence (REQUIRED) */
+  Persistence: {
+    enabled: <?php print $olvar['persistence_enabled'] ?>,           // Disappear onClick
+    cookie_name: '<?php print $olvar['persistence_cookie_name'] ?>', // cookie name
+    cookie_type: '<?php print $olvar['persistence_cookie_type'] ?>', // Remembers which page got rated
+    expiration: <?php print $olvar['persistence_expiration'] ?>      // How long to remember each page got Rated (secs)
+  },
+  /* Configure Object Parameters (REQUIRED) */
+  Render: {
+    type: '<?php print $olvar['render_type'] ?>',
+    main_div_id: '<?php print $olvar['render_main_div_id'] ?>',
+    main_html: '<?php print $olvar['render_main_html'] ?>'
+  },
+  Plugins: {
+    /* Configure URL Rewrite (optional) */
+    URLRewrite: {
+      active: <?php print $olvar['plugin_urlrewrite_active'] ?>,
+      regex_search_pattern: '<?php print $olvar['plugin_urlrewrite_regex_search_pattern'] ?>' ,
+      regex_replace_pattern: '<?php print $olvar['plugin_urlrewrite_regex_replace_pattern'] ?>',
+      full_url_rewrite: '<?php print $olvar['plugin_urlrewrite_full_url_rewrite'] ?>'
+    },
+    /* Configure Embedded Comment Card (optional) */
+    CardOnPage: {
+      enabled: <?php print $olvar['plugin_cardonpage_enabled'] ?>,
+      close_link: '<?php print $olvar['plugin_cardonpage_close_link'] ?>'
+    }
+  }
+}
+/* Configure Custom Variables to Accompany Survey (optional) */
+// oOobj1.Metrics.custom.clientID = 1234;
+// oOobj1.Metrics.custom.countryCode = "usa";
+/* Object Registration (REQUIRED for Static Icon) */
+OnlineOpinion.util.SafeAddOnLoadEvent(function(){oOobj1.render(function(){oOobj1.show()})});
+/*  OnlineOpinion v<?php print $olvar['version'] ?>, Copyright <?php print $olvar['copyright_year'] ?> Opinionlab, Inc. */
+</script>
