<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,6 @@
-// Submenu code &quot;borrowed&quot; from lighthouseapp.com
+/**
+ * Submenu code &quot;borrowed&quot; from lighthouseapp.com
+ */
 
 var SubMenu = Class.create({
   initialize: function(li) {
@@ -17,6 +19,10 @@ var SubMenu = Class.create({
   }
 });
 
+/**
+ * Portrait Related Javascript
+ */
+
 function preventLinksExecuting() {
   $$('.portrait_image a').each(function(link) {
     link.observe('click', function(evt) {
@@ -69,6 +75,23 @@ function enablePortraitDragAndDrop() {
   }
 }
 
+function enabledPortraitHelpToggle() {
+  $('portrait_help').down('a').observe('click', function(event) {
+    $('portrait_help_div').show();
+    $('portrait_help').down('a').hide();
+    event.stop();
+  });
+  $('close_help').observe('click', function(event) {
+    $('portrait_help_div').hide();
+    $('portrait_help').down('a').show();
+    event.stop();
+  });
+}
+
+/**
+ * Choice Heirarchy code (inactive)
+ */
+
 function enableCategoryListUpdater(controller_name) {
   $$('.category_list a').each(function(link) {
     link.observe('click', function(evt) {
@@ -89,6 +112,12 @@ function enableCategoryListUpdater(controller_name) {
   });
 }
 
+/**
+ * Extended Field Editing
+ */
+
+// Incase we add a custom choice, all choices below the
+// current field should be cleared and hidden
 function clearCorrespondingFieldWhenEdited(field_id, field_class, select_id, select_class) {
   $(select_id).observe('change', function(evt) {
     $(field_id).clear();
@@ -112,6 +141,10 @@ function clearCorrespondingFieldWhenEdited(field_id, field_class, select_id, sel
   });
 }
 
+/**
+ * Quick and easy expand and collapse fucntionality for Basket Profiles
+ */
+
 function quickExpandCollapse(clickable_element, affected_element, collapsed_image, expanded_image) {
   $(clickable_element).observe('click', function(event) {
     if ($(clickable_element).src.match(collapsed_image)) {
@@ -125,6 +158,10 @@ function quickExpandCollapse(clickable_element, affected_element, collapsed_imag
   });
 }
 
+/**
+ * Search/Recent Topic result display
+ */
+
 function makeElementLinkable(id, url) {
   $(id).observe('click', function(event) {
     window.location = url;
@@ -143,23 +180,13 @@ function makeSearchResultsDivClickable() {
   });
 }
 
+/**
+ * Now setup everything to run when needed once the page is loaded
+ */
+
 document.observe('dom:loaded', function() {
   new SubMenu(&quot;user_baskets_list&quot;);
   if ($('portrait_images')) { enablePortraitDragAndDrop(); }
-  
-  if ($('portrait_help_div')) {
-    $('portrait_help').down('a').observe('click', function(event) {
-      $('portrait_help_div').show();
-      $('portrait_help').down('a').hide();
-      event.stop();
-    });
-    $('close_help').observe('click', function(event) {
-      $('portrait_help_div').hide();
-      $('portrait_help').down('a').show();
-      event.stop();
-    })
-  }
-
-  // anywhere on the site
+  if ($('portrait_help_div')) { enabledPortraitHelpToggle(); }
   makeSearchResultsDivClickable();
 });</diff>
      <filename>public/javascripts/kete.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cd912af0b58a94a693ab3850923811e03a04c61c</id>
    </parent>
  </parents>
  <author>
    <name>Kieran Pilkington</name>
    <email>kieran@katipo.co.nz</email>
  </author>
  <url>http://github.com/kete/kete/commit/5f21007aa7843b6c8b34f7cb69b4831f73bb2ccb</url>
  <id>5f21007aa7843b6c8b34f7cb69b4831f73bb2ccb</id>
  <committed-date>2009-06-08T16:35:56-07:00</committed-date>
  <authored-date>2009-06-08T16:35:56-07:00</authored-date>
  <message>refinement: cleaning up kete.js and adding comments</message>
  <tree>afce3f21fc40c4eb05d7db7a16bfab0e4d265ba1</tree>
  <committer>
    <name>Kieran Pilkington</name>
    <email>kieran@katipo.co.nz</email>
  </committer>
</commit>
