<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 /*
  AUTHOR James Padolsey (http://james.padolsey.com)
- VERSION 1.01
- UPDATED 06-06-2009
+ VERSION 1.02
+ UPDATED 07-06-2009
 */
 
 var prettyPrint = (function(){
@@ -22,14 +22,7 @@ var prettyPrint = (function(){
             /* Add attributes to el */
             if (attrs &amp;&amp; attrs.style) {
                 var styles = attrs.style;
-                for (var prop in styles) {
-                    if (styles.hasOwnProperty(prop)) {
-                        try{
-                            /* Yes, IE6 SUCKS! */
-                            el.style[prop] = styles[prop];
-                        }catch(e){}
-                    }
-                }
+                util.applyCSS( el, attrs.style );
                 delete attrs.style;
             }
             for (attr in attrs) {
@@ -42,6 +35,18 @@ var prettyPrint = (function(){
         
         },
         
+        applyCSS: function(el, styles) {
+            /* Applies CSS to a single element */
+            for (var prop in styles) {
+                if (styles.hasOwnProperty(prop)) {
+                    try{
+                        /* Yes, IE6 SUCKS! */
+                        el.style[prop] = styles[prop];
+                    }catch(e){}
+                }
+            }
+        },
+        
         txt: function(t) {
             /* Create text node */
             return document.createTextNode(t);
@@ -57,7 +62,21 @@ var prettyPrint = (function(){
                 tr = util.el('tr'), td,
                 attrs = {
                     style: util.getStyles(cellType, type),
-                    colSpan: colSpan
+                    colSpan: colSpan,
+                    onmouseover: function() {
+                        var tds = this.parentNode.childNodes;
+                        util.forEach(tds, function(cell){
+                            if (cell.nodeName.toLowerCase() !== 'td') { return; }
+                            util.applyCSS(cell, util.getStyles('td_hover', type));
+                        });
+                    },
+                    onmouseout: function() {
+                        var tds = this.parentNode.childNodes;
+                        util.forEach(tds, function(cell){
+                            if (cell.nodeName.toLowerCase() !== 'td') { return; }
+                            util.applyCSS(cell, util.getStyles('td', type));
+                        });
+                    }
                 };
                 
             util.forEach(cells, function(cell){
@@ -542,22 +561,6 @@ var prettyPrint = (function(){
                 stack[key||'TOP'] = fn;
                 
                 var miniTable = util.table(['Function',null], 'function'),
-                    span = util.el('span', {
-                        innerHTML:  'function(){...} &lt;b style=&quot;visibility:hidden;&quot;&gt;[+]&lt;/b&gt;',
-                        onmouseover: function() {
-                            this.getElementsByTagName('b')[0].style.visibility = 'visible';
-                        },
-                        onmouseout: function() {
-                            this.getElementsByTagName('b')[0].style.visibility = 'hidden';
-                        },
-                        onclick: function() {
-                            this.style.display = 'none';
-                            this.parentNode.appendChild(miniTable.node);
-                        },
-                        style: {
-                            cursor: 'pointer'
-                        }
-                    }),
                     argsTable = util.table(['Arguments']),
                     args = fn.toString().match(/\((.+?)\)/),
                     body = fn.toString().match(/\(.*?\)\s+?\{?([\S\s]+)/)[1].replace(/\}?$/,'');
@@ -566,36 +569,31 @@ var prettyPrint = (function(){
                     .addRow(['arguments', args ? args[1].replace(/[^\w_,\s]/g,'') : '&lt;small&gt;[none/native]&lt;/small&gt;'])
                     .addRow(['body', body]);
                     
-                return settings.expanded ? miniTable.node : span;
-            },
-            'date' : function(date) {
-                
-                var miniTable = util.table(['Date',null], 'date');
-                var span = util.el('span', {
-                    innerHTML:  (+date) + ' &lt;b style=&quot;visibility:hidden;&quot;&gt;[+]&lt;/b&gt;',
-                    onmouseover: function() {
-                        this.getElementsByTagName('b')[0].style.visibility = 'visible';
-                    },
-                    onmouseout: function() {
-                        this.getElementsByTagName('b')[0].style.visibility = 'hidden';
-                    },
-                    onclick: function() {
-                        this.style.display = 'none';
+                return settings.expanded ? miniTable.node : util.expander(
+                    'function(){...}',
+                    'Click to see more about this function.',
+                    function(){
                         this.parentNode.appendChild(miniTable.node);
-                    },
-                    style: {
-                        cursor: 'pointer'
                     }
-                });
+                );
+            },
+            'date' : function(date) {
                 
-                date = date.toString().split(/\s/);
+                var miniTable = util.table(['Date',null], 'date'),
+                    sDate = date.toString().split(/\s/);
                 
-                /* TODO: Make cross-browser functional */
+                /* TODO: Make this work well in IE! */
                 miniTable
-                    .addRow(['Time', date[4]])
-                    .addRow(['Date', date.slice(0,4).join('-')]);
+                    .addRow(['Time', sDate[4]])
+                    .addRow(['Date', sDate.slice(0,4).join('-')]);
                     
-                return settings.expanded ? miniTable.node : span;
+                return settings.expanded ? miniTable.node : util.expander(
+                    'Date (timestamp): ' + (+date),
+                    'Click to see a little more info about this date',
+                    function() {
+                        this.parentNode.appendChild(miniTable.node);
+                    }
+                );
                 
             },
             'boolean' : function(bool) {
@@ -691,6 +689,10 @@ var prettyPrint = (function(){
                     fontFamily: '&quot;Consolas&quot;,&quot;Lucida Console&quot;,Courier,mono',
                     whiteSpace: 'nowrap'
                 },
+                td_hover: {
+                    /* Styles defined here will apply to all tr:hover &gt; td,
+                        - Be aware that &quot;inheritable&quot; properties (e.g. fontWeight) WILL BE INHERITED */
+                },
                 th: {
                     padding: '5px',
                     fontSize: '12px',</diff>
      <filename>prettyprint.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cb7874eba4346455743e741e718dd8320fa055c6</id>
    </parent>
  </parents>
  <author>
    <name>James Padolsey</name>
    <email>jamespadolsey@gmail.com</email>
  </author>
  <url>http://github.com/jamespadolsey/prettyPrint.js/commit/e27783e56f7e0b05048b4d6d6e0ac1590cfe0480</url>
  <id>e27783e56f7e0b05048b4d6d6e0ac1590cfe0480</id>
  <committed-date>2009-06-07T03:17:54-07:00</committed-date>
  <authored-date>2009-06-07T03:17:54-07:00</authored-date>
  <message>Added td_hover style option + util.applyCSS</message>
  <tree>fef5f205c0d22684560228ca4bb199b1d78ce52a</tree>
  <committer>
    <name>James Padolsey</name>
    <email>jamespadolsey@gmail.com</email>
  </committer>
</commit>
