diff --git a/README.txt b/README.txt
index 12ddd75..50f13d5 100644
--- a/README.txt
+++ b/README.txt
@@ -17,6 +17,12 @@ To install the module follow the next instructions https://drupal.org/documentat
 To enable this module, visit modules, and enable Open ReadSpeaker Enterprise Highlighting module.
 Configure settings under modules -> ReadSpeaker Enterprise Highlighting -> Configure/Permissions.
 
+If you're serving your site via HTTPS, make sure to enable HTTPS via the
+settings dialog. Also, download the ReadSpeaker library into your site's
+libraries folder (usually 'sites/all/libraries').
+i.e. the ReadSpeaker javascript file should be available at:
+'sites/all/libraries/readspeaker/ReadSpeaker.js'
+
 IMPORTANT: After you have enabled the module you MUST clear your site cache,
 or the module will not work properly and you will not be able to access the settings.
 
diff --git a/open_readspeaker.admin.inc b/open_readspeaker.admin.inc
index d63cd0b..553404d 100644
--- a/open_readspeaker.admin.inc
+++ b/open_readspeaker.admin.inc
@@ -39,6 +39,12 @@ function open_readspeaker_config($form, &$form_state) {
     'tr_tr' => t('Türkçe - Turkish'),
   );
 
+  $region_options = array(
+    'na' => t('North America'),
+    'eu' => t('Europe'),
+    'as' => t('Asia Pacific'),
+  );
+
   $form['account_settings'] = array(
     '#title'       => t('ReadSpeaker account settings'),
     '#description' => t('An account at <a href="@url" target="_blank">ReadSpeaker</a> is required.', array('@url' => 'http://www.readspeaker.com/')),
@@ -47,6 +53,22 @@ function open_readspeaker_config($form, &$form_state) {
     '#collapsed'   => FALSE,
   );
 
+  $form['account_settings']['open_readspeaker_region'] = array(
+    '#title' => t('Site region'),
+    '#description' => t('Select the geographic region you expect most of your site traffic to be in.'),
+    '#type' => 'select',
+    '#options' => $region_options,
+    '#default_value' => variable_get('open_readspeaker_region', OPEN_READSPEAKER_DEFAULT_REGION),
+    '#required' => TRUE,
+  );
+
+  $form['account_settings']['open_readspeaker_https'] = array(
+    '#title' => t('Enable HTTPS'),
+    '#description' => t('Required if your site has SSL enabled.<br />If enabled, you need to download the ReadSpeaker library from your ReadSpeaker admin dashboard and extract it into your libraries folder (usually "sites/all/libraries").'),
+    '#type' => 'checkbox',
+    '#default_value' => variable_get('open_readspeaker_https', OPEN_READSPEAKER_DEFAULT_HTTPS),
+  );
+
   $form['account_settings']['open_readspeaker_accountid'] = array(
     '#title'         => t('Enter your ReadSpeaker ID'),
     '#description'   => t('Enter your ReadSpeaker ID from <a href="@url" target="_blank">https://admin.readspeaker.com/portal</a>.', array('@url' => 'https://admin.readspeaker.com/portal')),
diff --git a/open_readspeaker.info b/open_readspeaker.info
index 10e8256..09a00d3 100644
--- a/open_readspeaker.info
+++ b/open_readspeaker.info
@@ -4,4 +4,6 @@ package = Content
 
 core = 7.x
 
+dependencies[] = libraries (>= 2.0)
+
 configure = admin/config/services/open-readspeaker
diff --git a/open_readspeaker.module b/open_readspeaker.module
index dd69338..83b3deb 100644
--- a/open_readspeaker.module
+++ b/open_readspeaker.module
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * @file
  * Open ReadSpeaker
@@ -10,6 +9,10 @@
  * use of the reader.
  */
 
+define('OPEN_READSPEAKER_EMBED_URL', 'http://f1.[region].readspeaker.com/script/[accountid]/ReadSpeaker.js?pids=embhl[customparams]');
+define('OPEN_READSPEAKER_DEFAULT_REGION', 'eu');
+define('OPEN_READSPEAKER_DEFAULT_HTTPS', FALSE);
+
 /**
  * Implements hook_menu().
  */
@@ -51,6 +54,22 @@ function open_readspeaker_theme($existing, $type, $theme, $path) {
 }
 
 /**
+ * Implements hook_libraries_info().
+ */
+function open_readspeaker_libraries_info() {
+  $libraries['readspeaker'] = array(
+    'name' => 'ReadSpeaker',
+    'vendor url' => 'http://www.readspeaker.com/',
+    'files' => array(
+      'js' => array('ReadSpeaker.js'),
+    ),
+    'version callback' => '_open_readspeaker_shortcircuit_version',
+  );
+
+  return $libraries;
+}
+
+/**
  * Implements hook_block_info().
  */
 function open_readspeaker_block_info() {
@@ -85,17 +104,33 @@ function open_readspeaker_block_view($delta = '') {
  * ReadSpeaker button.
  */
 function theme_open_readspeaker_ui() {
-  // We don't use the $vars param.
-  global $is_https;
-
   $output = '';
 
-  $http = 'http';
+  // Load library if required.
+  $use_https = variable_get('open_readspeaker_https', OPEN_READSPEAKER_DEFAULT_HTTPS);
+  if ($use_https) {
+    $library = libraries_detect('readspeaker');
+    if (empty($library['installed'])) {
+      drupal_set_message(t('ReadSpeaker library not found. Please download and extract into your site\'s libraries folder (see README.txt for more info).'), 'error', FALSE);
+      return $output;
+    }
+    else {
+      // Manually load library as 'external' since we need to add a query
+      // string.
+      $lib_url = url($library['library path'] . '/ReadSpeaker.js', array(
+        'query' => array(
+          'pids' => 'embhl',
+        ),
+      ));
+      drupal_add_js($lib_url, 'external');
+    }
+  }
 
-  $accountid             = variable_get('open_readspeaker_accountid', '');
+  $accountid = variable_get('open_readspeaker_accountid', '');
   $open_readspeaker_i18n = variable_get('open_readspeaker_i18n', '');
-  $custom_style          = variable_get('open_readspeaker_buttonstyle', '');
-  $custom_param          = variable_get('open_readspeaker_customparam', '');
+  $custom_style = variable_get('open_readspeaker_buttonstyle', '');
+  $protocol = ($use_https) ? 'https' : 'http';
+  $read_id = variable_get('open_readspeaker_reading_area', 'rs_read_this');
 
   if (empty($accountid)) {
     $output .= '<p>' . t('In order to ReadSpeaker work you whould need an <strong>account id</strong>.');
@@ -111,11 +146,20 @@ function theme_open_readspeaker_ui() {
     return $output;
   }
 
-  if ($is_https) {
-    $http = 'https';
+  // Add ReadSpeaker embed if we're not serving via HTTPS.
+  if (!$use_https) {
+    // Get embed URL and replace tokens as required.
+    $embed_url = str_replace(array(
+      '[region]',
+      '[accountid]',
+      '[customparams]',
+    ), array(
+      variable_get('open_readspeaker_region', OPEN_READSPEAKER_DEFAULT_REGION),
+      $accountid,
+      variable_get('open_readspeaker_customparam', ''),
+    ), OPEN_READSPEAKER_EMBED_URL);
+    drupal_add_js($embed_url, 'external');
   }
-
-  drupal_add_js($http . "://f1.eu.readspeaker.com/script/$accountid/ReadSpeaker.js?pids=embhl{$custom_param}", 'external');
   drupal_add_css(drupal_get_path('module', 'open_readspeaker') . '/open_readspeaker.css', array(
     'group' => CSS_THEME,
     'media' => 'screen',
@@ -123,15 +167,24 @@ function theme_open_readspeaker_ui() {
 
   $request_path = url(current_path(), array('absolute' => TRUE));
 
-  $output .= '<!-- RS_MODULE_CODE -->';
   $output .= '<div id="readspeaker_button1" class="rs_skip rsbtn rs_preserve"' . $custom_style . '>';
-  $output .= '<a class="rsbtn_play" title="' . t('Listen to this page using ReadSpeaker') . '" accesskey="L" href="' . $http . '://app.eu.readspeaker.com/cgi-bin/rsent?customerid=' . $accountid . '&amp;lang=' . $open_readspeaker_i18n . '&amp;readid=' . variable_get('open_readspeaker_reading_area', 'rs_read_this') . '&amp;url=' . urlencode($request_path) . '">';
+  $output .= '<a rel="nofollow" class="rsbtn_play" title="' . t('Listen to this page using ReadSpeaker') . '" accesskey="L" href="' . $protocol . '://app.readspeaker.com/cgi-bin/rsent?customerid=' . $accountid . '&amp;lang=' . $open_readspeaker_i18n . '&amp;readid=' . $read_id . '&amp;url=' . urlencode($request_path) . '">';
   $output .= '<span class="rsbtn_left rsimg rspart"><span class="rsbtn_text"><span>' . t('Listen') . '</span></span></span>';
   $output .= '<span class="rsbtn_right rsimg rsplay rspart"></span>';
   $output .= '</a></div>';
-  $output .= '<div id="rs_read_this">';
-  $output .= '</div>';
+  // Add 'read this' element if a custom one isn't defined.
+  if ($read_id == 'rs_read_this') {
+    $output .= '<div id="rs_read_this">';
+    $output .= '</div>';
+  }
 
   return $output;
 }
 
+/**
+ * Short-circuits version checks for the Libraries API since we don't care
+ * about them.
+ */
+function _open_readspeaker_shortcircuit_version() {
+  return TRUE;
+}
