diff --git a/live_person.module b/live_person.module
index 0131d8c..4be1865 100644
--- a/live_person.module
+++ b/live_person.module
@@ -69,6 +69,141 @@ function live_person_requirements($phase) {
 }
 
 /**
+ * Implement hook_block_info()
+ * @return array
+ */
+function live_person_block_info() {
+  return array(
+    'live_person' => array(
+    'info' => t('Live Person Chat Block'),
+    'cache' => DRUPAL_CACHE_PER_PAGE,
+    ),
+  );
+}
+
+/**
+ * Implement hook_block_configure()
+ * @param string $delta
+ * @return array
+ */
+function live_person_block_configure($delta) {
+  switch ($delta) {
+    case 'live_person':
+      $form = array(
+        'width' => array(
+          '#type' => 'textfield',
+          '#title' => t('Pop-up window width'),
+          '#description' => t('Set the width of the pop-up chat window'),
+          '#default_value' => variable_get('live_person_block_width', 500),
+        ),
+        'height' => array(
+          '#type' => 'textfield',
+          '#title' => t('Pop-up window height'),
+          '#description' => t('Set the height of the pop-up chat window'),
+          '#default_value' => variable_get('live_person_block_height', 500),
+        ),
+      );
+      return $form;
+      break;
+  }
+}
+
+/**
+ * Implement hook_block_save()
+ * @param string $delta
+ * @param array $edit
+ */
+function live_person_block_save($delta, $edit) {
+  switch ($delta) {
+    case 'live_person':
+      variable_set('live_person_block_width', $edit['width']);
+      variable_set('live_person_block_height', $edit['height']);
+      break;
+  }
+}
+
+/**
+ * Implement hook_block_view()
+ * @param string $delta
+ * @return array
+ */
+function live_person_block_view($delta) {
+  switch ($delta) {
+    case 'live_person':
+      return array(
+        'subject' => t('Live Chat'),
+        'content' => _live_person_block_content(),
+      );
+  }
+}
+
+/**
+ * Return content for the block
+ * @return string
+ */
+function _live_person_block_content() {
+  $account_id = variable_get('live_person_account', '');
+  $image_src = url('https://server.iad.liveperson.net/hc/' . $account_id . '/', array(
+    'query' => _live_person_build_query('repstate'),
+  ));
+  $image = theme('image', array(
+    'path' => $image_src,
+    'attributes' => array('border' => 0, 'name' => 'hcIcon'),
+    ));
+  return l($image, 'https://server.iad.liveperson.net/hc/' . $account_id . '/', array(
+    'html' => TRUE,
+    'attributes' => array(
+      'id' => 'live-person',
+      'target' => 'chat' . $account_id,
+    ),
+    'query' => _live_person_build_query('file'),
+  ));
+}
+
+/**
+ * Build a query array for various src attributes in the block
+ * @param string $cmd
+ * @return array
+ */
+function _live_person_build_query($cmd) {
+  $account_id = variable_get('live_person_account', '');
+  $image_url = _live_person_get_image_url();
+  $query = array(
+    'cmd' => $cmd,
+    'site' => $account_id,
+    'channel' => 'web',
+    'ver' => 1,
+  );
+  if ($cmd == 'file') {
+    $query['file'] = 'visitorWantsToChat';
+    $query['byhref'] = 1;
+  }
+  if ($image_url) {
+    $query['imageUrl'] = $image_url;
+  }
+  return $query;
+}
+
+/**
+ * Check for a live_person directory in the theme and use that directory for
+ * images in the block.
+ *
+ * @return mixed
+ *  A URL string or FALSE if there is no directory in the theme
+ */
+function _live_person_get_image_url() {
+  global $theme;
+  $live_person_theme_path = drupal_get_path('theme', $theme) . '/live_person';
+  if (file_exists($live_person_theme_path)) {
+    global $base_url;
+    return url($base_url . '/'. $live_person_theme_path, array('absolute' => TRUE));
+  }
+  else {
+    return FALSE;
+  }
+}
+
+/**
  * Based on visibility setting this function returns TRUE if Live Person code should
  * be added to the current page and otherwise FALSE.
  */
