diff --git a/modules/themekey.og.inc b/modules/themekey.og.inc
new file mode 100644
index 0000000..1c53910
--- /dev/null
+++ b/modules/themekey.og.inc
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * Implements hook_themekey_properties().
+ *
+ * Provides additional properties for module ThemeKey:
+ * - comment:cid
+ *
+ * @return
+ *   array of themekey properties and mapping functions
+ */
+function themekey_og_themekey_properties() {
+  if (module_exists('og')){
+    // Attributes for properties
+    $attributes = array();
+    $attributes['group:nid'] = array(
+      'description' => t('Group: NID - The nid of an og group'),
+      'validator' => 'themekey_validator_ctype_digit',
+      'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
+    );
+
+    // Mapping functions
+    $maps = array();
+    $maps[] = array('src'       => 'node:nid',
+                    'dst'       => 'group:nid',
+                    'callback'  => 'themekey_custom_nid2gnid');
+
+    return array('attributes' => $attributes, 'maps' => $maps);
+  }
+}
+
+/*
+ * Callback to get the group nid from a node nid
+ */
+function themekey_og_nid2gnid($nid){
+  if ($group = og_determine_context()){
+    return $group->nid;
+  }
+  else {
+    // if it's a legitimate group nid
+    $sql = 'SELECT COUNT(nid) FROM {og} WHERE nid = %d';
+    if ($count = db_result(db_query($sql, $nid))){
+      // return the currently discovered nid
+      return $nid;
+    }
+  }
+}
