<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,4 @@
 
-
 if (!Prototype || Prototype.Version.indexOf('1.6') !== 0) {
   throw &quot;This script requires Prototype &gt;= 1.6.&quot;;
 }
@@ -8,7 +7,19 @@ Object.isDate = function(object) {
   return object instanceof Date;
 };
 
+/** 
+ *  class Cookie
+ *  Creates a cookie.
+**/
 var Cookie = Class.create({
+  /**
+   *  new Cookie(name, value[, expires])
+   *  
+   *  - name (String): The name of the cookie.
+   *  - value (String): The value of the cookie.
+   *  - expires (Number | Date): Exact date (or number of days from now) that
+   *     the cookie will expire.
+  **/
   initialize: function(name, value, expires) {
     if (Object.isNumber(expires)) {
       var days = expires;
@@ -16,11 +27,11 @@ var Cookie = Class.create({
       expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000));
     }
     
-    if (Object.isDate(expires)) {
+    if (Object.isDate(expires))
       expires = expires.toGMTString();
-    }
-    
-    if (expires !== &quot;&quot;) expires = &quot;; expires=&quot; + expires;
+
+    if (!Object.isUndefined(expires) &amp;&amp; expires !== &quot;&quot;)
+      expires = &quot;; expires=&quot; + expires;
     
     this.name    = name;
     this.value   = value;
@@ -38,23 +49,47 @@ var Cookie = Class.create({
   }
 });
 
+/**
+ *  namespace Cookie
+**/
 Object.extend(Cookie, {
+  /**
+   *  Cookie.set(name, value, expires)
+   *  
+   *  Alias of [[Cookie#initialize]].
+  **/
   set: function(name, value, expires) {
     return new Cookie(name, value, expires);
   },
   
+  /**
+   *  Cookie.get(name)
+   *  
+   *  Returns the value of the cookie with the given name.
+   *  - name (String): The name of the cookie to retrieve.
+  **/
   get: function(name) {
     var c = document.cookie.split(';');
     
-    for (var i = 0, cookie; i &lt; c.length; i__) {
-      cookie = c[i].split('=').invoke('strip');
-      if (cookie[0] === name) return cookie[1];
+    for (var i = 0, cookie; i &lt; c.length; i++) {
+      cookie = c[i].split('=');
+      if (cookie[0].strip() === name)
+        return cookie[1].strip();
     }
     
     return null;
   },
   
-  erase: function(name) {
+  /**
+   *  Cookie.unset(name)
+   *  
+   *  Deletes a cookie.
+   *  - name (String): The name of the cookie to delete.
+   *  
+  **/
+  unset: function(name) {
     return Cookie.set(name, &quot;&quot;, -1);
   }
 });
+
+Cookie.erase = Cookie.unset;</diff>
      <filename>cookie.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f1aeb06598654ef69c3a50cc6694f4b8c5513bf9</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Dupont</name>
    <email>prototype@andrewdupont.net</email>
  </author>
  <url>http://github.com/savetheclocktower/javascript-stuff/commit/8414210e3cb82fd3e0e20f85ad0a65d9316b573c</url>
  <id>8414210e3cb82fd3e0e20f85ad0a65d9316b573c</id>
  <committed-date>2008-12-30T16:13:16-08:00</committed-date>
  <authored-date>2008-12-30T16:13:16-08:00</authored-date>
  <message>Added some documentation for the cookie script and corrected some stupid typos. (Still haven't tested this thing.)</message>
  <tree>37590513aa7344fefcf465146ffe76d9b110d37d</tree>
  <committer>
    <name>Andrew Dupont</name>
    <email>prototype@andrewdupont.net</email>
  </committer>
</commit>
