$(document).ready(function(){
  $('#TVFeed .header span.pseudolink').click(function(){
    if ( $(this).is('.selected') )
    {
      return false;
    }
    $('#TVFeed .header .loading').show();
    $('#TVFeed .content').html('Loading...');
    $(this).siblings().removeClass('selected');
    $(this).addClass('selected');
    
    $.ajax({
      url: '/json/feed',
      type: 'post',
      dataType: 'json',
      data: { type: $(this).text() },
      success: function(data) {
        if ( data.content )
        {
          $('#TVFeed .content').html( data.content );
          $('#TVFeed .header .loading').hide();
        }
      }
    });
    
  });
});