/**
 * Setup custom styles
 */
$(document).ready(function() {
  
  $('abbr[class*=timeago]').livequery(function() {
      $(this).timeago();
  });
  
  $('img.favicon').livequery(function() {
       var img = $(this);
       if (img.attr('src') != '') return;
       var domain = img.attr('title');
       if (domain) {
            var url = 'http://www.google.com/s2/favicons?domain='+domain; 
            img.attr('src',url);
       }
       return false;
  });
  
  $('img.profile-image-from-twitter').each(function() {
      var url = 'http://search.twitter.com/search.json?q=from%3A'+$(this).attr('title')+'&callback=?';
      var img = $(this);
      $.getJSON(url,  function(data){   
            var url = data.results[0].profile_image_url;
            img.attr('src',url);
      });
  });
  
  $('.status').livequery(function() {
    var commands = $(this).find('.commands');
    $(this).hover(function() {
            commands.addClass('commands-hover');
        },
        function() {
            commands.removeClass('commands-hover');
        }
     );
   });
});
