/*
 * Load RSS
 *
 * Copyright (c) 2010 Tom Shimada
 *
 * Depends Script:
 *	js/jquery.js (1.3.2)
 */
(function($){
  $(function(){
    $.get(
      '/rss/load?_=' + new Date().getTime(),
      function(data){
        var open_speed = 500,
            show_speed = 500,
            $area = $('#rss-area'),
            $box = $('#rss-box');
        if (!data) {
          data = '<p class="nodata">情報が取得できませんでした。</p>';
          open_speed = 200;
        }
        $area.css({
          height: $area.height() + 'px',
          overflow: 'hidden'
        });
        var loading_height = $area.height();
        $box.css({
          opacity: 0
        }).removeClass('loading').html(data);
        $area.animate(
          {
            height: $area.height() + $box.height() - loading_height
          },
          open_speed,
          'swing',
          function() {
            $area.css({
              height: '',
              overflow: ''
            });
            $box.animate(
              {
                opacity: 1
              },
              show_speed,
              'swing',
              function() {
                $box.css({
                  opacity: '',
                  zoom: ''
                });
              }
            );
          }
        );
      }
    );
  });
})(jQuery);

